Skip to content

chore(site): add CreateTokenPage story #12472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions site/src/pages/CreateTokenPage/CreateTokenForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { css } from "@emotion/css";
import MenuItem from "@mui/material/MenuItem";
import TextField from "@mui/material/TextField";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
import type { FormikContextType } from "formik";
import { type FC, useState, useEffect } from "react";
import { useNavigate } from "react-router-dom";
Expand All @@ -21,6 +22,8 @@ import {
customLifetimeDay,
} from "./utils";

dayjs.extend(utc);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen Storybook catch so many of these "depending on a dayjs plugin that we don't actually install locally" bugs. 🐛


interface CreateTokenFormProps {
form: FormikContextType<CreateTokenData>;
maxTokenLifetime?: number;
Expand Down
20 changes: 20 additions & 0 deletions site/src/pages/CreateTokenPage/CreateTokenPage.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Meta, StoryObj } from "@storybook/react";
import { CreateTokenPage } from "./CreateTokenPage";

const meta: Meta<typeof CreateTokenPage> = {
title: "components/CreateTokenPage",
component: CreateTokenPage,
parameters: {
queries: [
{
key: ["tokenconfig"],
data: { max_token_lifetime: 1_000 },
},
],
},
};

export default meta;
type Story = StoryObj<typeof CreateTokenPage>;

export const Default: Story = {};