diff --git a/client/components/Link.tsx b/client/components/Link.tsx new file mode 100644 index 00000000..749faaa6 --- /dev/null +++ b/client/components/Link.tsx @@ -0,0 +1,10 @@ +import { Link as GeistLink, LinkProps } from "@geist-ui/core" +import { useRouter } from "next/router"; + +const Link = (props: LinkProps) => { + const { basePath } = useRouter(); + + return +} + +export default Link \ No newline at end of file diff --git a/client/components/auth/index.tsx b/client/components/auth/index.tsx index 35cc86e3..27058b59 100644 --- a/client/components/auth/index.tsx +++ b/client/components/auth/index.tsx @@ -1,7 +1,8 @@ import { FormEvent, useState } from 'react' -import { Button, Card, Input, Link, Text } from '@geist-ui/core' +import { Button, Card, Input, Text } from '@geist-ui/core' import styles from './auth.module.css' import { useRouter } from 'next/router' +import Link from '../Link' const Auth = ({ page }: { page: "signup" | "signin" }) => { const router = useRouter(); diff --git a/client/components/header/index.tsx b/client/components/header/index.tsx index 3db2efb3..de0d152e 100644 --- a/client/components/header/index.tsx +++ b/client/components/header/index.tsx @@ -1,9 +1,8 @@ -import { Page, ButtonGroup, Button, Link } from "@geist-ui/core"; +import { Page, ButtonGroup, Button } from "@geist-ui/core"; import { Moon, Sun } from "@geist-ui/icons"; -import { useRouter } from "next/router"; -import useSignedIn from "../../lib/hooks/use-signed-in"; import { DriftProps } from "../../pages/_app"; import ShiftBy from "../shift-by"; +import Link from '../Link' const Header = ({ theme, changeTheme }: DriftProps) => { return ( diff --git a/client/components/post-list/index.tsx b/client/components/post-list/index.tsx index 553c3d57..1b89a39d 100644 --- a/client/components/post-list/index.tsx +++ b/client/components/post-list/index.tsx @@ -1,7 +1,8 @@ -import { Loading, Card, Divider, Input, Text, Link } from "@geist-ui/core" +import { Loading, Card, Divider, Input, Text } from "@geist-ui/core" import Preview from "../preview" import ShiftBy from "../shift-by" import VisibilityBadge from "../visibility-badge" +import Link from '../Link' import styles from './post-list.module.css' diff --git a/client/components/unauthenticated-header/index.tsx b/client/components/unauthenticated-header/index.tsx index 63d89d2f..5f80882d 100644 --- a/client/components/unauthenticated-header/index.tsx +++ b/client/components/unauthenticated-header/index.tsx @@ -1,7 +1,8 @@ -import { Page, ButtonGroup, Button, Link } from "@geist-ui/core"; +import { Page, ButtonGroup, Button } from "@geist-ui/core"; import { Moon, Sun } from "@geist-ui/icons"; import { DriftProps } from "../../pages/_app"; import ShiftBy from "../shift-by"; +import Link from '../Link' const UnauthenticatedHeader = ({ theme, changeTheme }: DriftProps) => { return ( diff --git a/client/pages/new.tsx b/client/pages/new.tsx index ea2cffaf..c047ac11 100644 --- a/client/pages/new.tsx +++ b/client/pages/new.tsx @@ -1,13 +1,11 @@ import Head from 'next/head' import styles from '../styles/Home.module.css' import HomeComponent from '../components/post' -import Auth from '../components/auth' -import { useEffect, useState } from 'react' -import { Button, ButtonGroup, Link, Loading, Page } from '@geist-ui/core' +import { Button, ButtonGroup, Loading, Page } from '@geist-ui/core' import { Sun, Moon } from '@geist-ui/icons' import ShiftBy from '../components/shift-by' import useSignedIn from '../lib/hooks/use-signed-in' -import { useRouter } from 'next/router' +import Link from '../components/Link' const Home = ({ theme, changeTheme }: { theme: "light" | "dark", changeTheme: () => void }) => { const { isLoading, isSignedIn } = useSignedIn({ redirectIfNotAuthed: true })