Skip to content

Commit

Permalink
feat: Add missing WizardErrors that was lost during migration (#1506)
Browse files Browse the repository at this point in the history
* feat: Add missing WizardErrors that was lost during migration

* fix: Rename DualFieldWrapper into WizardDualFieldWrapper

* chore: Add Quentin as codeowner
  • Loading branch information
ptbrowne authored Jul 20, 2020
1 parent 4b19258 commit 5b62f3e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# General code owners
* @ptbrowne @y-lohse
* @ptbrowne @y-lohse @crash--
6 changes: 5 additions & 1 deletion react/Wizard/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
WizardNextButton,
WizardTitle,
WizardMain,
WizardFooter
WizardFooter,
WizardErrors
} from '.'
import Icon from 'cozy-ui/transpiled/react/Icon'
import Field from 'cozy-ui/transpiled/react/Field'
Expand Down Expand Up @@ -39,6 +40,9 @@ const WizardExample = ({ onNext, onRegister }) => {
<WizardMain>
<Field label='Login' type='text' placeholder='[email protected]' />
<Field label='Password' type='text' />
<WizardErrors tag='p'>
There is an error
</WizardErrors>
</WizardMain>
<WizardFooter className={isTiny ? 'u-mt-auto' : 'u-pb-2'}>
<WizardNextButton
Expand Down
18 changes: 17 additions & 1 deletion react/Wizard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const WizardDualField = ({ children, hasFocus, hasError }) => {
)
}

export const DualFieldWrapper = ({ children }) => {
export const WizardDualFieldWrapper = ({ children }) => {
return <div className={styles['wizard-dualfield-wrapper']}>{children}</div>
}

Expand Down Expand Up @@ -163,3 +163,19 @@ export const WizardNotice = ({
</Component>
)
}

export const WizardErrors = ({
children,
className,
tag: Component,
...props
}) => {
return (
<Component
className={cx(styles['wizard-errors'], 'u-error', className)}
{...props}
>
{children}
</Component>
)
}

0 comments on commit 5b62f3e

Please sign in to comment.