Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 1 commit intomainfrombq/add-stories-create-token-page
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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 deletionssite/src/pages/CreateTokenPage/CreateTokenForm.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff 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. 🐛

BrunoQuaresma reacted with thumbs up emoji

interface CreateTokenFormProps {
form: FormikContextType<CreateTokenData>;
maxTokenLifetime?: number;
Expand Down
20 changes: 20 additions & 0 deletionssite/src/pages/CreateTokenPage/CreateTokenPage.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff 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 = {};

[8]ページ先頭

©2009-2025 Movatter.jp