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/.mise.toml b/.mise.toml new file mode 100644 index 0000000000..1a8de7d134 --- /dev/null +++ b/.mise.toml @@ -0,0 +1,20 @@ +[tools] +# There was a moment when Notion search API was broken +# It was fixed directly in react-notion-x dependency +# When trying to replace the dependency I tried to run +# $ brew install vips +# $ yarn add https://github.com/NotionX/react-notion-x#v6.16.2 +# There's weird errors if one is building react-notion-x directly from github +# 'ValueError: invalid mode: 'rU' while trying to load binding.gyp' +# These should be fixed by downgrading python to 3.10 +# Source: https://stackoverflow.com/a/74732671 +python = ['3.10'] + +# The node-gyp module doesn't work properly when using node 20 +# TypeError: Cannot assign to read only property 'cflags' of object '#' +# See more: https://stackoverflow.com/a/77910474/1337062 +node = ['20'] +"npm:yarn" = "latest" + +# To be able to build the notion-react-x directly from Github master +"npm:lerna" = "^4.0.0" 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 (