forked from plone/volto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Nilesh <[email protected]> Co-authored-by: Jefferson Bledsoe <[email protected]> Co-authored-by: ichim-david <[email protected]>
- Loading branch information
1 parent
86d9a50
commit f651bf6
Showing
3 changed files
with
120 additions
and
142 deletions.
There are no files selected for viewing
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 @@ | ||
Refactor the `Register` component from class-based to functional. @Tishasoumya-02 |
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
49 changes: 49 additions & 0 deletions
49
packages/volto/src/components/theme/Register/Register.stories.jsx
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,49 @@ | ||
import { injectIntl } from 'react-intl'; | ||
import React from 'react'; | ||
import RegisterComponent from './Register'; | ||
import { RealStoreWrapper as Wrapper } from '@plone/volto/storybook'; | ||
|
||
const IntlRegister = injectIntl(RegisterComponent); | ||
|
||
function StoryComponent(args) { | ||
return ( | ||
<Wrapper | ||
customStore={{ | ||
users: { | ||
create: { | ||
loading: false, | ||
loaded: true, | ||
...args, | ||
}, | ||
}, | ||
intl: { | ||
locale: 'en', | ||
messages: {}, | ||
}, | ||
}} | ||
> | ||
<div id="toolbar" style={{ display: 'none' }} /> | ||
<IntlRegister /> | ||
</Wrapper> | ||
); | ||
} | ||
|
||
export const Default = StoryComponent.bind({}); | ||
Default.args = { | ||
error: false, | ||
}; | ||
|
||
export default { | ||
title: 'Public components/Register', | ||
component: RegisterComponent, | ||
|
||
decorators: [ | ||
(Story) => ( | ||
<div className="ui segment form attached" style={{ width: '600px' }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
|
||
argTypes: {}, | ||
}; |