From dbe9057894744ebf9aa19ff182de687e9657f42f Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 10 Oct 2024 17:00:07 +0800 Subject: [PATCH] =?UTF-8?q?starter=E4=B8=BB=E9=A2=98=E7=9A=84=E7=A4=BE?= =?UTF-8?q?=E4=BA=A4=E6=8C=89=E9=92=AE=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/fukasawa/components/SocialButton.js | 142 ++++++++++++++++----- 1 file changed, 110 insertions(+), 32 deletions(-) diff --git a/themes/fukasawa/components/SocialButton.js b/themes/fukasawa/components/SocialButton.js index 87c35d12..a2bfa2f8 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 && ( + + )}
)