From 88e3db35728ee11c203811981176611aae12269f Mon Sep 17 00:00:00 2001 From: spencerwooo Date: Fri, 2 Jul 2021 15:09:07 +0100 Subject: [PATCH] configurable footer, baseurl from window.location --- components/DownloadBtn.tsx | 4 ++-- components/FileListing.tsx | 4 ++-- components/Footer.tsx | 10 +++++++++- config/site.json | 4 ++-- utils/tools.ts | 6 ++++++ 5 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 utils/tools.ts diff --git a/components/DownloadBtn.tsx b/components/DownloadBtn.tsx index 801eb24..b34c208 100644 --- a/components/DownloadBtn.tsx +++ b/components/DownloadBtn.tsx @@ -3,7 +3,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import toast, { Toaster } from 'react-hot-toast' import { useRouter } from 'next/router' -import config from '../config/site.json' +import { getBaseUrl } from '../utils/tools' const DownloadBtn: FunctionComponent<{ downloadUrl: string }> = ({ downloadUrl }) => { const { asPath } = useRouter() @@ -23,7 +23,7 @@ const DownloadBtn: FunctionComponent<{ downloadUrl: string }> = ({ downloadUrl }