11import * as React from 'react'
22
3- import { FaEnvelopeOpenText } from '@react-icons/all-files/fa/FaEnvelopeOpenText'
4- import { FaGithub } from '@react-icons/all-files/fa/FaGithub'
5- import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin'
6- import { FaMastodon } from '@react-icons/all-files/fa/FaMastodon'
7- import { FaTwitter } from '@react-icons/all-files/fa/FaTwitter'
8- import { FaYoutube } from '@react-icons/all-files/fa/FaYoutube'
9- import { FaZhihu } from '@react-icons/all-files/fa/FaZhihu'
10- import { IoMoonSharp } from '@react-icons/all-files/io5/IoMoonSharp'
11- import { IoSunnyOutline } from '@react-icons/all-files/io5/IoSunnyOutline'
12-
133import * as config from '@/lib/config'
4+ import { GitHubIcon } from '@/lib/icons/github'
5+ import { LinkedInIcon } from '@/lib/icons/linkedin'
6+ import { MoonIcon } from '@/lib/icons/moon'
7+ import { SunIcon } from '@/lib/icons/sun'
8+ import { TwitterIcon } from '@/lib/icons/twitter'
149import { useDarkMode } from '@/lib/use-dark-mode'
1510
1611import styles from './styles.module.css'
1712
18- // TODO: merge the data and icons from PageSocial with the social links in Footer
19-
20- export const FooterImpl : React . FC = ( ) => {
13+ export function FooterImpl ( ) {
2114 const [ hasMounted , setHasMounted ] = React . useState ( false )
2215 const { isDarkMode, toggleDarkMode } = useDarkMode ( )
2316 const currentYear = new Date ( ) . getFullYear ( )
2417
2518 const onToggleDarkMode = React . useCallback (
26- ( e ) => {
19+ ( e : any ) => {
2720 e . preventDefault ( )
2821 toggleDarkMode ( )
2922 } ,
@@ -36,7 +29,9 @@ export const FooterImpl: React.FC = () => {
3629
3730 return (
3831 < footer className = { styles . footer } >
39- < div className = { styles . copyright } > Copyright { currentYear } { config . author } </ div >
32+ < div className = { styles . copyright } >
33+ Copyright { currentYear } { config . author }
34+ </ div >
4035
4136 < div className = { styles . settings } >
4237 { hasMounted && (
@@ -47,7 +42,7 @@ export const FooterImpl: React.FC = () => {
4742 onClick = { onToggleDarkMode }
4843 title = 'Toggle dark mode'
4944 >
50- { isDarkMode ? < IoMoonSharp /> : < IoSunnyOutline /> }
45+ { isDarkMode ? < MoonIcon /> : < SunIcon /> }
5146 </ a >
5247 ) }
5348 </ div >
@@ -56,35 +51,12 @@ export const FooterImpl: React.FC = () => {
5651 { config . twitter && (
5752 < a
5853 className = { styles . twitter }
59- href = { `https://twitter.com/${ config . twitter } ` }
60- title = { `Twitter @${ config . twitter } ` }
61- target = '_blank'
62- rel = 'noopener noreferrer'
63- >
64- < FaTwitter />
65- </ a >
66- ) }
67-
68- { config . mastodon && (
69- < a
70- className = { styles . mastodon }
71- href = { config . mastodon }
72- title = { `Mastodon ${ config . getMastodonHandle ( ) } ` }
73- rel = 'me'
74- >
75- < FaMastodon />
76- </ a >
77- ) }
78-
79- { config . zhihu && (
80- < a
81- className = { styles . zhihu }
82- href = { `https://zhihu.com/people/${ config . zhihu } ` }
83- title = { `Zhihu @${ config . zhihu } ` }
54+ href = { `https://x.com/${ config . twitter } ` }
55+ title = { `X @${ config . twitter } ` }
8456 target = '_blank'
8557 rel = 'noopener noreferrer'
8658 >
87- < FaZhihu />
59+ < TwitterIcon />
8860 </ a >
8961 ) }
9062
@@ -96,7 +68,7 @@ export const FooterImpl: React.FC = () => {
9668 target = '_blank'
9769 rel = 'noopener noreferrer'
9870 >
99- < FaGithub />
71+ < GitHubIcon />
10072 </ a >
10173 ) }
10274
@@ -108,31 +80,7 @@ export const FooterImpl: React.FC = () => {
10880 target = '_blank'
10981 rel = 'noopener noreferrer'
11082 >
111- < FaLinkedin />
112- </ a >
113- ) }
114-
115- { config . newsletter && (
116- < a
117- className = { styles . newsletter }
118- href = { `${ config . newsletter } ` }
119- title = { `Newsletter ${ config . author } ` }
120- target = '_blank'
121- rel = 'noopener noreferrer'
122- >
123- < FaEnvelopeOpenText />
124- </ a >
125- ) }
126-
127- { config . youtube && (
128- < a
129- className = { styles . youtube }
130- href = { `https://www.youtube.com/${ config . youtube } ` }
131- title = { `YouTube ${ config . author } ` }
132- target = '_blank'
133- rel = 'noopener noreferrer'
134- >
135- < FaYoutube />
83+ < LinkedInIcon />
13684 </ a >
13785 ) }
13886 </ div >
0 commit comments