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

Commit 7bca17b

Browse files
committed
chore: merge branch 'dev'
2 parents 3091526 + 605aa7a commit 7bca17b

File tree

20 files changed

+1273
-130
lines changed

20 files changed

+1273
-130
lines changed

components/JobItem/DigestView.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ import React from 'react'
33
import JobInfo from './JobInfo'
44
import CompanyInfo from './CompanyInfo'
55

6-
const DigestView = ({ entry, community, onPreview }) => (
6+
const DigestView = ({ entry, community, onPreview, onAuthorSelect }) => (
77
<React.Fragment>
8-
<JobInfo entry={entry} onPreview={onPreview} community={community} />
8+
<JobInfo
9+
entry={entry}
10+
onPreview={onPreview}
11+
onAuthorSelect={onAuthorSelect}
12+
community={community}
13+
/>
914
<CompanyInfo entry={entry} onPreview={onPreview} />
1015
</React.Fragment>
1116
)

components/JobItem/JobInfo.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const JobInfo = ({
3838
communities,
3939
},
4040
onPreview,
41+
onAuthorSelect,
4142
community,
4243
}) => (
4344
<Wrapper>
@@ -58,9 +59,9 @@ const JobInfo = ({
5859
<InlineTags data={tags} />
5960
</TagsWrapper>
6061
</Middle>
61-
<Footer onClick={onPreview}>
62+
<Footer>
6263
<Extra>
63-
<PublishInfo>
64+
<PublishInfo onClick={onAuthorSelect.bind(this, author)}>
6465
{author.nickname} <DotDivider />
6566
<TimeAgo datetime={insertedAt} locale="zh_CN" />
6667
<DotDivider />

components/JobItem/index.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ import { getOpacity } from './helper'
2121
/* eslint-disable-next-line */
2222
const debug = makeDebugger('c:JobItem:index')
2323

24-
const JobItem = ({ entry, active, onPreview, accountInfo, community }) => {
24+
const JobItem = ({
25+
entry,
26+
active,
27+
onPreview,
28+
onAuthorSelect,
29+
accountInfo,
30+
community,
31+
}) => {
2532
const {
2633
customization: { contentsLayout, contentDivider, contentHover },
2734
} = accountInfo
@@ -38,7 +45,12 @@ const JobItem = ({ entry, active, onPreview, accountInfo, community }) => {
3845
topoffset="9px"
3946
/>
4047
{contentsLayout === C11N.DIGEST ? (
41-
<DigestView entry={entry} onPreview={onPreview} community={community} />
48+
<DigestView
49+
entry={entry}
50+
onPreview={onPreview}
51+
onAuthorSelect={onAuthorSelect}
52+
community={community}
53+
/>
4254
) : (
4355
<ListView entry={entry} onPreview={onPreview} />
4456
)}
@@ -84,10 +96,12 @@ JobItem.propTypes = {
8496
}),
8597
community: PropTypes.string.isRequired,
8698
onPreview: PropTypes.func,
99+
onAuthorSelect: PropTypes.func,
87100
}
88101

89102
JobItem.defaultProps = {
90103
onPreview: debug,
104+
onAuthorSelect: debug,
91105
active: {},
92106
accountInfo: {
93107
isLogin: false,

components/JobItem/styles/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export const Wrapper = styled.article`
1818
border-bottom-color: ${theme('thread.articleDivider')};
1919
2020
&:hover {
21-
cursor: pointer;
2221
background: ${({ hover }) => (hover ? theme('thread.articleHover') : '')};
2322
}
2423
`

components/JobItem/styles/job_info.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ export const Wrapper = styled.div`
1010
`
1111
export const Header = styled.div`
1212
${cs.flex('align-center')};
13+
&:hover {
14+
cursor: pointer;
15+
}
1316
`
1417
export const Middle = styled.div`
1518
${cs.flex('align-end')};
1619
padding: 5px 0;
1720
margin-bottom: 2px;
21+
&:hover {
22+
cursor: pointer;
23+
}
1824
`
1925
export const Footer = styled.div`
2026
color: ${theme('thread.articleDigest')};
@@ -64,7 +70,13 @@ export const ExpDivider = styled.div`
6470
`
6571

6672
export const PublishInfo = styled.div`
73+
${cs.flex('align-center')};
6774
${cs.media.tablet`
6875
display: none;
6976
`};
77+
78+
&:hover {
79+
cursor: pointer;
80+
text-decoration: underline;
81+
}
7082
`

components/Modal/styles/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export const Wrapper = styled.div`
3131
mode === 'default' ? theme('modal.border') : theme('baseColor.error')};
3232
animation: ${animate.zoomInRule};
3333
34-
${cs.media.mobile`width: 300px`};
35-
${cs.media.mobile`width: 400px`};
34+
${cs.media.tablet`width: 460px`};
35+
${cs.media.mobile`width: 320px`};
3636
`
3737
export const ChildrenWrapper = styled.div`
3838
min-height: 320px;

components/PagedContents/JobsList.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const JobsList = ({ props }) => {
1717
thread,
1818
emptyPrefix,
1919
onPreview,
20+
onAuthorSelect,
2021
accountInfo,
2122
} = props
2223

@@ -32,6 +33,7 @@ const JobsList = ({ props }) => {
3233
active={active}
3334
accountInfo={accountInfo}
3435
onPreview={onPreview.bind(this, entry)}
36+
onAuthorSelect={onAuthorSelect}
3537
/>
3638
))}
3739
</React.Fragment>

components/PagedContents/PostsList.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const PostsList = ({ props }) => {
1919
emptyPrefix,
2020
onPreview,
2121
onUserSelect,
22+
onAuthorSelect,
2223
accountInfo,
2324
} = props
2425

@@ -34,6 +35,7 @@ const PostsList = ({ props }) => {
3435
active={active}
3536
accountInfo={accountInfo}
3637
onUserSelect={onUserSelect}
38+
onAuthorSelect={onAuthorSelect}
3739
onPreview={onPreview.bind(this, entry)}
3840
/>
3941
))}

components/PagedContents/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const PagedContents = ({
2323
onPageChange,
2424
onPreview,
2525
onUserSelect,
26+
onAuthorSelect,
2627
emptyPrefix,
2728
community,
2829
accountInfo,
@@ -38,6 +39,7 @@ const PagedContents = ({
3839
community={community}
3940
onPreview={onPreview}
4041
onUserSelect={onUserSelect}
42+
onAuthorSelect={onAuthorSelect}
4143
accountInfo={accountInfo}
4244
/>
4345

@@ -73,6 +75,7 @@ PagedContents.propTypes = {
7375
onPageChange: PropTypes.func,
7476
onPreview: PropTypes.func,
7577
onUserSelect: PropTypes.func,
78+
onAuthorSelect: PropTypes.func,
7679
accountInfo: PropTypes.shape({
7780
isLogin: PropTypes.bool,
7881
customization: PropTypes.shape({
@@ -93,6 +96,7 @@ PagedContents.defaultProps = {
9396
onPageChange: debug,
9497
onPreview: debug,
9598
onUserSelect: debug,
99+
onAuthorSelect: debug,
96100
accountInfo: {
97101
isLogin: false,
98102
customization: PropTypes.shape({

components/PostItem/DigestView.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import AvatarsRow from 'components/AvatarsRow'
88
import InlineTags from 'components/InlineTags'
99

1010
import {
11+
AvatarWrapper,
1112
Avatar,
1213
TitleLink,
1314
LinkIcon,
@@ -25,10 +26,18 @@ import {
2526

2627
// import { Wrapper } from './styles'
2728

28-
const DigestView = ({ entry, cover, onPreview, onUserSelect }) => (
29+
const DigestView = ({
30+
entry,
31+
cover,
32+
onPreview,
33+
onUserSelect,
34+
onAuthorSelect,
35+
}) => (
2936
<React.Fragment>
3037
{cover === 'avatar' ? (
31-
<Avatar src={entry.author.avatar} />
38+
<AvatarWrapper onClick={onAuthorSelect.bind(this, entry.author)}>
39+
<Avatar src={entry.author.avatar} />
40+
</AvatarWrapper>
3241
) : (
3342
<Avatar
3443
src={entry.linkIcon || `${ICON_BASE}/radar_source/default_radar.svg`}

0 commit comments

Comments
 (0)