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

Commit d368fe0

Browse files
committed
refactor(media-query): improve multi pages in mobile view
1 parent 43a7eb2 commit d368fe0

File tree

13 files changed

+55
-27
lines changed

13 files changed

+55
-27
lines changed

components/ContentBanner/styles/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ export const BaseBanner = styled.nav`
99
min-height: 140px;
1010
background: ${theme('banner.bg')};
1111
border-bottom: ${theme('banner.spliter')};
12-
@media (max-height: 800px) {
13-
min-height: 130px;
14-
}
12+
13+
${cs.media.mobile`
14+
min-height: 100px;
15+
`};
1516
`
1617
export const BaseBannerContent = styled.div`
1718
${cs.flex()};

components/JobItem/JobInfo.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
TagsWrapper,
2020
Degree,
2121
Exp,
22+
ExpLabel,
2223
ExpDivider,
2324
Extra,
2425
PublishInfo,
@@ -53,7 +54,10 @@ const JobInfo = ({
5354
<Background>
5455
<Degree>{education}</Degree>
5556
<ExpDivider>&</ExpDivider>
56-
<Exp>经验 {exp}</Exp>
57+
<Exp>
58+
<ExpLabel>经验 </ExpLabel>
59+
{exp}
60+
</Exp>
5761
</Background>
5862
<TagsWrapper>
5963
<InlineTags data={tags} />

components/JobItem/styles/job_info.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const Title = styled.div`
3030
font-size: 1rem;
3131
${cs.media.mobile`
3232
${cs.truncate('150px')};
33-
`};
33+
`};
3434
`
3535
export const CommunitiesWrapper = styled.div`
3636
margin-left: 5px;
@@ -57,6 +57,9 @@ export const Background = styled.div`
5757
`
5858
export const Degree = styled.div``
5959
export const Exp = styled.div``
60+
export const ExpLabel = styled.span`
61+
${cs.media.tablet`display: none`};
62+
`
6063

6164
export const Extra = styled.div`
6265
${cs.flex('align-center')};
@@ -72,8 +75,8 @@ export const ExpDivider = styled.div`
7275
export const PublishInfo = styled.div`
7376
${cs.flex('align-center')};
7477
${cs.media.tablet`
75-
display: none;
76-
`};
78+
display: none;
79+
`};
7780
7881
&:hover {
7982
cursor: pointer;

components/RepoItem/Header.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
TagsWrapper,
1818
StatusInfo,
1919
StatusSection,
20+
ForkSection,
2021
StarIcon,
2122
StatusNum,
2223
ForkIcon,
@@ -44,10 +45,10 @@ const Header = ({ entry, onPreview }) => (
4445
<StatusNum>{numberWithCommas(entry.starCount)}</StatusNum>
4546
</StatusSection>
4647
<Space right="3px" />
47-
<StatusSection>
48+
<ForkSection>
4849
<ForkIcon src={`${ICON_CMD}/repo_fork.svg`} />
4950
<StatusNum>{numberWithCommas(entry.forkCount)}</StatusNum>
50-
</StatusSection>
51+
</ForkSection>
5152
</StatusInfo>
5253
</Wrapper>
5354
)

components/RepoItem/styles/footer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ export const Wrapper = styled.div`
1212

1313
export const Contributors = styled.div`
1414
${cs.flexGrow()};
15+
16+
${cs.media.mobile`
17+
max-width: 60%;
18+
${cs.truncate('160px')};
19+
`};
1520
`
1621
export const Builder = styled.div``
1722

components/RepoItem/styles/header.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const RepoName = styled.div`
4343
}
4444
${cs.media.mobile`
4545
${cs.truncate('80px')};
46-
`};
46+
`};
4747
`
4848
export const TagsWrapper = styled.div`
4949
margin-top: 4px;
@@ -57,6 +57,12 @@ export const StatusSection = styled.div`
5757
${cs.flex()};
5858
margin-right: 6px;
5959
`
60+
export const ForkSection = styled(StatusSection)`
61+
${cs.media.mobile`
62+
display: none;
63+
`};
64+
`
65+
6066
export const StatusNum = styled.div`
6167
color: ${theme('thread.articleDigest')};
6268
`

containers/ArticleBanner/JobMiddleInfo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
33

44
import DotDivider from 'components/DotDivider'
55
import CityList from './CityList'
6-
import { Wrapper, Salary, Text } from './styles/job_middle_info'
6+
import { Wrapper, Salary, Text, ExpLabel } from './styles/job_middle_info'
77

88
const JobMiddleInfo = ({ data }) => (
99
<Wrapper>
@@ -12,7 +12,7 @@ const JobMiddleInfo = ({ data }) => (
1212
<Text>{data.education}</Text>
1313
<DotDivider />
1414
<Text>
15-
经验
15+
<ExpLabel>经验 </ExpLabel>
1616
{data.exp}
1717
</Text>
1818
<DotDivider />

containers/ArticleBanner/styles/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ export const Wrapper = styled.nav`
1212
padding-top: 10px;
1313
padding-bottom: 10px;
1414
15-
@media (max-height: 800px) {
16-
min-height: 130px;
17-
}
15+
${cs.media.mobile`
16+
min-height: 100px;
17+
`};
1818
`
1919
export const BannerContent = styled.div`
2020
${cs.flex()};
2121
margin-left: 8%;
2222
margin-right: 8%;
23+
2324
${cs.media.mobile`
2425
margin-left: 4%;
2526
margin-right: 3%;

containers/ArticleBanner/styles/job_middle_info.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ export const Text = styled.div`
1515
color: ${theme('thread.articleDigest')};
1616
font-size: 1rem;
1717
`
18+
19+
export const ExpLabel = styled.span`
20+
${cs.media.tablet`display: none`};
21+
`

containers/JobContent/styles/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export const ArticleWrapper = styled.div`
3131
3232
${cs.media.tablet`
3333
padding: 30px 20px;
34-
`};
34+
min-height: 40vh;
35+
`};
3536
`
3637
export const BodyHeaderWrapper = styled.div`
3738
margin-top: -18px;
@@ -41,16 +42,16 @@ export const CommentsWrapper = styled.div`
4142
margin-top: 30px;
4243
margin: 25px;
4344
${cs.media.tablet`
44-
margin: 10px;
45-
`};
45+
margin: 10px;
46+
`};
4647
`
4748

4849
export const MobileWrapper = styled.div`
4950
margin-top: 10px;
5051
${cs.flexColumn('align-center')};
5152
display: none;
5253
${cs.media.tablet`
53-
${cs.flex()};
54+
${cs.flex()};
5455
`};
5556
`
5657
export const MobileContentCard = styled.div`

0 commit comments

Comments
 (0)