diff --git a/docs/theme/default.md b/docs/theme/default.md index 0b5c9c2f1e..5c5156d505 100644 --- a/docs/theme/default.md +++ b/docs/theme/default.md @@ -174,16 +174,16 @@ export default { 目前支持以下社交平台图标: -| Key | 描述 | -| :------: | :-----------: | -| github | GitHub 平台 | -| weibo | 微博平台 | -| twitter | Twitter 平台 | -| gitlab | Gitlab 平台 | -| facebook | Facebook 平台 | -| zhihu | 知乎平台 | -| yuque | 语雀平台 | -| linkedin | Linkedin 平台 | +| Key | 描述 | +| :------: | :--------------------: | +| github | GitHub 平台 | +| weibo | 微博平台 | +| x | X(Twitter)平台 | +| gitlab | Gitlab 平台 | +| facebook | Facebook 平台 | +| zhihu | 知乎平台 | +| yuque | 语雀平台 | +| linkedin | Linkedin 平台 | ```ts export default { diff --git a/package.json b/package.json index ab5cd08ae1..4c0fd69393 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ ] }, "dependencies": { - "@ant-design/icons-svg": "^4.2.1", + "@ant-design/icons-svg": "^4.4.2", "@makotot/ghostui": "^2.0.0", "@stackblitz/sdk": "^1.9.0", "@swc/core": "1.4.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index afa8c2b6fb..999acaf022 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@ant-design/icons-svg': - specifier: ^4.2.1 - version: 4.2.1 + specifier: ^4.4.2 + version: 4.4.2 '@makotot/ghostui': specifier: ^2.0.0 version: 2.0.0(react@19.0.0-rc-fb9a90fa48-20240614) @@ -609,8 +609,8 @@ packages: resolution: {integrity: sha512-EB0iwlKDGpG93hW8f85CTJTs4SvMX7tt5ceupvhALp1IF44SeUFOMhKUOYqpsoYWQKAOuTRDMqn75rEaKDp0Xw==} dev: false - /@ant-design/icons-svg@4.3.1: - resolution: {integrity: sha512-4QBZg8ccyC6LPIRii7A0bZUk3+lEDCLnhB+FVsflGdcWPPmV+j3fire4AwwoqHV/BibgvBmR9ZIo4s867smv+g==} + /@ant-design/icons-svg@4.4.2: + resolution: {integrity: sha512-vHbT+zJEVzllwP+CM+ul7reTEfBR0vgxFe7+lREAsAA7YGsYpboiq2sQNeQeRvh09GfQgs/GyFEvZpJ9cLXpXA==} /@ant-design/icons@4.8.1(react-dom@19.0.0-rc-fb9a90fa48-20240614)(react@19.0.0-rc-fb9a90fa48-20240614): resolution: {integrity: sha512-JRAuiqllnMsiZIO8OvBOeFconprC3cnMpJ9MvXrHh+H5co9rlg8/aSHQfLf5jKKe18lUgRaIwC2pz8YxH9VuCA==} @@ -620,7 +620,7 @@ packages: react-dom: '>=16.0.0' dependencies: '@ant-design/colors': 6.0.0 - '@ant-design/icons-svg': 4.3.1 + '@ant-design/icons-svg': 4.4.2 '@babel/runtime': 7.23.1 classnames: 2.3.2 lodash: 4.17.21 @@ -637,7 +637,7 @@ packages: react-dom: '>=16.0.0' dependencies: '@ant-design/colors': 7.0.0 - '@ant-design/icons-svg': 4.3.1 + '@ant-design/icons-svg': 4.4.2 '@babel/runtime': 7.23.8 classnames: 2.3.2 rc-util: 5.38.1(react-dom@18.3.1)(react@18.3.1) @@ -653,7 +653,7 @@ packages: react-dom: '>=16.0.0' dependencies: '@ant-design/colors': 7.0.0 - '@ant-design/icons-svg': 4.3.1 + '@ant-design/icons-svg': 4.4.2 '@babel/runtime': 7.23.8 classnames: 2.3.2 rc-util: 5.38.1(react-dom@19.0.0-rc-fb9a90fa48-20240614)(react@19.0.0-rc-fb9a90fa48-20240614) diff --git a/src/client/theme-api/types.ts b/src/client/theme-api/types.ts index 279bd6db45..d6fac00fcd 100644 --- a/src/client/theme-api/types.ts +++ b/src/client/theme-api/types.ts @@ -182,6 +182,7 @@ export type SocialTypes = | 'github' | 'weibo' | 'twitter' + | 'x' | 'gitlab' | 'facebook' | 'zhihu' diff --git a/src/client/theme-default/locales/en-US.json b/src/client/theme-default/locales/en-US.json index 3c485d7094..7063b49df8 100644 --- a/src/client/theme-default/locales/en-US.json +++ b/src/client/theme-default/locales/en-US.json @@ -6,6 +6,7 @@ "header.social.github": "GitHub", "header.social.weibo": "Weibo", "header.social.twitter": "Twitter", + "header.social.x": "X", "header.social.gitlab": "GitLab", "header.social.facebook": "Facebook", "header.social.zhihu": "Zhihu", diff --git a/src/client/theme-default/locales/zh-CN.json b/src/client/theme-default/locales/zh-CN.json index 3dfb317a3b..cd7085697d 100644 --- a/src/client/theme-default/locales/zh-CN.json +++ b/src/client/theme-default/locales/zh-CN.json @@ -6,6 +6,7 @@ "header.social.github": "GitHub", "header.social.weibo": "微博", "header.social.twitter": "Twitter", + "header.social.x": "X", "header.social.gitlab": "GitLab", "header.social.facebook": "Facebook", "header.social.zhihu": "知乎", diff --git a/src/client/theme-default/slots/SocialIcon/index.tsx b/src/client/theme-default/slots/SocialIcon/index.tsx index b272095593..7c79bad187 100644 --- a/src/client/theme-default/slots/SocialIcon/index.tsx +++ b/src/client/theme-default/slots/SocialIcon/index.tsx @@ -3,8 +3,8 @@ import { ReactComponent as IconFacebook } from '@ant-design/icons-svg/inline-svg import { ReactComponent as IconGitHub } from '@ant-design/icons-svg/inline-svg/outlined/github.svg'; import { ReactComponent as IconGitlab } from '@ant-design/icons-svg/inline-svg/outlined/gitlab.svg'; import { ReactComponent as IconLinkedin } from '@ant-design/icons-svg/inline-svg/outlined/linkedin.svg'; -import { ReactComponent as IconTwitter } from '@ant-design/icons-svg/inline-svg/outlined/twitter.svg'; import { ReactComponent as IconWeiBo } from '@ant-design/icons-svg/inline-svg/outlined/weibo.svg'; +import { ReactComponent as IconX } from '@ant-design/icons-svg/inline-svg/outlined/x.svg'; import { ReactComponent as IconYuque } from '@ant-design/icons-svg/inline-svg/outlined/yuque.svg'; import { ReactComponent as IconZhihu } from '@ant-design/icons-svg/inline-svg/outlined/zhihu.svg'; import React, { FunctionComponent, useMemo, type FC } from 'react'; @@ -24,7 +24,8 @@ export type PresetSocialIcon = { const presetIconMap: Record = { github: IconGitHub, weibo: IconWeiBo, - twitter: IconTwitter, + twitter: IconX, + x: IconX, gitlab: IconGitlab, facebook: IconFacebook, zhihu: IconZhihu,