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.

Commitbfb4336

Browse files
committed
feat(ContentBanner): optional middleinfo & add Job attrs
1 parentef34763 commitbfb4336

File tree

6 files changed

+50
-6
lines changed

6 files changed

+50
-6
lines changed

‎components/AuthorCard/styles/user_info.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ export const Wrapper = styled.div`
99
exportconstAvatar=styled(Img)`
1010
width: 40px;
1111
height: 40px;
12-
border-radius:3px;
12+
border-radius:100%;
1313
display: block;
1414
`
1515
exportconstBrief=styled.div`
1616
display: flex;
1717
flex-direction: column;
18-
margin-left:15px;
18+
margin-left:12px;
1919
`
2020
exportconstNickname=styled.div`
2121
color:${theme('thread.articleTitle')};

‎components/ContentBanner/index.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ import { makeDebugger } from '../../utils'
2828
constdebug=makeDebugger('c:ContentBanner:index')
2929
/* eslint-enable no-unused-vars */
3030

31-
constContentBanner=({ data})=>(
31+
// TODO: add a Loading effect
32+
constContentBanner=({ data, middleNode})=>(
3233
<BannerContainer>
3334
{R.isNil(data.id) ?null :(
3435
<BannerContentWrapper>
3536
<PostBrief>
3637
<Title>{data.title}</Title>
38+
<React.Fragment>
39+
{!R.isEmpty(middleNode) ?<div>{middleNode}</div> :null}
40+
</React.Fragment>
3741
<Desc>
3842
<MarkTag>精华帖</MarkTag>
3943
<TimeAgodatetime={data.insertedAt}locale="zh_CN"/>
@@ -59,6 +63,7 @@ ContentBanner.propTypes = {
5963
viewerHasFavorited:PropTypes.bool,
6064
viewerHasStarred:PropTypes.bool,
6165
}),
66+
middleNode:PropTypes.oneOfType([PropTypes.string,PropTypes.node]),
6267
}
6368

6469
ContentBanner.defaultProps={
@@ -71,6 +76,7 @@ ContentBanner.defaultProps = {
7176
viewerHasFavorited:false,
7277
viewerHasStarred:false,
7378
},
79+
middleNode:'',
7480
}
7581

7682
exportdefaultContentBanner

‎components/ContentBanner/styles/index.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ export const BaseBannerContent = styled.div`
2121
margin-right: 8%;
2222
`
2323
exportconstBannerContainer=styled(BaseBanner)`
24-
height: 100px;
2524
min-height: 100px;
25+
padding-top: 10px;
26+
padding-bottom: 10px;
2627
`
2728
exportconstBannerContentWrapper=styled(BaseBannerContent)`
2829
display: flex;
@@ -35,7 +36,7 @@ export const PostBrief = styled.div`
3536
`
3637

3738
exportconstTitle=styled.div`
38-
font-size: 1.6em;
39+
font-size: 1.5em;
3940
color:${theme('thread.articleTitle')};
4041
width: 100%;
4142
white-space: nowrap;
@@ -46,6 +47,7 @@ export const Desc = styled.div`
4647
display: flex;
4748
align-items: center;
4849
margin-top: 5px;
50+
margin-bottom: 8px;
4951
display: flex;
5052
font-size: 0.9rem;
5153
color:${theme('thread.articleDigest')};

‎containers/JobBanner/MiddleInfo.js‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
importReactfrom'react'
2+
3+
import{DotDivider}from'../../components'
4+
import{Wrapper,Salary,Text}from'./styles/middle_info'
5+
6+
constMiddleInfo=()=>(
7+
<Wrapper>
8+
<Salary>15k-25k</Salary>
9+
<DotDivider/>
10+
<Text>本科</Text>
11+
<DotDivider/>
12+
<Text>经验: 3-5年</Text>
13+
</Wrapper>
14+
)
15+
16+
exportdefaultMiddleInfo

‎containers/JobBanner/index.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import React from 'react'
88
import{inject,observer}from'mobx-react'
99

1010
import{ContentBanner}from'../../components'
11+
importMiddleInfofrom'./MiddleInfo'
1112

1213
import{makeDebugger,storePlug}from'../../utils'
1314
import*aslogicfrom'./logic'
@@ -26,7 +27,7 @@ class JobBannerContainer extends React.Component {
2627
const{ jobBanner}=this.props
2728
const{ viewingJobData}=jobBanner
2829

29-
return<ContentBannerdata={viewingJobData}/>
30+
return<ContentBannerdata={viewingJobData}middleNode={<MiddleInfo/>}/>
3031
}
3132
}
3233

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
importstyledfrom'styled-components'
2+
3+
// import { Img } from '../../../components'
4+
import{theme}from'../../../utils'
5+
6+
exportconstWrapper=styled.div`
7+
display: flex;
8+
align-items: center;
9+
margin-top: 2px;
10+
margin-bottom: 2px;
11+
`
12+
exportconstSalary=styled.div`
13+
color:${theme('contrastFg')};
14+
font-size: 1rem;
15+
`
16+
exportconstText=styled.div`
17+
color:${theme('thread.articleDigest')};
18+
font-size: 1rem;
19+
`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp