From 247124c7a7742b60e03900ad6644f4a4a48fdc10 Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Mon, 7 Mar 2022 18:36:36 -0800 Subject: [PATCH] Header and home page improvements --- client/components/document/index.tsx | 2 +- client/components/header/header.module.css | 5 +++ client/components/header/index.tsx | 32 +++++++++++++++++--- client/components/preview/preview.module.css | 3 -- client/pages/_app.tsx | 2 +- client/pages/index.tsx | 2 +- client/pages/mine.tsx | 2 +- client/pages/new.tsx | 2 +- client/pages/post/[id].tsx | 3 +- client/pages/signin.tsx | 2 +- client/pages/signup.tsx | 2 +- 11 files changed, 41 insertions(+), 16 deletions(-) diff --git a/client/components/document/index.tsx b/client/components/document/index.tsx index ece89eca..8f2f1423 100644 --- a/client/components/document/index.tsx +++ b/client/components/document/index.tsx @@ -30,7 +30,7 @@ const Document = ({ remove, editable, title, content, setTitle, setContent, init } return ( - +
{ const router = useRouter(); @@ -91,8 +91,8 @@ const Header = ({ changeTheme, theme }: DriftProps) => { } return ( - -
+ + {!isMobile &&
{ else return null })} -
+
}
{isMobile && ( )}
+ {isMobile && expanded && (
+ + {pages.map((tab, index) => { + if (tab.condition) + return + })} + +
)} +
) } diff --git a/client/components/preview/preview.module.css b/client/components/preview/preview.module.css index d5adeae4..fcee23ff 100644 --- a/client/components/preview/preview.module.css +++ b/client/components/preview/preview.module.css @@ -1,7 +1,5 @@ .markdownPreview { position: relative; - padding: var(--gap); - padding-top: 0; overflow-y: auto; } @@ -47,7 +45,6 @@ content: ""; } -/* circles for sublists */ .markdownPreview ul ul { list-style: circle; } diff --git a/client/pages/_app.tsx b/client/pages/_app.tsx index c0ebc473..30a35dde 100644 --- a/client/pages/_app.tsx +++ b/client/pages/_app.tsx @@ -27,7 +27,7 @@ function MyApp({ Component, pageProps }: AppProps) { - + ) } diff --git a/client/pages/index.tsx b/client/pages/index.tsx index be8cfa17..649ac360 100644 --- a/client/pages/index.tsx +++ b/client/pages/index.tsx @@ -7,7 +7,7 @@ import { ThemeProps } from './_app' import Document from '../components/document' const Home = ({ theme, changeTheme }: ThemeProps) => { return ( - + Drift diff --git a/client/pages/mine.tsx b/client/pages/mine.tsx index ba70a28a..99a1c4d2 100644 --- a/client/pages/mine.tsx +++ b/client/pages/mine.tsx @@ -11,7 +11,7 @@ const Home = ({ theme, changeTheme }: { theme: "light" | "dark", changeTheme: () const { isLoading, isSignedIn } = useSignedIn({ redirectIfNotAuthed: true }) return ( - + Drift diff --git a/client/pages/new.tsx b/client/pages/new.tsx index d3dbad6b..37cc176f 100644 --- a/client/pages/new.tsx +++ b/client/pages/new.tsx @@ -14,7 +14,7 @@ const Home = ({ theme, changeTheme }: ThemeProps) => { router.push("/signin") } return ( - + Drift diff --git a/client/pages/post/[id].tsx b/client/pages/post/[id].tsx index 02adabe8..6f9457d6 100644 --- a/client/pages/post/[id].tsx +++ b/client/pages/post/[id].tsx @@ -1,4 +1,5 @@ -import { Loading, Page, Text } from "@geist-ui/core"; +import { Loading, Text } from "@geist-ui/core"; +import Page from '../../components/page/Page' import { useRouter } from "next/router"; import { useCallback, useEffect, useState } from "react"; import Document from '../../components/document' diff --git a/client/pages/signin.tsx b/client/pages/signin.tsx index e5d51f0e..20db6174 100644 --- a/client/pages/signin.tsx +++ b/client/pages/signin.tsx @@ -4,7 +4,7 @@ import Header from "../components/header"; import { ThemeProps } from "./_app"; const SignIn = ({ theme, changeTheme }: ThemeProps) => ( - +
diff --git a/client/pages/signup.tsx b/client/pages/signup.tsx index c5b59f34..2bb1c9c8 100644 --- a/client/pages/signup.tsx +++ b/client/pages/signup.tsx @@ -4,7 +4,7 @@ import Header from "../components/header"; import { ThemeProps } from "./_app"; const SignUp = ({ theme, changeTheme }: ThemeProps) => ( - +