1- import React from 'react' ;
2- import { useSiteConfig , useSocialConfig } from '../../config/ConfigContext' ;
3- import { useI18n } from '../../i18n/I18nContext' ;
4- import styles from './Footer.module.css' ;
1+ import React from 'react'
2+ import { useSiteConfig , useSocialConfig } from '../../config/ConfigContext'
3+ import { useI18n } from '../../i18n/I18nContext'
4+ import { SocialIcon } from '../common/SocialIcon'
5+ import styles from './Footer.module.css'
56
67/**
78 * 页面底部组件
89 */
910export function Footer ( ) {
10- const siteConfig = useSiteConfig ( ) ;
11- const socialLinks = useSocialConfig ( ) ;
12- const { t } = useI18n ( ) ;
13- const currentYear = new Date ( ) . getFullYear ( ) ;
11+ const siteConfig = useSiteConfig ( )
12+ const socialLinks = useSocialConfig ( )
13+ const { t } = useI18n ( )
14+ const currentYear = new Date ( ) . getFullYear ( )
1415
1516 return (
1617 < footer className = { styles . footer } >
@@ -20,15 +21,17 @@ export function Footer() {
2021 { socialLinks && socialLinks . length > 0 && (
2122 < div className = { styles . social } >
2223 { socialLinks . map ( ( link , index ) => (
23- < a
24+ < a
2425 key = { index }
2526 href = { link . url }
2627 className = { styles . socialLink }
2728 target = "_blank"
2829 rel = "noopener noreferrer"
2930 aria-label = { link . name }
31+ title = { link . name }
3032 >
31- { link . name }
33+ < SocialIcon icon = { link . icon } size = { 20 } />
34+ < span className = { styles . socialName } > { link . name } </ span >
3235 </ a >
3336 ) ) }
3437 </ div >
@@ -37,19 +40,21 @@ export function Footer() {
3740 { /* 版权信息 */ }
3841 < div className = { styles . copyright } >
3942 < p >
40- © { currentYear } { siteConfig ?. author || siteConfig ?. title } .
41- { ' ' } { t ( 'footer.poweredBy' ) } < a
42- href = "https://github.com/mappedinfo/ppage"
43- target = "_blank"
43+ © { currentYear } { siteConfig ?. author || siteConfig ?. title } .{ ' ' }
44+ { t ( 'footer.poweredBy' ) } { ' ' }
45+ < a
46+ href = "https://github.com/mappedinfo/ppage"
47+ target = "_blank"
4448 rel = "noopener noreferrer"
4549 className = { styles . link }
4650 >
4751 { t ( 'footer.poweredByLink' ) }
48- </ a > { t ( 'footer.poweredBySuffix' ) && ` ${ t ( 'footer.poweredBySuffix' ) } ` }
52+ </ a >
53+ { t ( 'footer.poweredBySuffix' ) && ` ${ t ( 'footer.poweredBySuffix' ) } ` }
4954 </ p >
5055 </ div >
5156 </ div >
5257 </ div >
5358 </ footer >
54- ) ;
59+ )
5560}
0 commit comments