File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 11import { siteConfig } from '@/lib/config'
2+ import { useRef } from 'react'
3+ import { handleEmailClick } from '@/lib/plugins/mailEncrypt'
24
35/**
46 * 社交联系方式按钮组
57 * @returns {JSX.Element }
68 * @constructor
79 */
810const SocialButton = ( ) => {
11+
12+ const emailIcon = useRef ( null )
13+ const CONTACT_EMAIL = siteConfig ( 'CONTACT_EMAIL' )
14+
915 return (
1016 < div className = 'w-52 justify-center flex-wrap flex' >
1117 < div className = 'space-x-3 text-xl text-gray-600 dark:text-gray-400 text-center' >
@@ -63,12 +69,12 @@ const SocialButton = () => {
6369 < i className = 'fab fa-instagram transform hover:scale-125 duration-150' />
6470 </ a >
6571 ) }
66- { siteConfig ( ' CONTACT_EMAIL' ) && (
72+ { CONTACT_EMAIL && (
6773 < a
68- target = '_blank'
69- rel = 'noreferrer '
70- title = { 'email' }
71- href = { `mailto: ${ siteConfig ( 'CONTACT_EMAIL' ) } ` } >
74+ onClick = { e => handleEmailClick ( e , emailIcon , CONTACT_EMAIL ) }
75+ title = 'email '
76+ className = 'cursor-pointer'
77+ ref = { emailIcon } >
7278 < i className = 'fas fa-envelope transform hover:scale-125 duration-150' />
7379 </ a >
7480 ) }
@@ -103,4 +109,4 @@ const SocialButton = () => {
103109 </ div >
104110 )
105111}
106- export default SocialButton
112+ export default SocialButton
You can’t perform that action at this time.
0 commit comments