diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..bb96e17e5d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.vscode/ + +.git/ +.github/ + +node_modules/ +*.log + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..0249dd5b4e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM node:lts +WORKDIR /app + +COPY package.json /app +COPY package-lock.json /app +RUN npm ci + +COPY . /app +RUN npm run build + +CMD ["npm", "run", "start"] diff --git a/components/Footer.tsx b/components/Footer.tsx index 2e5452627b..bbbf7b1746 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -1,26 +1,18 @@ import * as React from 'react' -import { FaEnvelopeOpenText } from '@react-icons/all-files/fa/FaEnvelopeOpenText' -import { FaGithub } from '@react-icons/all-files/fa/FaGithub' -import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin' -import { FaMastodon } from '@react-icons/all-files/fa/FaMastodon' -import { FaTwitter } from '@react-icons/all-files/fa/FaTwitter' -import { FaYoutube } from '@react-icons/all-files/fa/FaYoutube' -import { FaZhihu } from '@react-icons/all-files/fa/FaZhihu' -import { IoMoonSharp } from '@react-icons/all-files/io5/IoMoonSharp' -import { IoSunnyOutline } from '@react-icons/all-files/io5/IoSunnyOutline' +import { IoMoonSharp, IoSunnyOutline } from 'react-icons/io5' import * as config from '@/lib/config' -import { useDarkMode } from '@/lib/use-dark-mode' - +import { DarkModeContext } from '@/lib/use-dark-mode' +import { socialLinks } from './PageSocial' import styles from './styles.module.css' +import { cs } from 'react-notion-x' -// TODO: merge the data and icons from PageSocial with the social links in Footer export const FooterImpl: React.FC = () => { - const [hasMounted, setHasMounted] = React.useState(false) - const { isDarkMode, toggleDarkMode } = useDarkMode() - const currentYear = new Date().getFullYear() + const [hasMounted, setHasMounted] = React.useState(false); + const { isDarkMode, toggleDarkMode } = React.useContext(DarkModeContext); + const currentYear = new Date().getFullYear(); const onToggleDarkMode = React.useCallback( (e) => { @@ -28,11 +20,11 @@ export const FooterImpl: React.FC = () => { toggleDarkMode() }, [toggleDarkMode] - ) + ); React.useEffect(() => { setHasMounted(true) - }, []) + }, []); return (