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

Commit 5ada01e

Browse files
committed
Merge branch 'media-query' into dev
2 parents 68e6f5d + 0cf04e1 commit 5ada01e

File tree

81 files changed

+662
-66
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+662
-66
lines changed

components/ArticleItemPrefixLabel/styles/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from 'styled-components'
22

3-
import { theme } from 'utils'
3+
import { theme, cs } from 'utils'
44
import PinSVG from 'SvgIcons/PinSVG'
55

66
export const ReadedLabel = styled.div`
@@ -11,6 +11,10 @@ export const ReadedLabel = styled.div`
1111
font-size: 0.9rem;
1212
opacity: 0.9;
1313
font-style: italic;
14+
${cs.media.mobile`
15+
left: -12px;
16+
font-size: 0.8rem;
17+
`};
1418
`
1519
export const PinIcon = styled(PinSVG)`
1620
fill: ${theme('thread.articleDigest')};
@@ -19,4 +23,9 @@ export const PinIcon = styled(PinSVG)`
1923
height: 22px;
2024
top: ${({ topoffset }) => topoffset};
2125
left: -22px;
26+
${cs.media.mobile`
27+
width: 18px;
28+
height: 18px;
29+
left: -12px;
30+
`};
2231
`

components/AvatarsRow/index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ import { Tooltip } from 'antd'
1212
import { ATATARS_LIST_LENGTH } from 'config/general'
1313

1414
import { makeDebugger, prettyNum } from 'utils'
15-
import { Wrapper, AvatarsItem, AvatarsImg, AvatarsMore } from './styles'
15+
import {
16+
Wrapper,
17+
AvatarsItem,
18+
MoreItem,
19+
AvatarsImg,
20+
AvatarsMore,
21+
} from './styles'
1622

1723
/* eslint-disable-next-line */
1824
const debug = makeDebugger('c:AvatarsRow:index')
@@ -43,11 +49,11 @@ const AvatarsRow = ({
4349
{total <= 1 ? (
4450
<span />
4551
) : (
46-
<AvatarsItem onClick={onTotalSelect.bind(this, { users, total })}>
52+
<MoreItem onClick={onTotalSelect.bind(this, { users, total })}>
4753
<Tooltip title={`所有评论共 ${total} 条`}>
4854
<AvatarsMore total={total}>{prettyNum(total)}</AvatarsMore>
4955
</Tooltip>
50-
</AvatarsItem>
56+
</MoreItem>
5157
)}
5258

5359
{R.slice(0, limit, sortedUsers).map(user => (

components/AvatarsRow/styles/index.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const Wrapper = styled.ul`
1111
padding: 0px 8px 0px 0px;
1212
`
1313
// height: 49px;
14-
export const AvatarsItem = styled.li`
14+
const BaseAvatarItem = styled.li`
1515
margin: 0px 0px 0px 0px;
1616
padding: 0px 0px 0px 0px;
1717
position: relative;
@@ -25,6 +25,27 @@ export const AvatarsItem = styled.li`
2525
}
2626
transition: all 0.3s;
2727
`
28+
29+
export const AvatarsItem = styled(BaseAvatarItem)`
30+
margin: 0px 0px 0px 0px;
31+
padding: 0px 0px 0px 0px;
32+
position: relative;
33+
width: 25px;
34+
opacity: 0.75;
35+
&:hover {
36+
opacity: 1;
37+
}
38+
${Wrapper}:hover & {
39+
margin-left: 5px;
40+
}
41+
transition: all 0.3s;
42+
${cs.media.mobile`display: none`};
43+
`
44+
45+
export const MoreItem = styled(BaseAvatarItem)`
46+
${cs.media.mobile`display: none`};
47+
`
48+
2849
export const AvatarsImg = styled.img`
2950
border: 2px solid;
3051
border-color: ${theme('thread.commentsUserBorder')};

components/CommunityStatesPad/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import SubscribedTitle from './SubscribedTitle'
1313
import {
1414
Wrapper,
1515
NumberSection,
16+
ContentSection,
17+
EditorSection,
1618
NumberDivider,
1719
NumberTitle,
1820
NumberItem,
@@ -52,17 +54,17 @@ const CommunityStatesPad = ({
5254
</NumberItem>
5355
</NumberSection>
5456
<NumberDivider />
55-
<NumberSection readOnly>
57+
<ContentSection readOnly>
5658
<NumberTitle readOnly>内容</NumberTitle>
5759
<NumberItem readOnly>{prettyNum(contentsCount)}</NumberItem>
58-
</NumberSection>
60+
</ContentSection>
5961
<NumberDivider />
60-
<NumberSection>
62+
<EditorSection>
6163
<NumberTitle readOnly>编辑</NumberTitle>
6264
<NumberItem onClick={onShowEditorList}>
6365
{prettyNum(editorsCount)}
6466
</NumberItem>
65-
</NumberSection>
67+
</EditorSection>
6668
</Wrapper>
6769
)
6870
}

components/CommunityStatesPad/styles/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ export const NumberSection = styled.div`
2020
readOnly ? '' : theme('banner.numberHoverBg')};
2121
}
2222
`
23+
24+
export const ContentSection = styled(NumberSection)`
25+
${cs.media.mobile`display: none`};
26+
`
27+
28+
export const EditorSection = styled(NumberSection)`
29+
${cs.media.mobile`display: none`};
30+
`
31+
2332
// text-decoration: ${({ readOnly }) => (readOnly ? '' : 'underline')};
2433
export const NumberTitle = styled.div`
2534
color: ${theme('banner.numberDesc')};
@@ -49,4 +58,5 @@ export const NumberDivider = styled.div`
4958
align-self: center;
5059
margin-left: 10px;
5160
margin-right: 10px;
61+
${cs.media.mobile`display: none`};
5262
`

components/ContentSourceCard/styles/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ export const Wrapper = styled.div`
1111
background: ${theme('preview.articleBg')};
1212
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
1313
margin-bottom: 15px;
14+
15+
${cs.media.mobile`
16+
width: 50%;
17+
padding: 10px;
18+
`};
1419
`
1520
export const Title = styled.div`
1621
color: ${theme('thread.articleTitle')};
@@ -22,6 +27,11 @@ export const Desc = styled.div`
2227
margin-bottom: 20px;
2328
flex-direction: ${({ column }) => (column ? 'column' : 'row')};
2429
flex-wrap: wrap;
30+
31+
${cs.media.mobile`
32+
margin-top: 6px;
33+
margin-bottom: 10px;
34+
`};
2535
`
2636
export const Didiver = styled.div`
2737
margin-top: 10px;

components/InlineTags/styles/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const Wrapper = styled.div`
1111
export const Tag = styled.div`
1212
${cs.flex('align-center')};
1313
margin-right: 4px;
14+
min-width: 40px;
1415
`
1516
export const Title = styled.div`
1617
color: ${theme('thread.articleTag')};

components/JobItem/CompanyInfo.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
Title,
1414
StatesWrapper,
1515
StateItem,
16+
FinanceState,
1617
} from './styles/company_info'
1718

1819
const CompanyInfo = ({
@@ -28,7 +29,7 @@ const CompanyInfo = ({
2829
<Middle>
2930
<StatesWrapper>
3031
<StateItem>{field} </StateItem>
31-
<StateItem>{finance}</StateItem>
32+
<FinanceState>{finance}</FinanceState>
3233
<StateItem>{scale}</StateItem>
3334
</StatesWrapper>
3435
</Middle>

components/JobItem/JobInfo.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ import {
2121
Exp,
2222
ExpDivider,
2323
Extra,
24+
PublishInfo,
2425
} from './styles/job_info'
2526

2627
const JobInfo = ({
2728
entry: {
2829
author,
2930
insertedAt,
3031
views,
32+
commentsCount,
3133
title,
3234
salary,
3335
education,
@@ -58,14 +60,16 @@ const JobInfo = ({
5860
</Middle>
5961
<Footer onClick={onPreview}>
6062
<Extra>
61-
{author.nickname} <DotDivider />
62-
<TimeAgo datetime={insertedAt} locale="zh_CN" />
63-
<DotDivider />
63+
<PublishInfo>
64+
{author.nickname} <DotDivider />
65+
<TimeAgo datetime={insertedAt} locale="zh_CN" />
66+
<DotDivider />
67+
</PublishInfo>
6468
浏览:
6569
{views}
6670
<DotDivider />
6771
评论:
68-
{views}
72+
{commentsCount}
6973
</Extra>
7074
</Footer>
7175
</Wrapper>

components/JobItem/styles/company_info.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,25 @@ export const Footer = styled.div`
3333
export const Title = styled.div`
3434
color: ${theme('thread.articleTitle')};
3535
font-size: 0.9rem;
36+
${cs.media.mobile`
37+
${cs.truncate('100px')};
38+
`};
3639
`
3740
export const StatesWrapper = styled.div`
3841
${cs.flex()};
3942
color: ${theme('thread.articleDigest')};
4043
`
41-
export const StateItem = styled.div`
44+
const BaseState = styled.div`
4245
border: 1px solid;
4346
border-color: ${theme('thread.articleDigest')};
4447
border-radius: 5px;
4548
font-size: 0.75rem;
4649
padding: 0 5px;
4750
margin-right: 6px;
4851
`
52+
53+
export const StateItem = styled(BaseState)`
54+
${cs.media.mobile`display: none`};
55+
`
56+
57+
export const FinanceState = styled(BaseState)``

0 commit comments

Comments
 (0)