diff --git a/src/components/AppLayout.tsx b/src/components/AppLayout.tsx index 4bd7ffd..0bf9264 100644 --- a/src/components/AppLayout.tsx +++ b/src/components/AppLayout.tsx @@ -1,4 +1,4 @@ -import Button from "components/Inputs/Button"; +import { Button } from "components/Inputs/Button"; import { useAppLayout } from "contexts/AppLayoutContext"; import { UploadImageFragment } from "graphql/generated"; import { AppStaticProps } from "graphql/getAppStaticProps"; @@ -10,10 +10,10 @@ import Head from "next/head"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; import { useSwipeable } from "react-swipeable"; -import OrderableList from "./Inputs/OrderableList"; -import Select from "./Inputs/Select"; -import MainPanel from "./Panels/MainPanel"; -import Popup from "./Popup"; +import { OrderableList } from "./Inputs/OrderableList"; +import { Select } from "./Inputs/Select"; +import { MainPanel } from "./Panels/MainPanel"; +import { Popup } from "./Popup"; interface Props extends AppStaticProps { subPanel?: React.ReactNode; @@ -25,7 +25,7 @@ interface Props extends AppStaticProps { description?: string; } -export default function AppLayout(props: Immutable): JSX.Element { +export function AppLayout(props: Immutable): JSX.Element { const { langui, currencies, diff --git a/src/components/Chip.tsx b/src/components/Chip.tsx index b00f5c6..33dbe51 100644 --- a/src/components/Chip.tsx +++ b/src/components/Chip.tsx @@ -5,7 +5,7 @@ interface Props { children: React.ReactNode; } -export default function Chip(props: Immutable): JSX.Element { +export function Chip(props: Immutable): JSX.Element { return (
): JSX.Element { +export function HorizontalLine(props: Immutable): JSX.Element { return (
; } -export default function Img(props: Immutable): JSX.Element { +export function Img(props: Immutable): JSX.Element { const { className, image, diff --git a/src/components/Inputs/Button.tsx b/src/components/Inputs/Button.tsx index 5e8b11f..9a18772 100644 --- a/src/components/Inputs/Button.tsx +++ b/src/components/Inputs/Button.tsx @@ -15,7 +15,7 @@ interface Props { badgeNumber?: number; } -export default function Button(props: Immutable): JSX.Element { +export function Button(props: Immutable): JSX.Element { const { draggable, id, diff --git a/src/components/Inputs/LanguageSwitcher.tsx b/src/components/Inputs/LanguageSwitcher.tsx index 4127b09..307215c 100644 --- a/src/components/Inputs/LanguageSwitcher.tsx +++ b/src/components/Inputs/LanguageSwitcher.tsx @@ -2,8 +2,8 @@ import { AppStaticProps } from "graphql/getAppStaticProps"; import { prettyLanguage } from "helpers/formatters"; import { Immutable } from "helpers/types"; import { Dispatch, SetStateAction } from "react"; -import ToolTip from "../ToolTip"; -import Button from "./Button"; +import { ToolTip } from "../ToolTip"; +import { Button } from "./Button"; interface Props { className?: string; @@ -13,7 +13,7 @@ interface Props { setLocalesIndex: Dispatch>; } -export default function LanguageSwitcher(props: Immutable): JSX.Element { +export function LanguageSwitcher(props: Immutable): JSX.Element { const { locales, className, localesIndex, setLocalesIndex } = props; return ( diff --git a/src/components/Inputs/OrderableList.tsx b/src/components/Inputs/OrderableList.tsx index b02dbe9..9292f77 100644 --- a/src/components/Inputs/OrderableList.tsx +++ b/src/components/Inputs/OrderableList.tsx @@ -8,7 +8,7 @@ interface Props { onChange?: (items: Map) => void; } -export default function OrderableList(props: Immutable): JSX.Element { +export function OrderableList(props: Immutable): JSX.Element { const [items, setItems] = useState>(props.items); useEffect(() => { diff --git a/src/components/Inputs/PageSelector.tsx b/src/components/Inputs/PageSelector.tsx index 4b3c914..fe376bd 100644 --- a/src/components/Inputs/PageSelector.tsx +++ b/src/components/Inputs/PageSelector.tsx @@ -1,6 +1,6 @@ import { Immutable } from "helpers/types"; import { Dispatch, SetStateAction } from "react"; -import Button from "./Button"; +import { Button } from "./Button"; interface Props { className?: string; @@ -9,7 +9,7 @@ interface Props { setPage: Dispatch>; } -export default function PageSelector(props: Immutable): JSX.Element { +export function PageSelector(props: Immutable): JSX.Element { const { page, setPage, maxPage } = props; return ( diff --git a/src/components/Inputs/Select.tsx b/src/components/Inputs/Select.tsx index c8b936a..fd379cc 100644 --- a/src/components/Inputs/Select.tsx +++ b/src/components/Inputs/Select.tsx @@ -10,7 +10,7 @@ interface Props { className?: string; } -export default function Select(props: Immutable): JSX.Element { +export function Select(props: Immutable): JSX.Element { const [opened, setOpened] = useState(false); return ( diff --git a/src/components/Inputs/Switch.tsx b/src/components/Inputs/Switch.tsx index 49ef258..be1d2c7 100644 --- a/src/components/Inputs/Switch.tsx +++ b/src/components/Inputs/Switch.tsx @@ -7,7 +7,7 @@ interface Props { className?: string; } -export default function Switch(props: Immutable): JSX.Element { +export function Switch(props: Immutable): JSX.Element { return (
): JSX.Element { +export function InsetBox(props: Immutable): JSX.Element { return (
): JSX.Element { +export function ContentLine(props: Immutable): JSX.Element { const { content, langui, parentSlug } = props; const [opened, setOpened] = useState(false); diff --git a/src/components/Library/ScanSet.tsx b/src/components/Library/ScanSet.tsx index 7f0c555..772a805 100644 --- a/src/components/Library/ScanSet.tsx +++ b/src/components/Library/ScanSet.tsx @@ -1,8 +1,8 @@ -import Chip from "components/Chip"; -import Img from "components/Img"; -import Button from "components/Inputs/Button"; -import RecorderChip from "components/RecorderChip"; -import ToolTip from "components/ToolTip"; +import { Chip } from "components/Chip"; +import { Img } from "components/Img"; +import { Button } from "components/Inputs/Button"; +import { RecorderChip } from "components/RecorderChip"; +import { ToolTip } from "components/ToolTip"; import { GetLibraryItemScansQuery } from "graphql/generated"; import { AppStaticProps } from "graphql/getAppStaticProps"; import { getAssetFilename, getAssetURL, ImageQuality } from "helpers/img"; @@ -48,7 +48,7 @@ interface Props { >["content"]; } -export default function ScanSet(props: Immutable): JSX.Element { +export function ScanSet(props: Immutable): JSX.Element { const { openLightBox, scanSet, slug, title, languages, langui, content } = props; diff --git a/src/components/Library/ScanSetCover.tsx b/src/components/Library/ScanSetCover.tsx index e66e3a4..907b73a 100644 --- a/src/components/Library/ScanSetCover.tsx +++ b/src/components/Library/ScanSetCover.tsx @@ -1,7 +1,7 @@ -import Chip from "components/Chip"; -import Img from "components/Img"; -import RecorderChip from "components/RecorderChip"; -import ToolTip from "components/ToolTip"; +import { Chip } from "components/Chip"; +import { Img } from "components/Img"; +import { RecorderChip } from "components/RecorderChip"; +import { ToolTip } from "components/ToolTip"; import { GetLibraryItemScansQuery, UploadImageFragment, @@ -28,7 +28,7 @@ interface Props { langui: AppStaticProps["langui"]; } -export default function ScanSetCover(props: Immutable): JSX.Element { +export function ScanSetCover(props: Immutable): JSX.Element { const { openLightBox, images, languages, langui } = props; const [selectedScan, LanguageSwitcher] = useSmartLanguage({ diff --git a/src/components/LightBox.tsx b/src/components/LightBox.tsx index ccaad88..cb47c6f 100644 --- a/src/components/LightBox.tsx +++ b/src/components/LightBox.tsx @@ -2,9 +2,9 @@ import { Immutable } from "helpers/types"; import { Dispatch, SetStateAction } from "react"; import Hotkeys from "react-hot-keys"; import { useSwipeable } from "react-swipeable"; -import Img from "./Img"; -import Button from "./Inputs/Button"; -import Popup from "./Popup"; +import { Img } from "./Img"; +import { Button } from "./Inputs/Button"; +import { Popup } from "./Popup"; interface Props { setState: @@ -16,7 +16,7 @@ interface Props { setIndex: Dispatch>; } -export default function LightBox(props: Immutable): JSX.Element { +export function LightBox(props: Immutable): JSX.Element { const { state, setState, images, index, setIndex } = props; function handlePrevious() { diff --git a/src/components/Markdown/Markdawn.tsx b/src/components/Markdown/Markdawn.tsx index dd0f8d1..6b86231 100644 --- a/src/components/Markdown/Markdawn.tsx +++ b/src/components/Markdown/Markdawn.tsx @@ -1,7 +1,7 @@ -import HorizontalLine from "components/HorizontalLine"; -import Img from "components/Img"; -import InsetBox from "components/InsetBox"; -import ToolTip from "components/ToolTip"; +import { HorizontalLine } from "components/HorizontalLine"; +import { Img } from "components/Img"; +import { InsetBox } from "components/InsetBox"; +import { ToolTip } from "components/ToolTip"; import { useAppLayout } from "contexts/AppLayoutContext"; import { slugify } from "helpers/formatters"; import { getAssetURL, ImageQuality } from "helpers/img"; @@ -17,7 +17,7 @@ interface Props { text: string; } -export default function Markdawn(props: Immutable): JSX.Element { +export function Markdawn(props: Immutable): JSX.Element { const appLayout = useAppLayout(); const text = preprocessMarkDawn(props.text); diff --git a/src/components/Markdown/TOC.tsx b/src/components/Markdown/TOC.tsx index 4967668..4d14b64 100644 --- a/src/components/Markdown/TOC.tsx +++ b/src/components/Markdown/TOC.tsx @@ -8,7 +8,7 @@ interface Props { title?: string; } -export default function TOCComponent(props: Immutable): JSX.Element { +export function TOC(props: Immutable): JSX.Element { const { text, title } = props; const toc = getTocFromMarkdawn(preprocessMarkDawn(text), title); const router = useRouter(); @@ -29,7 +29,7 @@ export default function TOCComponent(props: Immutable): JSX.Element { } interface LevelProps { - tocchildren: TOC[]; + tocchildren: TOCInterface[]; parentNumbering: string; } @@ -61,14 +61,14 @@ function TOCLevel(props: LevelProps): JSX.Element { ); } -interface TOC { +interface TOCInterface { title: string; slug: string; - children: TOC[]; + children: TOCInterface[]; } -export function getTocFromMarkdawn(text: string, title?: string): TOC { - const toc: TOC = { +export function getTocFromMarkdawn(text: string, title?: string): TOCInterface { + const toc: TOCInterface = { title: title ?? "Return to top", slug: slugify(title), children: [], diff --git a/src/components/PanelComponents/NavOption.tsx b/src/components/PanelComponents/NavOption.tsx index 10d10e3..a36eecc 100644 --- a/src/components/PanelComponents/NavOption.tsx +++ b/src/components/PanelComponents/NavOption.tsx @@ -1,4 +1,4 @@ -import ToolTip from "components/ToolTip"; +import { ToolTip } from "components/ToolTip"; import { Immutable } from "helpers/types"; import { useRouter } from "next/router"; import { MouseEventHandler } from "react"; @@ -13,7 +13,7 @@ interface Props { onClick?: MouseEventHandler; } -export default function NavOption(props: Immutable): JSX.Element { +export function NavOption(props: Immutable): JSX.Element { const router = useRouter(); const isActive = router.asPath.startsWith(props.url); const divActive = "bg-mid shadow-inner-sm shadow-shade"; diff --git a/src/components/PanelComponents/PanelHeader.tsx b/src/components/PanelComponents/PanelHeader.tsx index eba7a1f..652e69a 100644 --- a/src/components/PanelComponents/PanelHeader.tsx +++ b/src/components/PanelComponents/PanelHeader.tsx @@ -1,4 +1,4 @@ -import HorizontalLine from "components/HorizontalLine"; +import { HorizontalLine } from "components/HorizontalLine"; import { Immutable } from "helpers/types"; interface Props { @@ -7,7 +7,7 @@ interface Props { description?: string | null | undefined; } -export default function PanelHeader(props: Immutable): JSX.Element { +export function PanelHeader(props: Immutable): JSX.Element { return ( <>
diff --git a/src/components/PanelComponents/ReturnButton.tsx b/src/components/PanelComponents/ReturnButton.tsx index d173940..edc40fc 100644 --- a/src/components/PanelComponents/ReturnButton.tsx +++ b/src/components/PanelComponents/ReturnButton.tsx @@ -1,5 +1,5 @@ -import HorizontalLine from "components/HorizontalLine"; -import Button from "components/Inputs/Button"; +import { HorizontalLine } from "components/HorizontalLine"; +import { Button } from "components/Inputs/Button"; import { useAppLayout } from "contexts/AppLayoutContext"; import { AppStaticProps } from "graphql/getAppStaticProps"; import { Immutable } from "helpers/types"; @@ -19,7 +19,7 @@ export enum ReturnButtonType { both = "both", } -export default function ReturnButton(props: Immutable): JSX.Element { +export function ReturnButton(props: Immutable): JSX.Element { const appLayout = useAppLayout(); return ( diff --git a/src/components/Panels/ContentPanel.tsx b/src/components/Panels/ContentPanel.tsx index 2f6beb5..5019cdd 100644 --- a/src/components/Panels/ContentPanel.tsx +++ b/src/components/Panels/ContentPanel.tsx @@ -11,7 +11,7 @@ export enum ContentPanelWidthSizes { large = "large", } -export default function ContentPanel(props: Immutable): JSX.Element { +export function ContentPanel(props: Immutable): JSX.Element { const width = props.width ? props.width : ContentPanelWidthSizes.default; const widthCSS = width === ContentPanelWidthSizes.default ? "max-w-2xl" : "w-full"; diff --git a/src/components/Panels/MainPanel.tsx b/src/components/Panels/MainPanel.tsx index cdfd2ac..4d83cfc 100644 --- a/src/components/Panels/MainPanel.tsx +++ b/src/components/Panels/MainPanel.tsx @@ -1,7 +1,7 @@ -import HorizontalLine from "components/HorizontalLine"; -import Button from "components/Inputs/Button"; -import NavOption from "components/PanelComponents/NavOption"; -import ToolTip from "components/ToolTip"; +import { HorizontalLine } from "components/HorizontalLine"; +import { Button } from "components/Inputs/Button"; +import { NavOption } from "components/PanelComponents/NavOption"; +import { ToolTip } from "components/ToolTip"; import { useAppLayout } from "contexts/AppLayoutContext"; import { AppStaticProps } from "graphql/getAppStaticProps"; import { Immutable } from "helpers/types"; @@ -13,7 +13,7 @@ interface Props { langui: AppStaticProps["langui"]; } -export default function MainPanel(props: Immutable): JSX.Element { +export function MainPanel(props: Immutable): JSX.Element { const { langui } = props; const isDesktop = useMediaDesktop(); const appLayout = useAppLayout(); diff --git a/src/components/Panels/SubPanel.tsx b/src/components/Panels/SubPanel.tsx index 776e305..da69642 100644 --- a/src/components/Panels/SubPanel.tsx +++ b/src/components/Panels/SubPanel.tsx @@ -4,7 +4,7 @@ interface Props { children: React.ReactNode; } -export default function SubPanel(props: Immutable): JSX.Element { +export function SubPanel(props: Immutable): JSX.Element { return (
{props.children} diff --git a/src/components/Popup.tsx b/src/components/Popup.tsx index 0f56786..78739aa 100644 --- a/src/components/Popup.tsx +++ b/src/components/Popup.tsx @@ -14,7 +14,7 @@ interface Props { padding?: boolean; } -export default function Popup(props: Immutable): JSX.Element { +export function Popup(props: Immutable): JSX.Element { const { setState, state, diff --git a/src/components/PostPage.tsx b/src/components/PostPage.tsx index e32f1a8..e324f0a 100644 --- a/src/components/PostPage.tsx +++ b/src/components/PostPage.tsx @@ -3,17 +3,17 @@ import { prettySlug } from "helpers/formatters"; import { getStatusDescription } from "helpers/others"; import { Immutable, PostWithTranslations } from "helpers/types"; import { useSmartLanguage } from "hooks/useSmartLanguage"; -import AppLayout from "./AppLayout"; -import Chip from "./Chip"; -import HorizontalLine from "./HorizontalLine"; -import Markdawn from "./Markdown/Markdawn"; -import TOC from "./Markdown/TOC"; -import ReturnButton, { ReturnButtonType } from "./PanelComponents/ReturnButton"; -import ContentPanel from "./Panels/ContentPanel"; -import SubPanel from "./Panels/SubPanel"; -import RecorderChip from "./RecorderChip"; -import ThumbnailHeader from "./ThumbnailHeader"; -import ToolTip from "./ToolTip"; +import { AppLayout } from "./AppLayout"; +import { Chip } from "./Chip"; +import { HorizontalLine } from "./HorizontalLine"; +import { Markdawn } from "./Markdown/Markdawn"; +import { TOC } from "./Markdown/TOC"; +import { ReturnButton, ReturnButtonType } from "./PanelComponents/ReturnButton"; +import { ContentPanel } from "./Panels/ContentPanel"; +import { SubPanel } from "./Panels/SubPanel"; +import { RecorderChip } from "./RecorderChip"; +import { ThumbnailHeader } from "./ThumbnailHeader"; +import { ToolTip } from "./ToolTip"; interface Props { post: PostWithTranslations; @@ -31,7 +31,7 @@ interface Props { appendBody?: JSX.Element; } -export default function PostPage(props: Immutable): JSX.Element { +export function PostPage(props: Immutable): JSX.Element { const { post, langui, diff --git a/src/components/PreviewCard.tsx b/src/components/PreviewCard.tsx index b890785..010690d 100644 --- a/src/components/PreviewCard.tsx +++ b/src/components/PreviewCard.tsx @@ -14,8 +14,8 @@ import { import { ImageQuality } from "helpers/img"; import { Immutable } from "helpers/types"; import Link from "next/link"; -import Chip from "./Chip"; -import Img from "./Img"; +import { Chip } from "./Chip"; +import { Img } from "./Img"; interface Props { thumbnail?: UploadImageFragment | string | null | undefined; @@ -45,7 +45,7 @@ interface Props { | { __typename: "anotherHoverlayName" }; } -export default function PreviewCard(props: Immutable): JSX.Element { +export function PreviewCard(props: Immutable): JSX.Element { const { href, thumbnail, diff --git a/src/components/PreviewLine.tsx b/src/components/PreviewLine.tsx index ca2aa02..742be36 100644 --- a/src/components/PreviewLine.tsx +++ b/src/components/PreviewLine.tsx @@ -2,8 +2,8 @@ import { UploadImageFragment } from "graphql/generated"; import { ImageQuality } from "helpers/img"; import { Immutable } from "helpers/types"; import Link from "next/link"; -import Chip from "./Chip"; -import Img from "./Img"; +import { Chip } from "./Chip"; +import { Img } from "./Img"; interface Props { thumbnail?: UploadImageFragment | string | null | undefined; @@ -16,7 +16,7 @@ interface Props { bottomChips?: string[]; } -export default function PreviewLine(props: Immutable): JSX.Element { +export function PreviewLine(props: Immutable): JSX.Element { const { href, thumbnail, diff --git a/src/components/RecorderChip.tsx b/src/components/RecorderChip.tsx index 16851fe..de7c824 100644 --- a/src/components/RecorderChip.tsx +++ b/src/components/RecorderChip.tsx @@ -1,11 +1,11 @@ -import Chip from "components/Chip"; +import { Chip } from "components/Chip"; import { RecorderChipFragment } from "graphql/generated"; import { AppStaticProps } from "graphql/getAppStaticProps"; import { ImageQuality } from "helpers/img"; import { Immutable } from "helpers/types"; -import Img from "./Img"; -import Markdawn from "./Markdown/Markdawn"; -import ToolTip from "./ToolTip"; +import { Img } from "./Img"; +import { Markdawn } from "./Markdown/Markdawn"; +import { ToolTip } from "./ToolTip"; interface Props { className?: string; @@ -13,7 +13,7 @@ interface Props { langui: AppStaticProps["langui"]; } -export default function RecorderChip(props: Immutable): JSX.Element { +export function RecorderChip(props: Immutable): JSX.Element { const { recorder, langui } = props; return ( ): JSX.Element { +export function SVG(props: Immutable): JSX.Element { return (
): JSX.Element { +export function ThumbnailHeader(props: Immutable): JSX.Element { const { langui, pre_title, diff --git a/src/components/ToolTip.tsx b/src/components/ToolTip.tsx index f563f46..63dd291 100644 --- a/src/components/ToolTip.tsx +++ b/src/components/ToolTip.tsx @@ -3,7 +3,7 @@ import "tippy.js/animations/scale-subtle.css"; interface Props extends TippyProps {} -export default function ToolTip(props: Props): JSX.Element { +export function ToolTip(props: Props): JSX.Element { const newProps: Props = { delay: [150, 0], interactive: true, diff --git a/src/components/Wiki/Chronology/ChronologyItemComponent.tsx b/src/components/Wiki/Chronology/ChronologyItemComponent.tsx index 8d9fb77..4b3fc5b 100644 --- a/src/components/Wiki/Chronology/ChronologyItemComponent.tsx +++ b/src/components/Wiki/Chronology/ChronologyItemComponent.tsx @@ -1,5 +1,5 @@ -import Chip from "components/Chip"; -import ToolTip from "components/ToolTip"; +import { Chip } from "components/Chip"; +import { ToolTip } from "components/ToolTip"; import { Enum_Componenttranslationschronologyitem_Status, GetChronologyItemsQuery, @@ -17,9 +17,7 @@ interface Props { langui: AppStaticProps["langui"]; } -export default function ChronologyItemComponent( - props: Immutable -): JSX.Element { +export function ChronologyItemComponent(props: Immutable): JSX.Element { const { langui } = props; function generateAnchor( diff --git a/src/components/Wiki/Chronology/ChronologyYearComponent.tsx b/src/components/Wiki/Chronology/ChronologyYearComponent.tsx index 389e18c..5758e65 100644 --- a/src/components/Wiki/Chronology/ChronologyYearComponent.tsx +++ b/src/components/Wiki/Chronology/ChronologyYearComponent.tsx @@ -1,4 +1,4 @@ -import ChronologyItemComponent from "components/Wiki/Chronology/ChronologyItemComponent"; +import { ChronologyItemComponent } from "components/Wiki/Chronology/ChronologyItemComponent"; import { GetChronologyItemsQuery } from "graphql/generated"; import { AppStaticProps } from "graphql/getAppStaticProps"; import { Immutable } from "helpers/types"; @@ -12,9 +12,7 @@ interface Props { langui: AppStaticProps["langui"]; } -export default function ChronologyYearComponent( - props: Immutable -): JSX.Element { +export function ChronologyYearComponent(props: Immutable): JSX.Element { const { langui } = props; return ( diff --git a/src/contexts/AppLayoutContext.tsx b/src/contexts/AppLayoutContext.tsx index eb1a821..f9bc26e 100644 --- a/src/contexts/AppLayoutContext.tsx +++ b/src/contexts/AppLayoutContext.tsx @@ -1,6 +1,6 @@ import { Immutable } from "helpers/types"; -import useDarkMode from "hooks/useDarkMode"; -import useStateWithLocalStorage from "hooks/useStateWithLocalStorage"; +import { useDarkMode } from "hooks/useDarkMode"; +import { useStateWithLocalStorage } from "hooks/useStateWithLocalStorage"; import React, { ReactNode, useContext, useState } from "react"; interface AppLayoutState { diff --git a/src/hooks/useDarkMode.ts b/src/hooks/useDarkMode.ts index 4705942..72b26ea 100644 --- a/src/hooks/useDarkMode.ts +++ b/src/hooks/useDarkMode.ts @@ -1,8 +1,8 @@ import { useEffect } from "react"; import { usePrefersDarkMode } from "./useMediaQuery"; -import useStateWithLocalStorage from "./useStateWithLocalStorage"; +import { useStateWithLocalStorage } from "./useStateWithLocalStorage"; -export default function useDarkMode( +export function useDarkMode( key: string, initialValue: boolean | undefined ): [ diff --git a/src/hooks/useLightBox.tsx b/src/hooks/useLightBox.tsx index 4bf9303..f4b7f4a 100644 --- a/src/hooks/useLightBox.tsx +++ b/src/hooks/useLightBox.tsx @@ -1,4 +1,4 @@ -import LightBox from "components/LightBox"; +import { LightBox } from "components/LightBox"; import { useState } from "react"; export function useLightBox(): [ diff --git a/src/hooks/useMediaQuery.ts b/src/hooks/useMediaQuery.ts index 00c90c6..3d999b9 100644 --- a/src/hooks/useMediaQuery.ts +++ b/src/hooks/useMediaQuery.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -export default function useMediaQuery(query: string): boolean { +export function useMediaQuery(query: string): boolean { function getMatches(query: string): boolean { // Prevents SSR issues if (typeof window !== "undefined") { diff --git a/src/hooks/useSmartLanguage.tsx b/src/hooks/useSmartLanguage.tsx index 735a435..baae258 100644 --- a/src/hooks/useSmartLanguage.tsx +++ b/src/hooks/useSmartLanguage.tsx @@ -1,4 +1,4 @@ -import LanguageSwitcher from "components/Inputs/LanguageSwitcher"; +import { LanguageSwitcher } from "components/Inputs/LanguageSwitcher"; import { useAppLayout } from "contexts/AppLayoutContext"; import { AppStaticProps } from "graphql/getAppStaticProps"; import { Immutable } from "helpers/types"; diff --git a/src/hooks/useStateWithLocalStorage.ts b/src/hooks/useStateWithLocalStorage.ts index 5981b2e..d32249b 100644 --- a/src/hooks/useStateWithLocalStorage.ts +++ b/src/hooks/useStateWithLocalStorage.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -export default function useStateWithLocalStorage( +export function useStateWithLocalStorage( key: string, initialValue: T ): [T | undefined, React.Dispatch>] { diff --git a/src/pages/404.tsx b/src/pages/404.tsx index d265505..e2ba153 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -1,8 +1,9 @@ -import AppLayout from "components/AppLayout"; -import ReturnButton, { +import { AppLayout } from "components/AppLayout"; +import { + ReturnButton, ReturnButtonType, } from "components/PanelComponents/ReturnButton"; -import ContentPanel from "components/Panels/ContentPanel"; +import { ContentPanel } from "components/Panels/ContentPanel"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; import { Immutable } from "helpers/types"; import { GetStaticPropsContext } from "next"; diff --git a/src/pages/500.tsx b/src/pages/500.tsx index eab7707..a09e9e3 100644 --- a/src/pages/500.tsx +++ b/src/pages/500.tsx @@ -1,8 +1,9 @@ -import AppLayout from "components/AppLayout"; -import ReturnButton, { +import { AppLayout } from "components/AppLayout"; +import { + ReturnButton, ReturnButtonType, } from "components/PanelComponents/ReturnButton"; -import ContentPanel from "components/Panels/ContentPanel"; +import { ContentPanel } from "components/Panels/ContentPanel"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; import { Immutable } from "helpers/types"; import { GetStaticPropsContext } from "next"; diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx index 4c21e31..6c05daa 100644 --- a/src/pages/_document.tsx +++ b/src/pages/_document.tsx @@ -6,7 +6,7 @@ import Document, { NextScript, } from "next/document"; -class MyDocument extends Document { +export default class MyDocument extends Document { // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types static async getInitialProps(ctx: DocumentContext) { const initialProps = await Document.getInitialProps(ctx); @@ -65,5 +65,3 @@ class MyDocument extends Document { ); } } - -export default MyDocument; diff --git a/src/pages/about-us/accords-handbook.tsx b/src/pages/about-us/accords-handbook.tsx index 749359e..e35fab1 100644 --- a/src/pages/about-us/accords-handbook.tsx +++ b/src/pages/about-us/accords-handbook.tsx @@ -1,4 +1,4 @@ -import PostPage from "components/PostPage"; +import { PostPage } from "components/PostPage"; import { getPostStaticProps, PostStaticProps, diff --git a/src/pages/about-us/contact.tsx b/src/pages/about-us/contact.tsx index 21015ab..c0b4e99 100644 --- a/src/pages/about-us/contact.tsx +++ b/src/pages/about-us/contact.tsx @@ -1,5 +1,5 @@ -import InsetBox from "components/InsetBox"; -import PostPage from "components/PostPage"; +import { InsetBox } from "components/InsetBox"; +import { PostPage } from "components/PostPage"; import { getPostStaticProps, PostStaticProps, @@ -10,9 +10,7 @@ import { useRouter } from "next/router"; import { RequestMailProps, ResponseMailProps } from "pages/api/mail"; import { useState } from "react"; -export default function AboutUs( - props: Immutable -): JSX.Element { +export default function AboutUs(props: Immutable): JSX.Element { const { post, langui, languages, currencies } = props; const router = useRouter(); diff --git a/src/pages/about-us/index.tsx b/src/pages/about-us/index.tsx index 85c4dec..b36e212 100644 --- a/src/pages/about-us/index.tsx +++ b/src/pages/about-us/index.tsx @@ -1,7 +1,7 @@ -import AppLayout from "components/AppLayout"; -import NavOption from "components/PanelComponents/NavOption"; -import PanelHeader from "components/PanelComponents/PanelHeader"; -import SubPanel from "components/Panels/SubPanel"; +import { AppLayout } from "components/AppLayout"; +import { NavOption } from "components/PanelComponents/NavOption"; +import { PanelHeader } from "components/PanelComponents/PanelHeader"; +import { SubPanel } from "components/Panels/SubPanel"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; import { Immutable } from "helpers/types"; import { GetStaticPropsContext } from "next"; diff --git a/src/pages/about-us/legality.tsx b/src/pages/about-us/legality.tsx index 828a342..36cd458 100644 --- a/src/pages/about-us/legality.tsx +++ b/src/pages/about-us/legality.tsx @@ -1,4 +1,4 @@ -import PostPage from "components/PostPage"; +import { PostPage } from "components/PostPage"; import { getPostStaticProps, PostStaticProps, diff --git a/src/pages/about-us/sharing-policy.tsx b/src/pages/about-us/sharing-policy.tsx index 81c93b7..3174092 100644 --- a/src/pages/about-us/sharing-policy.tsx +++ b/src/pages/about-us/sharing-policy.tsx @@ -1,4 +1,4 @@ -import PostPage from "components/PostPage"; +import { PostPage } from "components/PostPage"; import { getPostStaticProps, PostStaticProps, diff --git a/src/pages/api/mail.ts b/src/pages/api/mail.ts index e874acb..7fb6b00 100644 --- a/src/pages/api/mail.ts +++ b/src/pages/api/mail.ts @@ -14,7 +14,7 @@ export interface RequestMailProps { formName: string; } -export default async function Mail( +export async function Mail( req: NextApiRequest, res: NextApiResponse ) { diff --git a/src/pages/api/revalidate.ts b/src/pages/api/revalidate.ts index 2b9baea..99673cb 100644 --- a/src/pages/api/revalidate.ts +++ b/src/pages/api/revalidate.ts @@ -70,7 +70,7 @@ type ResponseMailProps = { revalidated: boolean; }; -export default async function Mail( +export async function Mail( req: NextApiRequest, res: NextApiResponse ) { diff --git a/src/pages/archives/index.tsx b/src/pages/archives/index.tsx index bc38935..8ce723d 100644 --- a/src/pages/archives/index.tsx +++ b/src/pages/archives/index.tsx @@ -1,7 +1,7 @@ -import AppLayout from "components/AppLayout"; -import NavOption from "components/PanelComponents/NavOption"; -import PanelHeader from "components/PanelComponents/PanelHeader"; -import SubPanel from "components/Panels/SubPanel"; +import { AppLayout } from "components/AppLayout"; +import { NavOption } from "components/PanelComponents/NavOption"; +import { PanelHeader } from "components/PanelComponents/PanelHeader"; +import { SubPanel } from "components/Panels/SubPanel"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; import { Immutable } from "helpers/types"; import { GetStaticPropsContext } from "next"; diff --git a/src/pages/archives/videos/c/[uid].tsx b/src/pages/archives/videos/c/[uid].tsx index 02ed0e8..e822908 100644 --- a/src/pages/archives/videos/c/[uid].tsx +++ b/src/pages/archives/videos/c/[uid].tsx @@ -1,14 +1,16 @@ -import AppLayout from "components/AppLayout"; -import Switch from "components/Inputs/Switch"; -import PanelHeader from "components/PanelComponents/PanelHeader"; -import ReturnButton, { +import { AppLayout } from "components/AppLayout"; +import { Switch } from "components/Inputs/Switch"; +import { PanelHeader } from "components/PanelComponents/PanelHeader"; +import { + ReturnButton, ReturnButtonType, } from "components/PanelComponents/ReturnButton"; -import ContentPanel, { +import { + ContentPanel, ContentPanelWidthSizes, } from "components/Panels/ContentPanel"; -import SubPanel from "components/Panels/SubPanel"; -import PreviewCard from "components/PreviewCard"; +import { SubPanel } from "components/Panels/SubPanel"; +import { PreviewCard } from "components/PreviewCard"; import { GetVideoChannelQuery } from "graphql/generated"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; import { getReadySdk } from "graphql/sdk"; diff --git a/src/pages/archives/videos/index.tsx b/src/pages/archives/videos/index.tsx index b5e70d3..c7759b0 100644 --- a/src/pages/archives/videos/index.tsx +++ b/src/pages/archives/videos/index.tsx @@ -1,15 +1,17 @@ -import AppLayout from "components/AppLayout"; -import PageSelector from "components/Inputs/PageSelector"; -import Switch from "components/Inputs/Switch"; -import PanelHeader from "components/PanelComponents/PanelHeader"; -import ReturnButton, { +import { AppLayout } from "components/AppLayout"; +import { PageSelector } from "components/Inputs/PageSelector"; +import { Switch } from "components/Inputs/Switch"; +import { PanelHeader } from "components/PanelComponents/PanelHeader"; +import { + ReturnButton, ReturnButtonType, } from "components/PanelComponents/ReturnButton"; -import ContentPanel, { +import { + ContentPanel, ContentPanelWidthSizes, } from "components/Panels/ContentPanel"; -import SubPanel from "components/Panels/SubPanel"; -import PreviewCard from "components/PreviewCard"; +import { SubPanel } from "components/Panels/SubPanel"; +import { PreviewCard } from "components/PreviewCard"; import { GetVideosPreviewQuery } from "graphql/generated"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; import { getReadySdk } from "graphql/sdk"; diff --git a/src/pages/archives/videos/v/[uid].tsx b/src/pages/archives/videos/v/[uid].tsx index 7ff8e98..de984ac 100644 --- a/src/pages/archives/videos/v/[uid].tsx +++ b/src/pages/archives/videos/v/[uid].tsx @@ -1,15 +1,17 @@ -import AppLayout from "components/AppLayout"; -import HorizontalLine from "components/HorizontalLine"; -import Button from "components/Inputs/Button"; -import InsetBox from "components/InsetBox"; -import NavOption from "components/PanelComponents/NavOption"; -import ReturnButton, { +import { AppLayout } from "components/AppLayout"; +import { HorizontalLine } from "components/HorizontalLine"; +import { Button } from "components/Inputs/Button"; +import { InsetBox } from "components/InsetBox"; +import { NavOption } from "components/PanelComponents/NavOption"; +import { + ReturnButton, ReturnButtonType, } from "components/PanelComponents/ReturnButton"; -import ContentPanel, { +import { + ContentPanel, ContentPanelWidthSizes, } from "components/Panels/ContentPanel"; -import SubPanel from "components/Panels/SubPanel"; +import { SubPanel } from "components/Panels/SubPanel"; import { useAppLayout } from "contexts/AppLayoutContext"; import { GetVideoQuery } from "graphql/generated"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; diff --git a/src/pages/chronicles/index.tsx b/src/pages/chronicles/index.tsx index 3f85be0..cb376ca 100644 --- a/src/pages/chronicles/index.tsx +++ b/src/pages/chronicles/index.tsx @@ -1,6 +1,6 @@ -import AppLayout from "components/AppLayout"; -import PanelHeader from "components/PanelComponents/PanelHeader"; -import SubPanel from "components/Panels/SubPanel"; +import { AppLayout } from "components/AppLayout"; +import { PanelHeader } from "components/PanelComponents/PanelHeader"; +import { SubPanel } from "components/Panels/SubPanel"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; import { Immutable } from "helpers/types"; import { GetStaticPropsContext } from "next"; diff --git a/src/pages/contents/[slug]/index.tsx b/src/pages/contents/[slug]/index.tsx index 564fc23..f351343 100644 --- a/src/pages/contents/[slug]/index.tsx +++ b/src/pages/contents/[slug]/index.tsx @@ -1,17 +1,18 @@ -import AppLayout from "components/AppLayout"; -import Chip from "components/Chip"; -import HorizontalLine from "components/HorizontalLine"; -import Markdawn from "components/Markdown/Markdawn"; -import TOC from "components/Markdown/TOC"; -import ReturnButton, { +import { AppLayout } from "components/AppLayout"; +import { Chip } from "components/Chip"; +import { HorizontalLine } from "components/HorizontalLine"; +import { Markdawn } from "components/Markdown/Markdawn"; +import { TOC } from "components/Markdown/TOC"; +import { + ReturnButton, ReturnButtonType, } from "components/PanelComponents/ReturnButton"; -import ContentPanel from "components/Panels/ContentPanel"; -import SubPanel from "components/Panels/SubPanel"; -import PreviewLine from "components/PreviewLine"; -import RecorderChip from "components/RecorderChip"; -import ThumbnailHeader from "components/ThumbnailHeader"; -import ToolTip from "components/ToolTip"; +import { ContentPanel } from "components/Panels/ContentPanel"; +import { SubPanel } from "components/Panels/SubPanel"; +import { PreviewLine } from "components/PreviewLine"; +import { RecorderChip } from "components/RecorderChip"; +import { ThumbnailHeader } from "components/ThumbnailHeader"; +import { ToolTip } from "components/ToolTip"; import { GetContentTextQuery } from "graphql/generated"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; import { getReadySdk } from "graphql/sdk"; diff --git a/src/pages/contents/index.tsx b/src/pages/contents/index.tsx index ce1cb13..07003d0 100644 --- a/src/pages/contents/index.tsx +++ b/src/pages/contents/index.tsx @@ -1,13 +1,14 @@ -import AppLayout from "components/AppLayout"; -import Chip from "components/Chip"; -import Select from "components/Inputs/Select"; -import Switch from "components/Inputs/Switch"; -import PanelHeader from "components/PanelComponents/PanelHeader"; -import ContentPanel, { +import { AppLayout } from "components/AppLayout"; +import { Chip } from "components/Chip"; +import { Select } from "components/Inputs/Select"; +import { Switch } from "components/Inputs/Switch"; +import { PanelHeader } from "components/PanelComponents/PanelHeader"; +import { + ContentPanel, ContentPanelWidthSizes, } from "components/Panels/ContentPanel"; -import SubPanel from "components/Panels/SubPanel"; -import PreviewCard from "components/PreviewCard"; +import { SubPanel } from "components/Panels/SubPanel"; +import { PreviewCard } from "components/PreviewCard"; import { GetContentsQuery } from "graphql/generated"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; import { getReadySdk } from "graphql/sdk"; @@ -120,7 +121,8 @@ export default function Contents(props: Immutable): JSX.Element { thumbnailAspectRatio="3/2" stackEffect={ item.attributes.next_recommended?.data?.id !== null && - item.attributes.next_recommended?.data?.id !== undefined && + item.attributes.next_recommended?.data?.id !== + undefined && combineRelatedContent } topChips={ diff --git a/src/pages/dev/checkup/contents.tsx b/src/pages/dev/checkup/contents.tsx index 2f577d0..cff8eb0 100644 --- a/src/pages/dev/checkup/contents.tsx +++ b/src/pages/dev/checkup/contents.tsx @@ -1,10 +1,11 @@ -import AppLayout from "components/AppLayout"; -import Chip from "components/Chip"; -import Button from "components/Inputs/Button"; -import ContentPanel, { +import { AppLayout } from "components/AppLayout"; +import { Chip } from "components/Chip"; +import { Button } from "components/Inputs/Button"; +import { + ContentPanel, ContentPanelWidthSizes, } from "components/Panels/ContentPanel"; -import ToolTip from "components/ToolTip"; +import { ToolTip } from "components/ToolTip"; import { DevGetContentsQuery, Enum_Componentsetstextset_Status, @@ -39,7 +40,8 @@ export default function CheckupContents(props: Immutable): JSX.Element { {testReport.lines.map((line, index) => (