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

Commit fd76f2a

Browse files
authored
refactor(help-thread): add FAQ sidebar (#1287)
1 parent 9a4d8df commit fd76f2a

File tree

7 files changed

+132
-4
lines changed

7 files changed

+132
-4
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { FC } from 'react'
2+
3+
import {
4+
Wrapper,
5+
Header,
6+
FAQIcon,
7+
Title,
8+
Section,
9+
Footer,
10+
MoreLink,
11+
} from './styles/sidebar'
12+
13+
const Sidebar: FC = () => {
14+
return (
15+
<Wrapper>
16+
<Header>
17+
<FAQIcon />
18+
<Title>常见问题</Title>
19+
</Header>
20+
<Section>购买标准版或者高级版是否可开具发票?</Section>
21+
<Section>高级版使用过程中如何增加团队人数? </Section>
22+
<Section>小画桌如何保障数据安全? </Section>
23+
<Section>标准版是否可以升级为高级版? </Section>
24+
<Section>小画桌语音是否支持额外购买? </Section>
25+
<Section>是否支持7天无理由退款? </Section>
26+
<Section>
27+
为什么修改了环境变量(或全局变量)值,而引用的地方没有生效?
28+
</Section>
29+
<Footer>
30+
<div>如果还有疑问,请</div>
31+
<MoreLink>告诉我们</MoreLink>
32+
</Footer>
33+
</Wrapper>
34+
)
35+
}
36+
37+
export default Sidebar

src/containers/thread/HelpThread/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { FC } from 'react'
99
import { bond } from '@/utils/mobx'
1010

1111
import type { TStore } from './store'
12+
13+
import Sidebar from './Sidebar'
1214
import Category from './Category'
1315

1416
import { Wrapper, MainWrapper, CatsWapper } from './styles'
@@ -78,6 +80,7 @@ const HelpThreadContainer: FC<TProps> = ({
7880
/>
7981
</CatsWapper>
8082
</MainWrapper>
83+
<Sidebar />
8184
</Wrapper>
8285
)
8386
}

src/containers/thread/HelpThread/styles/category.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const Wrapper = styled.div.attrs(({ testid }: TTestable) => ({
1111
}))<TWrapper>`
1212
${css.flexColumn()};
1313
background: transparent;
14-
width: 33%;
14+
width: 50%;
1515
min-height: 80px;
1616
padding: 15px 20px;
1717
padding-left: 0;
@@ -47,9 +47,8 @@ export const Item = styled.div<{ color: string }>`
4747
4848
transition: all 0.2s;
4949
`
50-
5150
export const MoreLink = styled.div`
52-
color: #175199; // to-theme
51+
color: ${theme('link')};
5352
font-size: 13px;
5453
margin-top: 5px;
5554
margin-left: 24px;

src/containers/thread/HelpThread/styles/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export const MainWrapper = styled.div`
2020
margin-top: 12px;
2121
padding-left: 25px;
2222
padding-right: 80px;
23+
24+
border-right: 1px solid #eae9e9;
2325
`
2426
export const CatsWapper = styled.div`
2527
${css.flex()};
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import styled from 'styled-components'
2+
3+
import type { TTestable } from '@/spec'
4+
5+
import css, { theme } from '@/utils/css'
6+
import FAQSVG from '@/icons/FAQ'
7+
8+
export const Wrapper = styled.div.attrs(({ testid }: TTestable) => ({
9+
'data-test-id': testid,
10+
}))<TTestable>`
11+
${css.flexColumn()};
12+
width: 320px;
13+
min-width: 320px;
14+
color: ${theme('thread.articleDigest')};
15+
padding-top: 25px;
16+
padding-left: 50px;
17+
`
18+
export const Header = styled.div`
19+
${css.flex('align-center')};
20+
margin-bottom: 20px;
21+
`
22+
export const FAQIcon = styled(FAQSVG)`
23+
${css.size(15)};
24+
fill: ${theme('thread.articleDigest')};
25+
margin-right: 10px;
26+
opacity: 0.8;
27+
margin-top: 2px;
28+
`
29+
export const Title = styled.div`
30+
color: ${theme('thread.articleDigest')};
31+
`
32+
export const Section = styled.div`
33+
font-size: 15px;
34+
color: ${theme('thread.articleTitle')};
35+
font-weight: 400;
36+
margin-bottom: 14px;
37+
38+
position: relative;
39+
display: -webkit-box;
40+
-webkit-line-clamp: 2;
41+
overflow: hidden;
42+
text-overflow: ellipsis;
43+
-webkit-box-orient: vertical;
44+
45+
&:hover {
46+
font-weight: 500;
47+
cursor: pointer;
48+
}
49+
transition: all 0.2s;
50+
`
51+
export const Footer = styled.div`
52+
${css.flex('align-center')};
53+
margin-top: 15px;
54+
border-top: 1px solid #eae9e9;
55+
padding-top: 20px;
56+
font-size: 12px;
57+
color: ${theme('thread.articleDigest')};
58+
`
59+
export const MoreLink = styled.div`
60+
color: ${theme('link')};
61+
margin-left: 1px;
62+
63+
&:hover {
64+
cursor: pointer;
65+
}
66+
67+
transition: all 0.2s;
68+
`

src/widgets/Icons/FAQ.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { memo, SVGProps } from 'react'
2+
3+
const FAQ = (props: SVGProps<SVGSVGElement>) => {
4+
return (
5+
<svg
6+
className="icon"
7+
viewBox="0 0 1024 1024"
8+
xmlns="http://www.w3.org/2000/svg"
9+
width={200}
10+
height={200}
11+
{...props}
12+
>
13+
<path d="M721.067 337.067c-25.6 0-42.667 8.533-59.734 25.6-12.8 12.8-21.333 29.866-21.333 59.733 0 25.6 8.533 46.933 21.333 64 12.8 17.067 29.867 25.6 59.734 25.6 17.066 0 29.866-4.267 42.666-12.8-12.8-17.067-25.6-25.6-34.133-38.4l21.333-21.333c12.8 12.8 25.6 25.6 34.134 38.4 8.533-17.067 12.8-29.867 12.8-51.2 0-25.6-4.267-46.934-21.334-68.267-21.333-12.8-34.133-21.333-55.466-21.333zm-234.667 12.8-42.667 102.4H524.8z" />
14+
<path d="M861.867 42.667H162.133c-68.266 0-119.466 51.2-119.466 119.466V691.2c0 68.267 51.2 119.467 119.466 119.467h59.734v170.666L456.533 806.4h409.6c68.267 0 119.467-51.2 119.467-119.467v-524.8c-4.267-68.266-55.467-119.466-123.733-119.466zM366.933 341.333H247.467V409.6h115.2v29.867h-115.2v102.4h-38.4v-230.4h157.866v29.866zm187.734 200.534-25.6-59.734h-98.134l-25.6 59.734H371.2l89.6-230.4h38.4l89.6 230.4h-34.133zm273.066 4.266-25.6 21.334c-8.533-12.8-17.066-25.6-25.6-34.134-17.066 12.8-38.4 17.067-64 17.067-34.133 0-64-12.8-81.066-34.133-21.334-25.6-25.6-51.2-25.6-85.334s8.533-64 25.6-85.333c21.333-25.6 46.933-34.133 81.066-34.133 34.134 0 64 12.8 81.067 34.133 21.333 25.6 25.6 51.2 25.6 85.333s-8.533 64-25.6 85.334c17.067 8.533 25.6 21.333 34.133 29.866z" />
15+
</svg>
16+
)
17+
}
18+
19+
export default memo(FAQ)

utils/themes/skins/github.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const github = {
3939
},
4040

4141
font: fontColor,
42-
link: 'orange',
42+
link: '#175199',
4343
main: '#7DC0C5',
4444
bodyBg: contentBg,
4545
selectionBg: '#FFFEDE',

0 commit comments

Comments
 (0)