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

Commit 5b51b57

Browse files
committed
fix(repo-page): content align center
1 parent f20a368 commit 5b51b57

File tree

4 files changed

+30
-27
lines changed

4 files changed

+30
-27
lines changed

containers/RepoContent/index.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ import RepoStatusCard from './RepoStatusCard'
2020

2121
import {
2222
Wrapper,
23+
InnerWrapper,
2324
MainWrapper,
25+
SidebarWrapper,
2426
ArticleWrapper,
2527
CommentsWrapper,
2628
MobileWrapper,
@@ -40,7 +42,7 @@ const RepoContentContainer = ({ repoContent }) => {
4042
return (
4143
<Wrapper>
4244
<Maybe test={viewingData.id}>
43-
<React.Fragment>
45+
<InnerWrapper>
4446
<MainWrapper>
4547
<ArticleWrapper>
4648
<MarkDownRender body={viewingData.readme} />
@@ -60,10 +62,12 @@ const RepoContentContainer = ({ repoContent }) => {
6062
<Comments />
6163
</CommentsWrapper>
6264
</MainWrapper>
63-
<Affix offsetTop={30}>
64-
<SideCards data={viewingData} />
65-
</Affix>
66-
</React.Fragment>
65+
<SidebarWrapper>
66+
<Affix offsetTop={30}>
67+
<SideCards data={viewingData} />
68+
</Affix>
69+
</SidebarWrapper>
70+
</InnerWrapper>
6771
</Maybe>
6872
</Wrapper>
6973
)

containers/RepoContent/styles/index.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,32 @@ import styled from 'styled-components'
33
import { theme, cs } from '@utils'
44

55
export const Wrapper = styled.article`
6-
${cs.flex()};
6+
${cs.flex('justify-center')};
77
padding: 20px;
88
min-height: 300px;
99
${cs.media.tablet`
1010
padding: 8px 0;
1111
`};
1212
`
13+
export const InnerWrapper = styled.div`
14+
${cs.flex()};
15+
width: 100%;
16+
max-width: ${cs.MAX_CONTENT_WIDTH};
17+
padding: 0 6vw;
18+
${cs.media.desktop`
19+
padding: 0 4vw;
20+
`};
21+
`
1322
export const MainWrapper = styled.div`
14-
width: 68%;
15-
margin-left: 2.5rem;
1623
${cs.media.tablet`
1724
width: 100%;
18-
margin-left: 0;
19-
`};
25+
`};
2026
`
27+
export const SidebarWrapper = styled.div``
28+
2129
/* background: ${theme('preview.articleBg')}; */
2230
export const ArticleWrapper = styled.div`
2331
font-size: 1.1rem;
24-
margin-left: 2vw;
2532
margin-right: 1.6vw;
2633
background: ${theme('preview.articleBg')};
2734
border-radius: 5px;
@@ -35,11 +42,12 @@ export const ArticleWrapper = styled.div`
3542
`
3643

3744
export const CommentsWrapper = styled.div`
38-
margin-top: 30px;
39-
margin: 25px;
45+
margin: 30px 0;
46+
margin-right: 25px;
47+
4048
${cs.media.tablet`
41-
margin: 10px;
42-
`};
49+
margin: 10px;
50+
`};
4351
`
4452

4553
export const MobileWrapper = styled.div`

containers/ReposThread/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import Maybe from '@components/Maybe'
2020

2121
import {
2222
Wrapper,
23-
LeftPadding,
24-
RightPadding,
2523
LeftPart,
2624
RightPart,
2725
FilterWrapper,
@@ -62,7 +60,6 @@ const ReposThreadContainer = ({ reposThread }) => {
6260

6361
return (
6462
<Wrapper>
65-
<LeftPadding />
6663
<LeftPart>
6764
<Waypoint onEnter={inAnchor} onLeave={outAnchor} />
6865
<Maybe test={showFilterBar}>
@@ -103,7 +100,6 @@ const ReposThreadContainer = ({ reposThread }) => {
103100
/>
104101
</Affix>
105102
</RightPart>
106-
<RightPadding />
107103
</Wrapper>
108104
)
109105
}

containers/ReposThread/styles/index.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,20 @@ import { cs } from '@utils'
55

66
export const Wrapper = styled.div`
77
${cs.flex()};
8-
max-width: 1400px;
8+
max-width: ${cs.MAX_CONTENT_WIDTH};
99
width: 100%;
1010
`
1111
export const ViewerWrapper = styled.div`
1212
margin-top: -6px;
1313
`
14-
export const LeftPadding = styled.div`
15-
width: 3vw;
16-
`
17-
export const RightPadding = styled.div`
18-
width: 4vw;
19-
`
2014
export const LeftPart = styled.div`
2115
flex-grow: 1;
2216
width: 100%;
2317
`
2418
export const RightPart = styled.div`
25-
width: 20vw;
19+
min-width: 200px;
2620
margin-left: 30px;
21+
padding-top: 5px;
2722
${cs.media.tablet`display: none;`};
2823
`
2924
/* fill: ${theme('shell.searchIcon')}; */

0 commit comments

Comments
 (0)