diff --git a/client/components/auth/index.tsx b/client/components/auth/index.tsx index 27058b59..e35b7025 100644 --- a/client/components/auth/index.tsx +++ b/client/components/auth/index.tsx @@ -20,7 +20,7 @@ const Auth = ({ page }: { page: "signup" | "signin" }) => { } else { localStorage.setItem('drift-token', json.token) localStorage.setItem('drift-userid', json.userId) - router.push('/new') + router.push('/') } } diff --git a/client/components/document/index.tsx b/client/components/document/index.tsx index 14ad7f2f..8dfc05ca 100644 --- a/client/components/document/index.tsx +++ b/client/components/document/index.tsx @@ -32,7 +32,6 @@ const Document = ({ remove, editable, title, content, setTitle, setContent, init if (!title) return const pathParts = title.split(".") const language = pathParts.length > 1 ? pathParts[pathParts.length - 1] : "" - console.log(language) return language }, [title]) diff --git a/client/pages/_app.tsx b/client/pages/_app.tsx index f0a064ff..3bd66d84 100644 --- a/client/pages/_app.tsx +++ b/client/pages/_app.tsx @@ -1,10 +1,12 @@ import '../styles/globals.css' -import { GeistProvider, CssBaseline } from '@geist-ui/core' -import { useEffect, useState } from 'react' +import { GeistProvider, CssBaseline, useTheme } from '@geist-ui/core' +import { useEffect, useMemo, useState } from 'react' import type { AppProps as NextAppProps } from "next/app"; import useSharedState from '../lib/hooks/use-shared-state'; import 'react-loading-skeleton/dist/skeleton.css' +import { SkeletonTheme } from 'react-loading-skeleton'; +import Head from 'next/head'; export type ThemeProps = { theme: "light" | "dark" | string, @@ -19,7 +21,7 @@ export type DriftProps = ThemeProps function MyApp({ Component, pageProps }: AppProps) { const [themeType, setThemeType] = useSharedState('theme', 'light') - + const theme = useTheme(); useEffect(() => { if (typeof window === 'undefined' || !window.localStorage) return const storedTheme = window.localStorage.getItem('drift-theme') @@ -33,11 +35,38 @@ function MyApp({ Component, pageProps }: AppProps) { setThemeType(last => (last === 'dark' ? 'light' : 'dark')) } + const skeletonBaseColor = useMemo(() => { + if (themeType === 'dark') return '#333' + return '#eee' + }, [themeType]) + const skeletonHighlightColor = useMemo(() => { + if (themeType === 'dark') return '#555' + return '#ddd' + }, [themeType]) + return ( - - - - + <> + + + + + + + + + + + + + + + + + + + + + ) } diff --git a/client/pages/index.tsx b/client/pages/index.tsx index 93fc5e2f..4bf1b674 100644 --- a/client/pages/index.tsx +++ b/client/pages/index.tsx @@ -1,14 +1,15 @@ import Head from 'next/head' import styles from '../styles/Home.module.css' -import { Page, Spacer } from '@geist-ui/core' +import { Page, Spacer, Text } from '@geist-ui/core' import Header from '../components/header' import { ThemeProps } from './_app' import Document from '../components/document' +import Image from 'next/image' +import ShiftBy from '../components/shift-by' export function getStaticProps() { - const introDoc = `# Welcome to Drift -### Drift is a self-hostable clone of GitHub Gist. + const introDoc = `### Drift is a self-hostable clone of GitHub Gist. #### It is a simple way to share code and text snippets with your friends, with support for the following: - Render GitHub Extended Markdown (including images) @@ -58,12 +59,16 @@ const Home = ({ theme, changeTheme, introContent, todoContent }: Props) => { Drift -
+
+ + + Welcome to Drift +
Drift -
diff --git a/client/pages/new.tsx b/client/pages/new.tsx index 77b65838..d05e8b9d 100644 --- a/client/pages/new.tsx +++ b/client/pages/new.tsx @@ -17,8 +17,6 @@ const Home = ({ theme, changeTheme }: ThemeProps) => { Drift - - diff --git a/client/pages/signin.tsx b/client/pages/signin.tsx index f03d49c4..8e54f9de 100644 --- a/client/pages/signin.tsx +++ b/client/pages/signin.tsx @@ -1,10 +1,15 @@ import { Page } from "@geist-ui/core"; +import Head from 'next/head' import Auth from "../components/auth"; import Header from "../components/header"; import { ThemeProps } from "./_app"; const SignIn = ({ theme, changeTheme }: ThemeProps) => ( + + Drift - Sign In + +
diff --git a/client/pages/signup.tsx b/client/pages/signup.tsx index 8c8ef7db..0af0413d 100644 --- a/client/pages/signup.tsx +++ b/client/pages/signup.tsx @@ -1,10 +1,15 @@ import { Page } from "@geist-ui/core"; +import Head from "next/head"; import Auth from "../components/auth"; import Header from "../components/header"; import { ThemeProps } from "./_app"; const SignUp = ({ theme, changeTheme }: ThemeProps) => ( + + Drift - Sign Up + +
@@ -14,4 +19,4 @@ const SignUp = ({ theme, changeTheme }: ThemeProps) => ( ) -export default SignUp \ No newline at end of file +export default SignUp diff --git a/client/public/android-chrome-192x192.png b/client/public/android-chrome-192x192.png new file mode 100644 index 00000000..30801c5f Binary files /dev/null and b/client/public/android-chrome-192x192.png differ diff --git a/client/public/android-chrome-512x512.png b/client/public/android-chrome-512x512.png new file mode 100644 index 00000000..783d2d8a Binary files /dev/null and b/client/public/android-chrome-512x512.png differ diff --git a/client/public/apple-touch-icon.png b/client/public/apple-touch-icon.png new file mode 100644 index 00000000..866a0923 Binary files /dev/null and b/client/public/apple-touch-icon.png differ diff --git a/assets/logo-optimized.svg b/client/public/assets/logo-optimized.svg similarity index 77% rename from assets/logo-optimized.svg rename to client/public/assets/logo-optimized.svg index fce4b1fe..8963dd95 100644 --- a/assets/logo-optimized.svg +++ b/client/public/assets/logo-optimized.svg @@ -2,18 +2,18 @@ - + - + - + - - - + + + - + \ No newline at end of file diff --git a/assets/logo.png b/client/public/assets/logo.png similarity index 100% rename from assets/logo.png rename to client/public/assets/logo.png diff --git a/assets/logo.svg b/client/public/assets/logo.svg similarity index 100% rename from assets/logo.svg rename to client/public/assets/logo.svg diff --git a/client/public/browserconfig.xml b/client/public/browserconfig.xml new file mode 100644 index 00000000..b3930d0f --- /dev/null +++ b/client/public/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #da532c + + + diff --git a/client/public/favicon-16x16.png b/client/public/favicon-16x16.png new file mode 100644 index 00000000..6544286c Binary files /dev/null and b/client/public/favicon-16x16.png differ diff --git a/client/public/favicon-32x32.png b/client/public/favicon-32x32.png new file mode 100644 index 00000000..51f8d595 Binary files /dev/null and b/client/public/favicon-32x32.png differ diff --git a/client/public/favicon.ico b/client/public/favicon.ico index 718d6fea..68beab14 100644 Binary files a/client/public/favicon.ico and b/client/public/favicon.ico differ diff --git a/client/public/favicon.png b/client/public/favicon.png new file mode 100644 index 00000000..1deb895e Binary files /dev/null and b/client/public/favicon.png differ diff --git a/client/public/favicon.svg b/client/public/favicon.svg new file mode 100644 index 00000000..d2807970 --- /dev/null +++ b/client/public/favicon.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/public/mstile-144x144.png b/client/public/mstile-144x144.png new file mode 100644 index 00000000..a738029d Binary files /dev/null and b/client/public/mstile-144x144.png differ diff --git a/client/public/mstile-150x150.png b/client/public/mstile-150x150.png new file mode 100644 index 00000000..f11ae43f Binary files /dev/null and b/client/public/mstile-150x150.png differ diff --git a/client/public/mstile-310x150.png b/client/public/mstile-310x150.png new file mode 100644 index 00000000..a2795ba6 Binary files /dev/null and b/client/public/mstile-310x150.png differ diff --git a/client/public/mstile-310x310.png b/client/public/mstile-310x310.png new file mode 100644 index 00000000..1483c33d Binary files /dev/null and b/client/public/mstile-310x310.png differ diff --git a/client/public/mstile-70x70.png b/client/public/mstile-70x70.png new file mode 100644 index 00000000..e6227cee Binary files /dev/null and b/client/public/mstile-70x70.png differ diff --git a/client/public/safari-pinned-tab.svg b/client/public/safari-pinned-tab.svg new file mode 100644 index 00000000..69348c66 --- /dev/null +++ b/client/public/safari-pinned-tab.svg @@ -0,0 +1,26 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + diff --git a/client/public/site.webmanifest b/client/public/site.webmanifest new file mode 100644 index 00000000..be9a6f3c --- /dev/null +++ b/client/public/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "Drift", + "short_name": "Drift", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/client/public/vercel.svg b/client/public/vercel.svg deleted file mode 100644 index fbf0e25a..00000000 --- a/client/public/vercel.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - \ No newline at end of file