Skip to content

Commit

Permalink
remove toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
swampholyten committed Dec 17, 2024
1 parent 1a7f201 commit 650371b
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
import { FaGithub } from '@react-icons/all-files/fa/FaGithub'
import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin'
import { FaTwitter } from '@react-icons/all-files/fa/FaTwitter'
import { IoMoonSharp } from '@react-icons/all-files/io5/IoMoonSharp'
import { IoSunnyOutline } from '@react-icons/all-files/io5/IoSunnyOutline'
import * as React from 'react'

import * as config from '@/lib/config'
import { useDarkMode } from '@/lib/use-dark-mode'

import styles from './styles.module.css'

// TODO: merge the data and icons from PageSocial with the social links in Footer

export function FooterImpl() {
const [hasMounted, setHasMounted] = React.useState(false)
const { isDarkMode, toggleDarkMode } = useDarkMode()
const [, setHasMounted] = React.useState(false)
const currentYear = new Date().getFullYear()

const onToggleDarkMode = React.useCallback(
(e) => {
e.preventDefault()
toggleDarkMode()
},
[toggleDarkMode]
)

React.useEffect(() => {
setHasMounted(true)
}, [])
Expand All @@ -35,20 +23,6 @@ export function FooterImpl() {
Copyright {currentYear} {config.author}
</div>

<div className={styles.settings}>
{hasMounted && (
<a
className={styles.toggleDarkMode}
href='#'
role='button'
onClick={onToggleDarkMode}
title='Toggle dark mode'
>
{isDarkMode ? <IoMoonSharp /> : <IoSunnyOutline />}
</a>
)}
</div>

<div className={styles.social}>
{config.twitter && (
<a
Expand Down

0 comments on commit 650371b

Please sign in to comment.