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

Commit 77f379f

Browse files
committed
refactor(media-query): repo page looks right
1 parent 60c853b commit 77f379f

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

containers/RepoContent/index.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,21 @@ import { makeDebugger, storePlug } from 'utils'
1313
import Maybe from 'components/Maybe'
1414
import MarkDownRender from 'components/MarkDownRender'
1515

16+
import ArticleAuthorCard from 'containers/ArticleAuthorCard'
17+
import ContentSourceCard from 'components/ContentSourceCard'
18+
1619
import Comments from '../Comments'
1720
import SideCards from './SideCards'
21+
import RepoStatusCard from './RepoStatusCard'
1822

19-
import { Wrapper, MainWrapper, ArticleWrapper, CommentsWrapper } from './styles'
23+
import {
24+
Wrapper,
25+
MainWrapper,
26+
ArticleWrapper,
27+
CommentsWrapper,
28+
MobileWrapper,
29+
MobileContentCard,
30+
} from './styles'
2031

2132
import * as logic from './logic'
2233

@@ -45,6 +56,17 @@ class RepoContentContainer extends React.Component {
4556
<ArticleWrapper>
4657
<MarkDownRender body={viewingData.readme} />
4758
</ArticleWrapper>
59+
<MobileWrapper>
60+
<RepoStatusCard data={viewingData} />
61+
<MobileContentCard>
62+
<ArticleAuthorCard
63+
user={viewingData.author}
64+
introTitle="发布者"
65+
/>
66+
<ContentSourceCard data={viewingData} />
67+
</MobileContentCard>
68+
</MobileWrapper>
69+
4870
<CommentsWrapper>
4971
<Comments />
5072
</CommentsWrapper>

containers/RepoContent/styles/index.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ export const Wrapper = styled.article`
66
${cs.flex()};
77
padding: 20px;
88
min-height: 300px;
9+
${cs.media.mobile`
10+
padding: 8px 0;
11+
`};
912
`
1013
export const MainWrapper = styled.div`
1114
width: 68%;
1215
margin-left: 2.5rem;
16+
${cs.media.mobile`
17+
width: 100%;
18+
margin-left: 0;
19+
`};
1320
`
1421
/* background: ${theme('preview.articleBg')}; */
1522
export const ArticleWrapper = styled.div`
@@ -21,9 +28,28 @@ export const ArticleWrapper = styled.div`
2128
padding: 35px 40px;
2229
min-height: 60vh;
2330
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
31+
${cs.media.mobile`
32+
padding: 30px 20px;
33+
`};
2434
`
2535

2636
export const CommentsWrapper = styled.div`
2737
margin-top: 30px;
2838
margin: 25px;
39+
${cs.media.mobile`
40+
margin: 10px;
41+
`};
42+
`
43+
44+
export const MobileWrapper = styled.div`
45+
margin-top: 10px;
46+
${cs.flexColumn('align-center')};
47+
display: none;
48+
${cs.media.mobile`
49+
display: flex;
50+
`};
51+
`
52+
export const MobileContentCard = styled.div`
53+
${cs.flex()};
54+
width: 100%;
2955
`

containers/RepoContent/styles/side_cards.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { cs } from 'utils'
55
export const Wrapper = styled.div`
66
${cs.flexColumn()};
77
width: 90%;
8+
${cs.media.mobile`display: none`};
89
`
910
export const ReportWrapper = styled.div`
1011
padding: 0 10px;

0 commit comments

Comments
 (0)