From a488d3324e833b35a1b3406d6cc1b158eae1d1f8 Mon Sep 17 00:00:00 2001 From: spencerwooo Date: Sun, 29 Aug 2021 22:31:42 +0100 Subject: [PATCH] colored toast and other minor tweaks --- components/Breadcrumb.tsx | 6 +++--- components/DownloadBtn.tsx | 9 ++++++++- components/FileListing.tsx | 26 +++++++++++++++++--------- components/Navbar.tsx | 9 ++++++--- components/previews/VideoPreview.tsx | 9 ++++++++- config/site.json | 2 +- tailwind.config.js | 7 ++++++- utils/tools.ts | 2 +- 8 files changed, 50 insertions(+), 20 deletions(-) diff --git a/components/Breadcrumb.tsx b/components/Breadcrumb.tsx index 8c62816..1935991 100644 --- a/components/Breadcrumb.tsx +++ b/components/Breadcrumb.tsx @@ -9,13 +9,13 @@ const Breadcrumb: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) => if (Array.isArray(path)) { return (
-
+
🚩 Home
{path.map((q: string, i: number) => (
/
-
+
= ({ query }) => } return ( -
+
🚩 Home
diff --git a/components/DownloadBtn.tsx b/components/DownloadBtn.tsx index 3583506..1a675c4 100644 --- a/components/DownloadBtn.tsx +++ b/components/DownloadBtn.tsx @@ -12,7 +12,14 @@ const DownloadBtn: FunctionComponent<{ downloadUrl: string }> = ({ downloadUrl } return ( - + + {imagesInFolder.length !== 0 && ( = ({ query }) = )} {children.map((c: any) => ( -
+
{ @@ -227,33 +235,33 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) =
{c.folder ? ( -
+
{ clipboard.copy(`${getBaseUrl()}${path === '/' ? '' : path}/${encodeURIComponent(c.name)}`) - toast.success('Copied folder permanent link to clipboard.') + toast.success('Copied folder permalink.') }} >
) : ( -
+
{ clipboard.copy(`${getBaseUrl()}/api?path=${path === '/' ? '' : path}/${c.name}&raw=true`) - toast.success('Copied permanent raw file link to clipboard.') + toast.success('Copied raw file permalink.') }} > diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 77a5fd1..057c0b6 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -1,17 +1,20 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import Link from 'next/link' import siteConfig from '../config/site.json' const Navbar = () => { return ( -
+
-

{siteConfig.title}

+

+ {siteConfig.title} +

diff --git a/components/previews/VideoPreview.tsx b/components/previews/VideoPreview.tsx index 43666a1..d10b443 100644 --- a/components/previews/VideoPreview.tsx +++ b/components/previews/VideoPreview.tsx @@ -28,7 +28,14 @@ export const VideoPreview: FunctionComponent<{ file: any }> = ({ file }) => {
- + onedrive-vercel-index. Made with ❤ by SpencerWoo." + "footer": "Powered by onedrive-vercel-index. Made with ❤ by SpencerWoo." } diff --git a/tailwind.config.js b/tailwind.config.js index 3b38874..874c065 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -4,7 +4,7 @@ const colors = require('tailwindcss/colors') module.exports = { mode: 'jit', purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'], - darkMode: 'media', // or 'media' or 'class' + darkMode: 'media', theme: { colors: { transparent: 'transparent', @@ -23,6 +23,11 @@ module.exports = { extend: { fontFamily: { sans: ['Inter', '"Noto Sans SC"', ...defaultTheme.fontFamily.sans] + }, + colors: { + gray: { + 850: '#2E2E34' + } } } }, diff --git a/utils/tools.ts b/utils/tools.ts index a797834..47fb184 100644 --- a/utils/tools.ts +++ b/utils/tools.ts @@ -22,7 +22,7 @@ const fetcher = (url: string) => axios.get(url).then(res => res.data) */ export const useStaleSWR = (dataKey: Key) => { const revalidationOptions = { - revalidateOnMount: !cache.has(dataKey), //here we refer to the SWR cache + revalidateOnMount: !cache.has(dataKey), revalidateOnFocus: false, revalidateOnReconnect: false, }