diff --git a/ui/pages/unlock-page/README.mdx b/ui/pages/unlock-page/README.mdx
new file mode 100644
index 000000000..292d21265
--- /dev/null
+++ b/ui/pages/unlock-page/README.mdx
@@ -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
+
+
+
+## Component API
+
+
+
+| 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` |
diff --git a/ui/pages/unlock-page/unlock-page.component.js b/ui/pages/unlock-page/unlock-page.component.js
index a0bcedb94..bb7718e2e 100644
--- a/ui/pages/unlock-page/unlock-page.component.js
+++ b/ui/pages/unlock-page/unlock-page.component.js
@@ -14,11 +14,29 @@ export default class UnlockPage extends Component {
};
static propTypes = {
+ /**
+ * History router for redirect after action
+ */
history: PropTypes.object.isRequired,
+ /**
+ * If isUnlocked is true will redirect to most recent route in history
+ */
isUnlocked: PropTypes.bool,
+ /**
+ * onClick handler for "import using Secret Recovery Phrase" link
+ */
onRestore: PropTypes.func,
+ /**
+ * onSumbit handler when form is submitted
+ */
onSubmit: PropTypes.func,
+ /**
+ * Force update metamask data state
+ */
forceUpdateMetamaskState: PropTypes.func,
+ /**
+ * Event handler to show metametrics modal
+ */
showOptInModal: PropTypes.func,
};
diff --git a/ui/pages/unlock-page/unlock-page.stories.js b/ui/pages/unlock-page/unlock-page.stories.js
index a256c7090..006e3e3bb 100644
--- a/ui/pages/unlock-page/unlock-page.stories.js
+++ b/ui/pages/unlock-page/unlock-page.stories.js
@@ -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 (
- ({
- participateInMetaMetrics: true,
- })}
- showOptInModal={() => null}
- history={{}}
- />
- );
+export const DefaultStory = (args) => {
+ const history = createBrowserHistory();
+ return ;
+};
+
+DefaultStory.storyName = 'Default';
+
+DefaultStory.args = {
+ forceUpdateMetamaskState: () => ({
+ participateInMetaMetrics: true,
+ }),
};
DefaultStory.storyName = 'Default';