5
5
*/
6
6
7
7
import { FC , memo } from 'react'
8
+ import QRCode from 'qrcode-react'
8
9
9
10
import type { TMetric } from '@/spec'
11
+ import { ICON } from '@/config'
10
12
import { METRIC } from '@/constant'
13
+ import { openShareWindow } from '@/utils/helper'
14
+
11
15
import { Br } from '@/components/Common'
16
+ import Tooltip from '@/components/Tooltip'
12
17
import ArrowLink from '@/components/Buttons/ArrowLink'
13
18
14
19
import Blocks from './Blocks'
15
20
16
21
import {
17
22
Wrapper ,
18
23
InnerWrapper ,
24
+ SupportLogo ,
19
25
Title ,
20
26
Divider ,
21
27
Desc ,
22
28
FocusDesc ,
29
+ SocialWrapper ,
30
+ SocialIcon ,
23
31
} from './styles'
24
32
33
+ const url = 'https://coderplanets.com'
34
+
35
+ const toPlatform = ( type :string ) :void => {
36
+ const title = 'CoderPlanets'
37
+ const digest = '可能是最性感的开发者社区'
38
+
39
+ switch ( type ) {
40
+ case 'twitter' :{
41
+ const param = { url, text :title }
42
+
43
+ return openShareWindow ( 'https://twitter.com/intent/tweet' , param )
44
+ }
45
+
46
+ case 'telegram' :{
47
+ const param = { url, text :title }
48
+
49
+ return openShareWindow ( 'https://telegram.me/share/url' , param )
50
+ }
51
+
52
+ case 'facebook' :{
53
+ const param = { u :url }
54
+ return openShareWindow ( 'https://facebook.com/share.php' , param )
55
+ }
56
+
57
+ case 'douban' :{
58
+ const param = { href :url , name :title }
59
+ return openShareWindow ( 'https://shuo.douban.com/!service/share' , param )
60
+ }
61
+
62
+ case 'weibo' :{
63
+ const param = { url, title}
64
+ return openShareWindow ( 'https://service.weibo.com/share/share.php' , param )
65
+ }
66
+
67
+ default :{
68
+ /* eslint-disable-next-line */
69
+ return
70
+ }
71
+ }
72
+ }
73
+
25
74
type TProps = {
26
75
metric ?:TMetric
27
76
}
@@ -30,11 +79,14 @@ const SupportUS: FC<TProps> = ({ metric = METRIC.SUPPORT_US }) => {
30
79
return (
31
80
< Wrapper testid = "support-us-content" >
32
81
< InnerWrapper metric = { metric } >
33
- < Title > 支持我们</ Title >
82
+ < Title >
83
+ < SupportLogo src = { `${ ICON } /menu/lifebuoy.png` } noLazy />
84
+ 支持我们
85
+ </ Title >
34
86
< Divider />
35
87
< Desc align >
36
88
{ /* eslint-disable-next-line */ }
37
- 编写一个功能完善的现代社区需要开发者保持长期的专注和付出,论坛的持续打磨和维护,更需要团队投入海量的精力,矛盾的是,现阶段因为缺乏流量等各种资源,难以通过自身造血实现正向循环。你的支持将有助于我们保持独立,在论坛的开发和维护上投入更多时间 。
89
+ 编写一个功能完善的现代社区需要开发者保持长期的专注和付出,论坛的持续打磨和维护,更需要团队投入海量的精力,矛盾的是,现阶段因为缺乏流量等各种资源,难以通过自身造血实现正向循环。你的支持将有助于我们保持独立,在论坛的开发和运营上倾注更多时间 。
38
90
</ Desc >
39
91
< Br top = { 80 } />
40
92
< Blocks />
@@ -45,9 +97,35 @@ const SupportUS: FC<TProps> = ({ metric = METRIC.SUPPORT_US }) => {
45
97
</ Desc >
46
98
< Br top = { 20 } />
47
99
< Desc >
48
- 最后,如果你喜欢这里,还请高抬贵指将本社区转发给你身边的开发者朋友、氛围良好的交流群中,
49
- < FocusDesc > Don’t tell me , tell the world ~</ FocusDesc >
100
+ 最后,如果你喜欢这里,还请高抬贵指将本社区转发给你身边的开发者朋友,以及各种社交媒体平台:
50
101
</ Desc >
102
+ < SocialWrapper >
103
+ < Tooltip content = { < QRCode value = { url } size = { 100 } /> } placement = "top" >
104
+ < SocialIcon src = { `${ ICON } /social/wechat-share.png` } />
105
+ </ Tooltip >
106
+
107
+ < SocialIcon
108
+ src = { `${ ICON } /social/twitter-share.png` }
109
+ onClick = { ( ) => toPlatform ( 'twitter' ) }
110
+ />
111
+ < SocialIcon
112
+ src = { `${ ICON } /social/telegram-share.png` }
113
+ onClick = { ( ) => toPlatform ( 'telegram' ) }
114
+ />
115
+ < SocialIcon
116
+ src = { `${ ICON } /social/weibo-share.png` }
117
+ onClick = { ( ) => toPlatform ( 'weibo' ) }
118
+ />
119
+ < SocialIcon
120
+ src = { `${ ICON } /social/douban-share.png` }
121
+ onClick = { ( ) => toPlatform ( 'douban' ) }
122
+ />
123
+ < SocialIcon
124
+ src = { `${ ICON } /social/facebook-share.png` }
125
+ onClick = { ( ) => toPlatform ( 'facebook' ) }
126
+ />
127
+ </ SocialWrapper >
128
+ < FocusDesc > Don’t tell me , tell the world ~</ FocusDesc >
51
129
</ InnerWrapper >
52
130
</ Wrapper >
53
131
)