-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Had to undo part of the work done by ritmo in the features, since the form state was messied with unnecessarily. - Unified the tabs and checkboxes styles, both using the same DetailedBox component styles (since they are identical). - Modals were integrated in all process options, except for the maxCensusSize, which will be in the next commit
- Loading branch information
1 parent
41e3239
commit 23a2655
Showing
18 changed files
with
265 additions
and
241 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Checkbox, CheckboxProps, Text, useMultiStyleConfig } from '@chakra-ui/react' | ||
import { cloneElement, ReactElement } from 'react' | ||
import { useFormContext } from 'react-hook-form' | ||
|
||
export type DetailedBoxProps = CheckboxProps & { | ||
badge?: ReactElement | ||
description?: string | ||
icon?: ReactElement | ||
name: string | ||
title: string | ||
} | ||
|
||
export const DetailedBox = ({ icon, badge, title, description, name, ...props }: DetailedBoxProps) => { | ||
const styles = useMultiStyleConfig('DetailedBox', props) | ||
const { register } = useFormContext() | ||
|
||
return ( | ||
<Checkbox variant='detailed' {...register(name)} {...props} sx={styles.checkbox}> | ||
<Text sx={styles.title}> | ||
{icon && cloneElement(icon, { sx: styles.icon })} | ||
{title} | ||
</Text> | ||
<Text sx={styles.description}>{description}</Text> | ||
|
||
{badge && cloneElement(badge, { sx: styles.badge })} | ||
</Checkbox> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...s/ProcessCreate/StepForm/SaasFeatures.tsx → ...nents/ProcessCreate/StepForm/Features.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.