@@ -6,9 +6,9 @@ import React from 'react'
66import TimeAgo from 'timeago-react'
77
88import { ICON } from '@/config'
9- import { buildLog } from '@/utils'
9+ import { buildLog , uid } from '@/utils'
1010
11- import { Space } from '@/components/Common'
11+ import { Space , SpaceGrow } from '@/components/Common'
1212import IconText from '@/components/IconText'
1313import Tooltip from '@/components/Tooltip'
1414
@@ -19,17 +19,21 @@ import {
1919 Header ,
2020 TeamScale ,
2121 Title ,
22+ ShareIcon ,
2223 Info ,
2324 Sallery ,
2425 Body ,
2526 Footer ,
26- Publisher ,
27- Avatar ,
2827 PublisherInfo ,
2928 AuthorName ,
3029 PublishExtra ,
30+ PublishTime ,
31+ TechstackWrapper ,
32+ TechTitle ,
3133 TechKeywords ,
3234 Keyword ,
35+ ImagesWrapper ,
36+ PreviewImage ,
3337} from './styles/job_card'
3438
3539/* eslint-disable-next-line */
@@ -46,11 +50,12 @@ type TProps = {
4650 title : string
4751 avatar : string
4852 }
53+ images ?: string [ ]
4954 }
5055}
5156
5257const JobCard : React . FC < TProps > = ( {
53- item : { title, body, author, insertedAt, commentsCount } ,
58+ item : { title, body, author, insertedAt, commentsCount, images } ,
5459} ) => {
5560 const fakeCommunity = {
5661 id : '1' ,
@@ -67,39 +72,49 @@ const JobCard: React.FC<TProps> = ({
6772 < Wrapper >
6873 < Header >
6974 < Title > { title } </ Title >
70- < TeamScale > 10~15 人 </ TeamScale >
75+ < ShareIcon src = { ` ${ ICON } /article/share.svg` } / >
7176 </ Header >
7277 < Info >
7378 < Sallery > 成都</ Sallery >
7479 < Sallery > 前端</ Sallery >
7580 < Sallery > 15k-30k</ Sallery >
81+ < SpaceGrow />
82+ < TeamScale > 10~15 人</ TeamScale >
7683 </ Info >
7784 < Body > { body } </ Body >
85+ { images && (
86+ < ImagesWrapper >
87+ { images . map ( ( imageSrc ) => (
88+ < PreviewImage key = { uid . gen ( ) } src = { imageSrc } />
89+ ) ) }
90+ </ ImagesWrapper >
91+ ) }
7892 < Footer >
79- < Publisher >
80- < Avatar src = { author . avatar } />
81- < PublisherInfo >
82- < AuthorName > { author . title } </ AuthorName >
83- < PublishExtra >
84- < IconText iconSrc = { `${ ICON } /edit/publish-pen.svg` } >
85- < TimeAgo datetime = { insertedAt } locale = "zh_CN" />
86- </ IconText >
87- < Space right = { 10 } />
88- < IconText iconSrc = { `${ ICON } /article/comment.svg` } >
89- { commentsCount }
90- </ IconText >
91- </ PublishExtra >
92- </ PublisherInfo >
93- </ Publisher >
94- < TechKeywords >
95- < Tooltip
96- content = { < CommunityCard item = { fakeCommunity } /> }
97- placement = "top"
98- >
99- < Keyword > React</ Keyword >
100- </ Tooltip >
101- < Keyword > TS</ Keyword >
102- </ TechKeywords >
93+ < TechstackWrapper >
94+ < TechTitle > 技术栈</ TechTitle >
95+ < TechKeywords >
96+ < Tooltip
97+ content = { < CommunityCard item = { fakeCommunity } /> }
98+ placement = "top"
99+ >
100+ < Keyword > React</ Keyword >
101+ </ Tooltip >
102+ < Keyword > TS</ Keyword >
103+ </ TechKeywords >
104+ </ TechstackWrapper >
105+
106+ < PublisherInfo >
107+ < AuthorName > { author . title } </ AuthorName >
108+ < PublishExtra >
109+ < PublishTime >
110+ < TimeAgo datetime = { insertedAt } locale = "zh_CN" />
111+ </ PublishTime >
112+ < Space right = { 10 } />
113+ < IconText iconSrc = { `${ ICON } /article/comment.svg` } size = "medium" >
114+ { commentsCount }
115+ </ IconText >
116+ </ PublishExtra >
117+ </ PublisherInfo >
103118 </ Footer >
104119 </ Wrapper >
105120 )
0 commit comments