2019-09-04 13:09:19 +00:00
|
|
|
import CardDecorator from "@saleor/storybook//CardDecorator";
|
2019-09-02 15:56:59 +00:00
|
|
|
import Decorator from "@saleor/storybook//Decorator";
|
2020-04-07 13:29:31 +00:00
|
|
|
import { AccountErrorCode } from "@saleor/types/globalTypes";
|
2020-05-14 09:30:32 +00:00
|
|
|
import { storiesOf } from "@storybook/react";
|
|
|
|
import React from "react";
|
|
|
|
|
2019-09-02 15:56:59 +00:00
|
|
|
import NewPasswordPage from "./NewPasswordPage";
|
|
|
|
|
|
|
|
storiesOf("Views / Authentication / Set up a new password", module)
|
2019-09-04 13:09:19 +00:00
|
|
|
.addDecorator(CardDecorator)
|
2019-09-02 15:56:59 +00:00
|
|
|
.addDecorator(Decorator)
|
2019-09-02 19:23:37 +00:00
|
|
|
.add("default", () => (
|
2020-04-07 13:29:31 +00:00
|
|
|
<NewPasswordPage errors={[]} disabled={false} onSubmit={() => undefined} />
|
2019-09-02 19:23:37 +00:00
|
|
|
))
|
|
|
|
.add("loading", () => (
|
2020-04-07 13:29:31 +00:00
|
|
|
<NewPasswordPage errors={[]} disabled={true} onSubmit={() => undefined} />
|
|
|
|
))
|
|
|
|
.add("too short error", () => (
|
|
|
|
<NewPasswordPage
|
|
|
|
errors={["password"].map(field => ({
|
|
|
|
__typename: "AccountError",
|
|
|
|
code: AccountErrorCode.PASSWORD_TOO_SHORT,
|
|
|
|
field
|
|
|
|
}))}
|
|
|
|
disabled={false}
|
|
|
|
onSubmit={() => undefined}
|
|
|
|
/>
|
2019-09-02 19:23:37 +00:00
|
|
|
));
|