File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
themes/commerce/components Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import CopyRightDate from '@/components/CopyRightDate'
44import { siteConfig } from '@/lib/config'
55import Link from 'next/link'
66import CONFIG from '../config'
7+ import { decryptEmail , handleEmailClick } from '@/lib/plugins/mailEncrypt'
8+ import { useRef } from 'react'
79
810/**
911 * 页脚
@@ -18,6 +20,10 @@ const Footer = props => {
1820 parseInt ( since ) < currentYear ? since + '-' + currentYear : currentYear
1921 const { categoryOptions, customMenu } = props
2022
23+ const CONTACT_EMAIL = siteConfig ( 'CONTACT_EMAIL' )
24+
25+ const emailIcon = useRef ( null )
26+
2127 return (
2228 < footer
2329 id = 'footer-wrapper'
@@ -128,14 +134,16 @@ const Footer = props => {
128134 </ div >
129135 < div className = 'text-lg' >
130136 { ' ' }
131- { siteConfig ( ' CONTACT_EMAIL' ) && (
137+ { CONTACT_EMAIL && (
132138 < a
133- target = '_blank'
134- rel = 'noreferrer'
135- title = { 'email' }
136- href = { `mailto:${ siteConfig ( 'CONTACT_EMAIL' ) } ` } >
139+ onClick = { e =>
140+ handleEmailClick ( e , emailIcon , CONTACT_EMAIL )
141+ }
142+ title = 'email'
143+ className = 'cursor-pointer'
144+ ref = { emailIcon } >
137145 < i className = 'transform hover:scale-125 duration-150 fas fa-envelope dark:hover:text-red-400 hover:text-red-600' /> { ' ' }
138- { siteConfig ( ' CONTACT_EMAIL' ) }
146+ { decryptEmail ( CONTACT_EMAIL ) }
139147 </ a >
140148 ) }
141149 </ div >
You can’t perform that action at this time.
0 commit comments