Fix unlock-page component for new Storybook format (#12894)
* unlock-page * Updating comments and removing broken args table Co-authored-by: georgewrmarshall <george.marshall@consensys.net>feature/default_network_editable
parent
bab48c809a
commit
9fcfbe7609
@ -0,0 +1,27 @@ |
||||
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; |
||||
|
||||
import UnlockPage from '.'; |
||||
|
||||
# Unlock Page |
||||
|
||||
Portal page for user to auth the access of their account |
||||
|
||||
<Canvas> |
||||
<Story id="ui-pages-unlock-page-unlock-page-stories-js--default-story" /> |
||||
</Canvas> |
||||
|
||||
## Component API |
||||
|
||||
<!-- |
||||
ArgsTable doesn't work with SectionShape |
||||
<ArgsTable of={MetaMaskTranslation} /> |
||||
--> |
||||
|
||||
| Name | Description | |
||||
| -------------------------- | -------------------------------------------------------------------------- | |
||||
| `history` | History router for redirect after action `object` | |
||||
| `isUnlocked` | If isUnlocked is true will redirect to most recent route in history `bool` | |
||||
| `onRestore` | onClick handler for "import using Secret Recovery Phrase" link `func` | |
||||
| `onSubmit` | onSumbit handler when form is submitted `func` | |
||||
| `forceUpdateMetamaskState` | Force update metamask data state `func` | |
||||
| `showOptInModal` | Event handler to show metametrics modal `func` | |
@ -1,23 +1,38 @@ |
||||
import { createBrowserHistory } from 'history'; |
||||
import React from 'react'; |
||||
import { action } from '@storybook/addon-actions'; |
||||
import README from './README.mdx'; |
||||
import UnlockPage from './unlock-page.component'; |
||||
|
||||
export default { |
||||
title: 'Pages/UnlockPage', |
||||
id: __filename, |
||||
component: UnlockPage, |
||||
parameters: { |
||||
docs: { |
||||
page: README, |
||||
}, |
||||
}, |
||||
argTypes: { |
||||
history: { control: 'object' }, |
||||
isUnlocked: { control: 'boolean' }, |
||||
onRestore: { action: 'onRestore' }, |
||||
onSubmit: { action: 'onSubmit' }, |
||||
forceUpdateMetamaskState: { action: 'forceUpdateMetamaskState' }, |
||||
showOptInModal: { action: 'showOptInModal' }, |
||||
}, |
||||
}; |
||||
|
||||
export const DefaultStory = () => { |
||||
return ( |
||||
<UnlockPage |
||||
onSubmit={action('Login')} |
||||
forceUpdateMetamaskState={() => ({ |
||||
participateInMetaMetrics: true, |
||||
})} |
||||
showOptInModal={() => null} |
||||
history={{}} |
||||
/> |
||||
); |
||||
export const DefaultStory = (args) => { |
||||
const history = createBrowserHistory(); |
||||
return <UnlockPage {...args} history={history} />; |
||||
}; |
||||
|
||||
DefaultStory.storyName = 'Default'; |
||||
|
||||
DefaultStory.args = { |
||||
forceUpdateMetamaskState: () => ({ |
||||
participateInMetaMetrics: true, |
||||
}), |
||||
}; |
||||
|
||||
DefaultStory.storyName = 'Default'; |
||||
|
Loading…
Reference in new issue