2023-01-16 09:45:12 +00:00
|
|
|
import { AccountErrorCode } from "@dashboard/graphql";
|
2020-05-14 09:30:32 +00:00
|
|
|
import React from "react";
|
|
|
|
|
2023-05-12 11:06:27 +00:00
|
|
|
import { CardDecorator } from "../../../../.storybook/decorators";
|
2019-09-02 15:56:59 +00:00
|
|
|
import NewPasswordPage from "./NewPasswordPage";
|
|
|
|
|
2023-05-12 11:06:27 +00:00
|
|
|
export default {
|
|
|
|
title: "Authentication / Set up a new password",
|
|
|
|
decorators: [CardDecorator],
|
|
|
|
};
|
|
|
|
|
|
|
|
export const Default = () => (
|
|
|
|
<NewPasswordPage errors={[]} loading={false} onSubmit={() => undefined} />
|
|
|
|
);
|
|
|
|
|
|
|
|
export const Loading = () => (
|
|
|
|
<NewPasswordPage errors={[]} loading={true} onSubmit={() => undefined} />
|
|
|
|
);
|
|
|
|
|
|
|
|
export const TooShortError = () => (
|
|
|
|
<NewPasswordPage
|
|
|
|
errors={["password"].map(field => ({
|
|
|
|
__typename: "AccountError",
|
|
|
|
code: AccountErrorCode.PASSWORD_TOO_SHORT,
|
|
|
|
field,
|
|
|
|
addressType: null,
|
|
|
|
message: null,
|
|
|
|
}))}
|
|
|
|
loading={false}
|
|
|
|
onSubmit={() => undefined}
|
|
|
|
/>
|
|
|
|
);
|