Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
chore: Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
re-taro committed Oct 26, 2022
1 parent 425654b commit efc91a5
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/api/liveevent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { LiveEvent, LiveStage } from "./prisma";

export type SeparationEventList = {
[key in LiveStage]: ReadonlyArray<LiveEvent> | readonly [];
} & {interval: EventInterval};
} & { interval: EventInterval };

export type EventInterval = {
[key in LiveStage]: ReadonlyArray<number>;
Expand Down
6 changes: 3 additions & 3 deletions src/components/templates/time-table/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { FC } from "react";
import tw from "twin.macro";
import type { TimeTableProperties } from "./types/model";
import {Title} from "../../molecules/title";
import {Switching} from "../../atoms/switching";
import {TimeTable as TT} from "../../organisms/time-table";
import { Title } from "../../molecules/title";
import { Switching } from "../../atoms/switching";
import { TimeTable as TT } from "../../organisms/time-table";

const Main = tw.main`pt-1 pb-8 sm:(pt-6 pb-40)`;

Expand Down
2 changes: 1 addition & 1 deletion src/components/templates/time-table/time-table.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ComponentStoryObj, ComponentMeta } from "@storybook/react";
import { ComponentPropsWithoutRef } from 'react';
import { ComponentPropsWithoutRef } from "react";
import { TimeTable } from ".";

type T = typeof TimeTable;
Expand Down
4 changes: 2 additions & 2 deletions src/components/templates/time-table/time-table.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import * as stories from "./time-table.stories";
const { Default } = composeStories(stories);

const options = {
name: "Time table"
}
name: "Time table",
};

describe("(components) templates/time-table", () => {
beforeAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/templates/time-table/types/model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {SeparationEventList} from "../../../../api/liveevent";
import type { SeparationEventList } from "../../../../api/liveevent";

export type TimeTableProperties = {
events: SeparationEventList;
Expand Down
13 changes: 8 additions & 5 deletions src/pages/time-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ import useSWR from "swr";
import { Redirect } from "wouter";
import { TimeTable } from "../components/templates/time-table";
import { fetcher } from "../libs/axios";
import type {SeparationEventList } from "../api/liveevent"
import type { SeparationEventList } from "../api/liveevent";

const TimeTablePage: FC = () => {
const query = new URLSearchParams(window.location.search);
const isThirty = query.get("select") === "30";
const { data, error } = useSWR<SeparationEventList>(isThirty ? "/liveevent/2022-10-30" : "/liveevent/2022-10-31", fetcher)
const { data, error } = useSWR<SeparationEventList>(
isThirty ? "/liveevent/2022-10-30" : "/liveevent/2022-10-31",
fetcher,
);
if (error) return <Redirect to="/error" />;
if (!data) return <p>Loading...</p>;
return <TimeTable events={data} />
}
return <TimeTable events={data} />;
};

export { TimeTablePage }
export { TimeTablePage };
2 changes: 1 addition & 1 deletion src/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FC } from "react";
import { useRegisterSW } from "virtual:pwa-register/react";
import { Route, Switch } from "wouter";
import {TopPage, SponsorPage, BazaarPage, MemberPage, NotFoundPage, TimeTablePage} from "./pages";
import { TopPage, SponsorPage, BazaarPage, MemberPage, NotFoundPage, TimeTablePage } from "./pages";
import { useScrollToTop } from "./hooks/useScrollToTop";
import { useJwt } from "./hooks/useJwt";

Expand Down

0 comments on commit efc91a5

Please sign in to comment.