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

Commit c92a789

Browse files
authored
feat(article-footer-log): basic UI & concept (#1324)
* chore: basic UI & concept * chore: fix ci ts error * chore: fix ci ts error
1 parent 886515f commit c92a789

File tree

8 files changed

+116
-5
lines changed

8 files changed

+116
-5
lines changed

src/containers/unit/ArticleFooter/Panel/ActivityInfo/index.tsx

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
import { FC, memo } from 'react'
22

3+
import { Br } from '@/widgets/Common'
4+
35
import ActionItem from './ActionItem'
46

5-
import { Wrapper } from '../../styles/panel/activity_info'
7+
import {
8+
Wrapper,
9+
Item,
10+
EditPenIcon,
11+
UpdateTimeIcon,
12+
CommentIcon,
13+
Highlight,
14+
Label,
15+
Content,
16+
} from '../../styles/panel/activity_info'
617

718
const tmpItems = [
819
{
@@ -25,6 +36,32 @@ const tmpItems = [
2536
const ActivityInfo: FC = () => {
2637
return (
2738
<Wrapper>
39+
<Item>
40+
<EditPenIcon />
41+
<Label>创建时间</Label>
42+
<Content>
43+
<Highlight>mydearxym</Highlight> 创建于 <Highlight>3 天前</Highlight>
44+
</Content>
45+
</Item>
46+
47+
<Item>
48+
<UpdateTimeIcon />
49+
<Label>更新时间</Label>
50+
<Content>
51+
<Highlight>longge</Highlight> 更新于 <Highlight>3 天前</Highlight>
52+
</Content>
53+
</Item>
54+
55+
<Item>
56+
<CommentIcon />
57+
<Label>最后回复</Label>
58+
<Content>
59+
<Highlight>longge2</Highlight> 评论于 <Highlight>10 天前</Highlight>
60+
</Content>
61+
</Item>
62+
63+
<Br top={15} />
64+
2865
{tmpItems.map((item) => (
2966
<ActionItem key={item.id} item={item} />
3067
))}

src/containers/unit/ArticleFooter/styles/panel/activity_info/index.tsx

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,47 @@ import styled from 'styled-components'
33
import type { TActive } from '@/spec'
44
import css, { theme } from '@/utils/css'
55

6+
import EditPenSVG from '@/icons/Calendar'
7+
import CommentSVG from '@/icons/Comment'
8+
import UpdateTimeSVG from '@/icons/UpdateTime'
9+
610
export const Wrapper = styled.div`
7-
${css.flex('align-center')};
11+
${css.flexColumn()};
812
`
913
export const Item = styled.div`
1014
${css.flex('align-center')};
11-
cursor: pointer;
15+
color: ${theme('lightText')};
16+
font-size: 12px;
17+
margin-bottom: 12px;
18+
margin-left: 3px;
19+
`
20+
export const Label = styled.div`
21+
margin-right: 25px;
22+
`
23+
export const EditPenIcon = styled(EditPenSVG)`
24+
${css.size(12)};
25+
fill: ${theme('lightText')};
26+
margin-right: 9px;
27+
`
28+
export const UpdateTimeIcon = styled(UpdateTimeSVG)`
29+
${css.size(13)};
30+
fill: ${theme('lightText')};
31+
margin-right: 9px;
32+
margin-left: -1px;
1233
`
34+
35+
export const CommentIcon = styled(CommentSVG)`
36+
${css.size(10)};
37+
fill: ${theme('lightText')};
38+
margin-right: 10px;
39+
opacity: 0.8;
40+
`
41+
42+
export const Content = styled.div``
43+
export const Highlight = styled.span`
44+
color: ${theme('thread.articleTitle')};
45+
`
46+
1347
export const ReferNum = styled.span`
1448
font-size: 13px;
1549
font-weight: bold;

src/widgets/Icons/Calendar.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { memo, SVGProps } from 'react'
2+
3+
const SVG = (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="M860.48 896c19.488 0 35.488-14.4 35.488-32l-27.84-319.04-29.088 327.36c-.64 8.32-2.56 16.32-5.12 23.68h26.56zm-85.12-29.12 56.608-640c0-20.48-14.368-34.88-32-34.88h-160v29.76c17.632 0 32 15.36 32 32.96 0 17.92-14.368 33.28-32 33.28-35.168 0-64-29.76-64-66.24V192h-192v29.76c17.632 0 32 15.36 32 32.96 0 17.92-14.368 33.28-32 33.28-35.168 0-64-29.76-64-66.24V192H248.64a32 32 0 0 0-32 29.12l-56.64 640c0 20.48 14.4 34.88 32 34.88h551.36c16.608 0 30.4-12.48 32-29.12zM959.68 856c.288 2.56.288 5.12.288 8 0 52.8-44.768 96-99.488 96H192a96.256 96.256 0 0 1-95.68-104.64l56.64-639.68A95.84 95.84 0 0 1 248.64 128h71.328c1.28-35.52 29.44-64 64-64s62.72 28.48 64 64h128c1.28-35.52 29.44-64 64-64s62.72 28.48 64 64h96c.992 0 1.632 0 2.56.32.672-.32.992-.32 1.6-.32 52.192 0 94.752 37.76 99.232 88l56.32 640zM609.984 400a32 32 0 1 1 0 64H348.128a32 32 0 0 1 0-64h261.856zm-60.16 160a32 32 0 1 1 0 64H351.968a32 32 0 0 1 0-64h197.856z" />
14+
</svg>
15+
)
16+
}
17+
18+
export default memo(SVG)

src/widgets/Icons/UpdateTime.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 SVG = (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="M492.308 315.077c-23.631 0-39.385 15.754-39.385 39.385v177.23c0 11.816 7.877 23.631 15.754 31.508l137.846 98.462c15.754 11.815 43.323 7.876 55.139-7.877 11.815-15.754 7.876-43.323-7.877-55.139L531.692 512V354.462c0-23.631-15.754-39.385-39.384-39.385z" />
14+
<path d="M894.03 409.6C838.893 200.862 622.278 74.83 413.539 129.97c-78.769 23.63-141.784 63.015-192.984 118.153l-3.939-55.138c-3.938-19.693-19.692-35.447-43.323-35.447-19.692 3.939-39.384 19.693-35.446 43.324l11.816 126.03c3.938 31.508 27.569 55.139 59.076 55.139H334.77c23.631 0 39.385-15.754 39.385-39.385s-15.754-39.384-39.385-39.384h-59.077c39.385-43.324 90.585-78.77 153.6-94.524 169.354-43.323 342.646 55.139 385.97 224.493 43.323 169.354-55.139 342.646-224.493 385.969-169.354 43.323-342.646-55.138-385.969-224.492-3.938-19.693-27.57-35.446-47.262-27.57-19.692 3.939-35.446 27.57-27.569 47.262 55.139 208.738 271.754 334.77 480.493 279.63C823.138 834.955 949.169 618.339 894.03 409.6z" />
15+
</svg>
16+
)
17+
}
18+
19+
export default memo(SVG)

src/widgets/Icons/Upvote.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { memo, SVGProps } from 'react'
22

3-
const Upvote = (props: SVGProps<SVGSVGElement>) => {
3+
const SVG = (props: SVGProps<SVGSVGElement>) => {
44
return (
55
<svg
66
className="icon"
@@ -15,4 +15,4 @@ const Upvote = (props: SVGProps<SVGSVGElement>) => {
1515
)
1616
}
1717

18-
export default memo(Upvote)
18+
export default memo(SVG)

src/widgets/Input/Textarea.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const Textarea: FC<TProps> = ({
3535
onChange={handleOnChange}
3636
minRows={1}
3737
spellCheck="false"
38+
// @ts-ignore
3839
{...validProps}
3940
/>
4041
)

src/widgets/Input/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ const Input: FC<TProps> = ({
7979
hasPrefix={!nilOrEmpty(prefixIcon)}
8080
hasSuffix={!nilOrEmpty(suffixIcon)}
8181
autoFocus={autoFocus}
82+
// @ts-ignore
8283
{...validProps}
8384
/>
8485
<SuffixWrapper show={!nilOrEmpty(suffixIcon)}>

utils/themes/skins/github.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const github = {
5454
bodyBg: contentBg,
5555
selectionBg: '#FFFEDE',
5656
textBadge: '#f6f6f6',
57+
lightText: '#949494',
5758

5859
gtdBadge: {
5960
feat: '#3871e0',

0 commit comments

Comments
 (0)