Skip to content

Commit

Permalink
feat: upgrade twitter social config to x (#2113)
Browse files Browse the repository at this point in the history
* feat: update twitter icon

* feat: update twitter icon

* Update docs/theme/default.md

* feat: optimize code

* Update docs/theme/default.md

* feat: optimize code

* docs: update texts

* docs: update key

---------

Co-authored-by: Peach <scdzwyxst@gmail.com>
  • Loading branch information
kiner-tang and PeachScript committed Jul 29, 2024
1 parent e6ce1bf commit 3d9067b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 20 deletions.
20 changes: 10 additions & 10 deletions docs/theme/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/client/theme-api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export type SocialTypes =
| 'github'
| 'weibo'
| 'twitter'
| 'x'
| 'gitlab'
| 'facebook'
| 'zhihu'
Expand Down
1 change: 1 addition & 0 deletions src/client/theme-default/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/client/theme-default/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "知乎",
Expand Down
5 changes: 3 additions & 2 deletions src/client/theme-default/slots/SocialIcon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -24,7 +24,8 @@ export type PresetSocialIcon = {
const presetIconMap: Record<SocialTypes, FunctionComponent> = {
github: IconGitHub,
weibo: IconWeiBo,
twitter: IconTwitter,
twitter: IconX,
x: IconX,
gitlab: IconGitlab,
facebook: IconFacebook,
zhihu: IconZhihu,
Expand Down

0 comments on commit 3d9067b

Please sign in to comment.