Skip to content

Commit

Permalink
refactor(website): convert Header and Loading stories to TypeScript (#…
Browse files Browse the repository at this point in the history
…2050)

These `.jsx` components were added in
#110, and they are the
only ones that are still written in JavaScript in this project.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
  • Loading branch information
Juneezee committed Mar 12, 2023
1 parent ac6535c commit 26fec63
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ You can use the debug credentials provider to log in without fancy emails or OAu
To develop components using [Storybook](https://storybook.js.org/) run `npm run storybook`. Then navigate to in your
browser to `http://localhost:6006`.

To create a new story create a file named `[componentName].stories.js`. An example how such a story could look like, see
`Header.stories.jsx`.
To create a new story create a file named `[componentName].stories.tsx`. An example how such a story could look like,
see `Header.stories.tsx`.

## Code Layout

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { ComponentStory } from "@storybook/react";
import { SessionContext } from "next-auth/react";
import React from "react";
import { FlagsProvider } from "react-feature-flags";
Expand All @@ -15,8 +16,8 @@ export default {
decorators: [RouterDecorator],
};

const Template = (args) => {
var { session } = args;
const Template: ComponentStory<any> = (args) => {
const { session } = args;
return (
<SessionContext.Provider value={session}>
<FlagsProvider value={[{ name: "flagTest", isActive: false }]}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { ComponentStory } from "@storybook/react";
import { SessionContext } from "next-auth/react";
import React from "react";

Expand All @@ -9,8 +10,8 @@ export default {
component: UserMenu,
};

const Template = (args) => {
var { session } = args;
const Template: ComponentStory<any> = (args) => {
const { session } = args;
return (
<SessionContext.Provider value={session}>
<div className="flex flex-col">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { ComponentStory } from "@storybook/react";

import { LoadingScreen } from "./LoadingScreen";

// eslint-disable-next-line import/no-anonymous-default-export
Expand All @@ -9,7 +11,7 @@ export default {
},
};

const Template = (args) => <LoadingScreen {...args} />;
const Template: ComponentStory<typeof LoadingScreen> = (args) => <LoadingScreen {...args} />;

export const Default = Template.bind({});

Expand Down

0 comments on commit 26fec63

Please sign in to comment.