Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commitcf9f958

Browse files
committed
chore(support): improve text, styles
1 parent0347182 commitcf9f958

File tree

5 files changed

+137
-45
lines changed

5 files changed

+137
-45
lines changed

‎src/components/SupportUs/index.tsx‎

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,72 @@
55
*/
66

77
import{FC,memo}from'react'
8+
importQRCodefrom'qrcode-react'
89

910
importtype{TMetric}from'@/spec'
11+
import{ICON}from'@/config'
1012
import{METRIC}from'@/constant'
13+
import{openShareWindow}from'@/utils/helper'
14+
1115
import{Br}from'@/components/Common'
16+
importTooltipfrom'@/components/Tooltip'
1217
importArrowLinkfrom'@/components/Buttons/ArrowLink'
1318

1419
importBlocksfrom'./Blocks'
1520

1621
import{
1722
Wrapper,
1823
InnerWrapper,
24+
SupportLogo,
1925
Title,
2026
Divider,
2127
Desc,
2228
FocusDesc,
29+
SocialWrapper,
30+
SocialIcon,
2331
}from'./styles'
2432

33+
consturl='https://coderplanets.com'
34+
35+
consttoPlatform=(type:string):void=>{
36+
consttitle='CoderPlanets'
37+
constdigest='可能是最性感的开发者社区'
38+
39+
switch(type){
40+
case'twitter':{
41+
constparam={ url,text:title}
42+
43+
returnopenShareWindow('https://twitter.com/intent/tweet',param)
44+
}
45+
46+
case'telegram':{
47+
constparam={ url,text:title}
48+
49+
returnopenShareWindow('https://telegram.me/share/url',param)
50+
}
51+
52+
case'facebook':{
53+
constparam={u:url}
54+
returnopenShareWindow('https://facebook.com/share.php',param)
55+
}
56+
57+
case'douban':{
58+
constparam={href:url,name:title}
59+
returnopenShareWindow('https://shuo.douban.com/!service/share',param)
60+
}
61+
62+
case'weibo':{
63+
constparam={ url, title}
64+
returnopenShareWindow('https://service.weibo.com/share/share.php',param)
65+
}
66+
67+
default:{
68+
/* eslint-disable-next-line */
69+
return
70+
}
71+
}
72+
}
73+
2574
typeTProps={
2675
metric?:TMetric
2776
}
@@ -30,11 +79,14 @@ const SupportUS: FC<TProps> = ({ metric = METRIC.SUPPORT_US }) => {
3079
return(
3180
<Wrappertestid="support-us-content">
3281
<InnerWrappermetric={metric}>
33-
<Title>支持我们</Title>
82+
<Title>
83+
<SupportLogosrc={`${ICON}/menu/lifebuoy.png`}noLazy/>
84+
支持我们
85+
</Title>
3486
<Divider/>
3587
<Descalign>
3688
{/* eslint-disable-next-line */}
37-
编写一个功能完善的现代社区需要开发者保持长期的专注和付出,论坛的持续打磨和维护,更需要团队投入海量的精力,矛盾的是,现阶段因为缺乏流量等各种资源,难以通过自身造血实现正向循环。你的支持将有助于我们保持独立,在论坛的开发和维护上投入更多时间
89+
编写一个功能完善的现代社区需要开发者保持长期的专注和付出,论坛的持续打磨和维护,更需要团队投入海量的精力,矛盾的是,现阶段因为缺乏流量等各种资源,难以通过自身造血实现正向循环。你的支持将有助于我们保持独立,在论坛的开发和运营上倾注更多时间
3890
</Desc>
3991
<Brtop={80}/>
4092
<Blocks/>
@@ -45,9 +97,35 @@ const SupportUS: FC<TProps> = ({ metric = METRIC.SUPPORT_US }) => {
4597
</Desc>
4698
<Brtop={20}/>
4799
<Desc>
48-
最后,如果你喜欢这里,还请高抬贵指将本社区转发给你身边的开发者朋友、氛围良好的交流群中,
49-
<FocusDesc>Don’t tell me , tell the world ~</FocusDesc>
100+
最后,如果你喜欢这里,还请高抬贵指将本社区转发给你身边的开发者朋友,以及各种社交媒体平台:
50101
</Desc>
102+
<SocialWrapper>
103+
<Tooltipcontent={<QRCodevalue={url}size={100}/>}placement="top">
104+
<SocialIconsrc={`${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>
51129
</InnerWrapper>
52130
</Wrapper>
53131
)

‎src/components/SupportUs/styles/index.ts‎

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
importstyledfrom'styled-components'
22

33
importtype{TTestable,TMetric}from'@/spec'
4+
45
import{theme}from'@/utils/themes'
56
importcssfrom'@/utils/css'
7+
importImgfrom'@/Img'
68

79
exportconstWrapper=styled.div.attrs(({ testid}:TTestable)=>({
810
'data-test-id':testid,
@@ -23,13 +25,19 @@ export const ContentWrapper = styled.div`
2325
${css.flexColumnGrow()};
2426
max-width: 100%;
2527
`
28+
exportconstSupportLogo=styled(Img)`
29+
${css.size(28)};
30+
transform: rotate(-12deg);
31+
margin-right: 15px;
32+
`
2633
exportconstTitle=styled.h1`
34+
${css.flex('align-center')};
2735
color:${theme('thread.articleTitle')};
2836
font-size: 24px;
2937
margin-top: 8%;
3038
`
3139
exportconstDivider=styled.div`
32-
width:80px;
40+
width:120px;
3341
height: 1px;
3442
background-color:${theme('thread.articleDigest')};
3543
margin-top: 18px;
@@ -43,24 +51,26 @@ export const Desc = styled.div<{ align?: boolean }>`
4351
width: 67%;
4452
line-height: 1.875;
4553
`
46-
exportconstFocusDesc=styled.span`
54+
exportconstFocusDesc=styled.div`
4755
color:${theme('thread.articleTitle')};
56+
text-align: center;
57+
padding-right: 20px;
4858
font-size: 16px;
4959
line-height: 1.88;
5060
`
51-
exportconstBlocksWrapper=styled.div`
52-
${css.flex('align-both')};
53-
flex-wrap: wrap;
54-
margin-left: 10px;
61+
exportconstSocialWrapper=styled.div`
62+
${css.flex('align-center')};
63+
margin-top: 30px;
64+
margin-bottom: 30px;
65+
margin-left: -15px;
5566
`
56-
exportconstBlock=styled.div`
57-
width: 300px;
58-
height: 150px;
59-
border: 1px solid;
60-
border-color: #004b5e;
61-
margin-right: 20px;
62-
background: #0d3b49;
63-
border-radius: 5px;
64-
margin-bottom: 20px;
65-
padding: 15px;
67+
exportconstSocialIcon=styled(Img)`
68+
${css.size(24)};
69+
margin-right: 15px;
70+
filter: saturate(0.4);
71+
72+
&:hover {
73+
filter: saturate(0.9);
74+
cursor: pointer;
75+
}
6676
`

‎src/containers/thread/ArticlesThread/styles/index.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const MainWrapper = styled.div`
2020
`
2121
exportconstFilterWrapper=styled.div`
2222
${css.flex('align-center')};
23-
margin-bottom:10px;
23+
margin-bottom:3px;
2424
${css.media.mobile`margin-bottom: 4px;`};
25-
margin-left: -5px;
25+
margin-left: -3px;
2626
`

‎src/containers/tool/Share/logic.ts‎

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useEffect } from 'react'
22
// import { } from 'ramda'
33

44
importasyncSuitfrom'@/utils/async'
5+
import{openShareWindow}from'@/utils/helper'
56
import{buildLog}from'@/utils/logger'
67
import{EVENT}from'@/constant'
78
import{SHARE_TYPE}from'./constant'
@@ -21,29 +22,6 @@ let sub$ = null
2122
/* eslint-disable-next-line */
2223
constlog=buildLog('L:Share')
2324

24-
typeTShareParam={
25-
url?:string
26-
title?:string
27-
text?:string
28-
subject?:string
29-
body?:string
30-
u?:string
31-
href?:string
32-
name?:string
33-
}
34-
constopenShareWindow=(platformUrl:string,param:TShareParam):void=>{
35-
constsafeParam=[]
36-
37-
/* eslint-disable */
38-
for(constiinparam){
39-
safeParam.push(`${i}=${encodeURIComponent(param[i]||'')}`)
40-
}
41-
/* eslint-enable */
42-
consttargetUrl=`${platformUrl}?${safeParam.join('&')}`
43-
44-
window.open(targetUrl,'_blank','height=500, width=600')
45-
}
46-
4725
exportconsttoPlatform=(type:string):void=>{
4826
const{ shareData}=store
4927
const{ url, title, digest}=shareData

‎utils/helper.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,29 @@ export const titleCase = (str: string): string => {
358358
returnt.charAt(0).toUpperCase()+t.substr(1).toLowerCase()
359359
})
360360
}
361+
362+
typeTShareParam={
363+
url?:string
364+
title?:string
365+
text?:string
366+
subject?:string
367+
body?:string
368+
u?:string
369+
href?:string
370+
name?:string
371+
}
372+
exportconstopenShareWindow=(
373+
platformUrl:string,
374+
param:TShareParam,
375+
):void=>{
376+
constsafeParam=[]
377+
378+
/* eslint-disable */
379+
for(constiinparam){
380+
safeParam.push(`${i}=${encodeURIComponent(param[i]||'')}`)
381+
}
382+
/* eslint-enable */
383+
consttargetUrl=`${platformUrl}?${safeParam.join('&')}`
384+
385+
Global.open(targetUrl,'_blank','height=500, width=600')
386+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp