saleor-dashboard/src/auth/components/NewPasswordPage/NewPasswordPage.stories.tsx

31 lines
967 B
TypeScript
Raw Normal View History

import { AccountErrorCode } from "@dashboard/graphql";
import CardDecorator from "@dashboard/storybook//CardDecorator";
import Decorator from "@dashboard/storybook//Decorator";
import { storiesOf } from "@storybook/react";
import React from "react";
2019-09-02 15:56:59 +00:00
import NewPasswordPage from "./NewPasswordPage";
2023-01-05 12:34:34 +00:00
storiesOf("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", () => (
<NewPasswordPage errors={[]} loading={false} onSubmit={() => undefined} />
2019-09-02 19:23:37 +00:00
))
.add("loading", () => (
<NewPasswordPage errors={[]} loading={true} onSubmit={() => undefined} />
))
.add("too short error", () => (
<NewPasswordPage
errors={["password"].map(field => ({
__typename: "AccountError",
code: AccountErrorCode.PASSWORD_TOO_SHORT,
field,
addressType: null,
message: null,
}))}
loading={false}
onSubmit={() => undefined}
/>
2019-09-02 19:23:37 +00:00
));