Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit b3ef763

Browse files
committed
chore(support): add zhihu & reddit
1 parent c87633a commit b3ef763

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ next-env.d.ts
66
*.hbs
77
*.svg
88
*.png
9+
*.jpeg
910
*.txt
3.98 KB
Loading
9.32 KB
Loading

src/components/SupportUs/index.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import QRCode from 'qrcode-react'
1010
import type { TMetric } from '@/spec'
1111
import { ICON } from '@/config'
1212
import { METRIC } from '@/constant'
13-
import { openShareWindow } from '@/utils/helper'
13+
import { openShareWindow, Global } from '@/utils/helper'
1414

1515
import { Br } from '@/components/Common'
1616
import Tooltip from '@/components/Tooltip'
@@ -60,6 +60,16 @@ const toPlatform = (type: string): void => {
6060
return openShareWindow('https://shuo.douban.com/!service/share', param)
6161
}
6262

63+
case 'reddit': {
64+
const param = { url, title: `${title}: ${digest}` }
65+
return openShareWindow('http://www.reddit.com/submit', param)
66+
}
67+
68+
case 'zhihu': {
69+
Global.open('https://zhuanlan.zhihu.com/write', '_blank')
70+
return
71+
}
72+
6373
case 'weibo': {
6474
const param = { url, title }
6575
return openShareWindow('https://service.weibo.com/share/share.php', param)
@@ -121,6 +131,14 @@ const SupportUS: FC<TProps> = ({ metric = METRIC.SUPPORT_US }) => {
121131
src={`${ICON}/social/douban-share.png`}
122132
onClick={() => toPlatform('douban')}
123133
/>
134+
<SocialIcon
135+
src={`${ICON}/social/zhihu-share.jpeg`}
136+
onClick={() => toPlatform('zhihu')}
137+
/>
138+
<SocialIcon
139+
src={`${ICON}/social/reddit-share.png`}
140+
onClick={() => toPlatform('reddit')}
141+
/>
124142
<SocialIcon
125143
src={`${ICON}/social/facebook-share.png`}
126144
onClick={() => toPlatform('facebook')}

src/components/SupportUs/styles/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,20 @@ export const MainDesc = styled(Desc)`
5959
export const FocusDesc = styled.div`
6060
color: ${theme('thread.articleTitle')};
6161
text-align: center;
62-
padding-right: 20px;
62+
padding-left: 10px;
6363
font-size: 16px;
6464
line-height: 1.88;
6565
`
6666
export const SocialWrapper = styled.div`
6767
${css.flex('align-center')};
6868
margin-top: 30px;
6969
margin-bottom: 30px;
70-
margin-left: -12px;
70+
margin-left: 15px;
7171
`
7272
export const SocialIcon = styled(Img)`
7373
${css.size(24)};
7474
margin-right: 15px;
75-
filter: saturate(0.4);
75+
filter: saturate(0.6);
7676
7777
&:hover {
7878
filter: saturate(0.9);

0 commit comments

Comments
 (0)