diff --git a/themes/fukasawa/components/SocialButton.js b/themes/fukasawa/components/SocialButton.js index 87c35d12484..a2bfa2f889c 100644 --- a/themes/fukasawa/components/SocialButton.js +++ b/themes/fukasawa/components/SocialButton.js @@ -1,4 +1,6 @@ +import QrCode from '@/components/QrCode' import { siteConfig } from '@/lib/config' +import { useState } from 'react' /** * 社交联系方式按钮组 @@ -6,99 +8,175 @@ import { siteConfig } from '@/lib/config' * @constructor */ const SocialButton = () => { + const CONTACT_GITHUB = siteConfig('CONTACT_GITHUB') + const CONTACT_TWITTER = siteConfig('CONTACT_TWITTER') + const CONTACT_TELEGRAM = siteConfig('CONTACT_TELEGRAM') + + const CONTACT_LINKEDIN = siteConfig('CONTACT_LINKEDIN') + const CONTACT_WEIBO = siteConfig('CONTACT_WEIBO') + const CONTACT_INSTAGRAM = siteConfig('CONTACT_INSTAGRAM') + const CONTACT_EMAIL = siteConfig('CONTACT_EMAIL') + const ENABLE_RSS = siteConfig('ENABLE_RSS') + const CONTACT_BILIBILI = siteConfig('CONTACT_BILIBILI') + const CONTACT_YOUTUBE = siteConfig('CONTACT_YOUTUBE') + + const CONTACT_XIAOHONGSHU = siteConfig('CONTACT_XIAOHONGSHU') + const CONTACT_ZHISHIXINGQIU = siteConfig('CONTACT_ZHISHIXINGQIU') + const CONTACT_WEHCHAT_PUBLIC = siteConfig('CONTACT_WEHCHAT_PUBLIC') + const [qrCodeShow, setQrCodeShow] = useState(false) + + const openPopover = () => { + setQrCodeShow(true) + } + const closePopover = () => { + setQrCodeShow(false) + } + return ( -
-
- {siteConfig('CONTACT_GITHUB') && ( +
+
+ {CONTACT_GITHUB && ( - + href={CONTACT_GITHUB}> + )} - {siteConfig('CONTACT_TWITTER') && ( + {CONTACT_TWITTER && ( - + href={CONTACT_TWITTER}> + )} - {siteConfig('CONTACT_TELEGRAM') && ( + {CONTACT_TELEGRAM && ( - + )} - {siteConfig('CONTACT_LINKEDIN') && ( + {CONTACT_LINKEDIN && ( - + href={CONTACT_LINKEDIN} + title={'linkIn'}> + )} - {siteConfig('CONTACT_WEIBO') && ( + {CONTACT_WEIBO && ( - + href={CONTACT_WEIBO}> + )} - {siteConfig('CONTACT_INSTAGRAM') && ( + {CONTACT_INSTAGRAM && ( - + href={CONTACT_INSTAGRAM}> + )} - {siteConfig('CONTACT_EMAIL') && ( + {CONTACT_EMAIL && ( - + href={`mailto:${CONTACT_EMAIL}`}> + )} - {JSON.parse(siteConfig('ENABLE_RSS')) && ( + {ENABLE_RSS && ( - + )} - {siteConfig('CONTACT_BILIBILI') && ( + {CONTACT_BILIBILI && ( - + href={CONTACT_BILIBILI}> + )} - {siteConfig('CONTACT_YOUTUBE') && ( + {CONTACT_YOUTUBE && ( - + href={CONTACT_YOUTUBE}> + )} + {CONTACT_XIAOHONGSHU && ( + + {/* eslint-disable-next-line @next/next/no-img-element */} + 小红书 + + )} + {CONTACT_ZHISHIXINGQIU && ( + + {/* eslint-disable-next-line @next/next/no-img-element */} + 知识星球{' '} + + )} + {CONTACT_WEHCHAT_PUBLIC && ( + + )}
)