Skip to content

Commit 8bc3bca

Browse files
SaraVieiraCompuIves
authored andcommitted
mobile fixes (codesandbox#1168)
1 parent 102abcf commit 8bc3bca

File tree

16 files changed

+149
-41
lines changed

16 files changed

+149
-41
lines changed

packages/app/src/app/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<head>
55
<meta charset="utf-8">
6-
<!--<meta name="viewport" content="width=device-width, initial-scale=1">-->
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta property="og:type" content="website">
88
<meta property="og:author" content='https://ivesvh.com'>
99
<meta property="og:title" content="CodeSandbox">
@@ -83,4 +83,4 @@
8383
</div>
8484
</body>
8585

86-
</html>
86+
</html>

packages/app/src/app/pages/Dashboard/Content/CreateNewSandbox/Modal/Template/elements.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@ export const Container = styled.div`
66
padding: 1em;
77
color: white;
88
9-
width: ${props => props.width}px;
9+
width: 100%;
1010
border: 2px solid rgba(0, 0, 0, 0.3);
1111
background-color: rgba(0, 0, 0, 0.2);
1212
border-radius: 4px;
1313
display: flex;
1414
align-items: center;
1515
margin-bottom: 1em;
16-
margin-right: 1em;
1716
cursor: pointer;
1817
19-
&:last-child {
20-
margin-right: 0;
18+
@media (min-width: 768px) {
19+
width: ${props => props.width}px;
20+
margin-right: 1em;
21+
22+
&:last-child {
23+
margin-right: 0;
24+
}
2125
}
2226
2327
outline: none;

packages/app/src/app/pages/Dashboard/Content/CreateNewSandbox/Modal/elements.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import styled, { css } from 'styled-components';
22
import delayEffect from 'common/utils/animation/delay-effect';
33
import delayOutEffect from 'common/utils/animation/delay-out-effect';
44

5-
export const Container = styled.div`
5+
export const Container = styled.main`
66
transition: 0.3s ease all;
77
background-color: ${props => props.theme.background};
88
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
@@ -51,7 +51,7 @@ export const Title = styled.h2`
5151
font-weight: 600;
5252
text-transform: uppercase;
5353
font-size: 0.875rem;
54-
color: rgba(255, 255, 255, 0.4);
54+
color: rgba(255, 255, 255, 0.5);
5555
margin-bottom: 1rem;
5656
margin-top: 1rem;
5757
@@ -63,26 +63,27 @@ export const Title = styled.h2`
6363
export const Templates = styled.div`
6464
display: flex;
6565
align-items: center;
66+
67+
@media (max-width: 870px) {
68+
flex-wrap: wrap;
69+
}
70+
`;
71+
72+
export const ImportChoices = Templates.extend`
73+
justify-content: space-between;
6674
`;
6775

6876
export const ImportChoice = styled.a`
6977
transition: 0.2s ease color;
7078
font-weight: 300;
7179
color: rgba(255, 255, 255, 0.6);
7280
text-decoration: none;
73-
width: 100%;
7481
font-size: 1.125rem;
82+
margin-top: 0.2rem;
7583
7684
display: flex;
7785
align-items: center;
7886
79-
&:nth-child(2) {
80-
justify-content: center;
81-
}
82-
&:nth-child(3) {
83-
justify-content: flex-end;
84-
}
85-
8687
svg {
8788
margin-right: 0.5rem;
8889
}

packages/app/src/app/pages/Dashboard/Content/CreateNewSandbox/Modal/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
Templates,
1313
Title,
1414
ImportChoice,
15+
ImportChoices,
1516
} from './elements';
1617
import Template from './Template';
1718

@@ -106,7 +107,7 @@ export default class Modal extends React.PureComponent {
106107
</Templates>
107108
))}
108109

109-
<Templates style={{ marginTop: '1.5rem' }}>
110+
<ImportChoices style={{ marginTop: '1.5rem' }}>
110111
<ImportChoice
111112
href="/docs/importing#import-from-github"
112113
target="_blank"
@@ -122,7 +123,7 @@ export default class Modal extends React.PureComponent {
122123
<ImportChoice href="/docs/importing#define-api" target="_blank">
123124
<UploadIcon /> Create with API
124125
</ImportChoice>
125-
</Templates>
126+
</ImportChoices>
126127
</InnerContainer>
127128
</Container>
128129
);

packages/app/src/app/pages/Dashboard/Content/SandboxGrid/elements.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ export const Content = styled.div`
2121
height: calc(100% - 23px);
2222
padding-top: 2rem;
2323
box-sizing: border-box;
24+
25+
@media (max-width: 768px) {
26+
width: calc(100% - 30px);
27+
margin-left: 30px;
28+
}
2429
`;

packages/app/src/app/pages/Dashboard/Content/Sandboxes/Filters/elements.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ export const Container = styled.div`
77
bottom: 0;
88
display: flex;
99
align-items: center;
10+
11+
@media (max-width: 1000px) {
12+
position: relative;
13+
right: 0;
14+
margin-top: 1rem;
15+
}
1016
`;

packages/app/src/app/pages/Dashboard/Content/Sandboxes/index.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import DelayedAnimation from 'app/components/DelayedAnimation';
44
import SandboxGrid from '../SandboxGrid';
55
import Filters from './Filters';
66

7-
import { Container, HeaderContainer } from '../elements';
7+
import { Container, HeaderContainer, HeaderTitle } from '../elements';
88

99
// eslint-disable-next-line react/prefer-stateless-function
1010
class Content extends React.Component {
@@ -23,13 +23,7 @@ class Content extends React.Component {
2323
return (
2424
<Container>
2525
<HeaderContainer>
26-
<div
27-
style={{
28-
display: 'flex',
29-
verticalAlign: 'middle',
30-
alignItems: 'center',
31-
}}
32-
>
26+
<HeaderTitle>
3327
{Header}{' '}
3428
{sandboxes &&
3529
!isLoading && (
@@ -44,7 +38,7 @@ class Content extends React.Component {
4438
{sandboxes.length}
4539
</span>
4640
)}
47-
</div>
41+
</HeaderTitle>
4842
<Filters
4943
hideOrder={hideOrder}
5044
hideFilters={hideFilters}

packages/app/src/app/pages/Dashboard/Content/elements.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export const HeaderContainer = styled.div`
1111
position: relative;
1212
font-size: 1.25rem;
1313
color: white;
14+
15+
@media (max-width: 768px) {
16+
margin-left: 1rem;
17+
}
1418
`;
1519

1620
export const Description = styled.p`
@@ -21,4 +25,14 @@ export const Description = styled.p`
2125
props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'};
2226
2327
line-height: 1.6;
28+
29+
@media (max-width: 768px) {
30+
margin-left: 1rem;
31+
}
32+
`;
33+
34+
export const HeaderTitle = styled.div`
35+
display: flex;
36+
vertical-align: middle;
37+
align-items: center;
2438
`;

packages/app/src/app/pages/Dashboard/Content/routes/TeamView/elements.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ export const Section = styled.div`
2020

2121
export const Members = styled.div`
2222
margin-top: 1rem;
23+
24+
@media (max-width: 768px) {
25+
margin-left: 1rem;
26+
}
2327
`;
2428

2529
export const MemberHeader = styled.div`

packages/app/src/app/pages/Dashboard/Sidebar/elements.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,13 @@ export const CategoryHeader = styled.div`
1818
text-decoration: none;
1919
font-weight: 600;
2020
`;
21+
22+
export const SidebarStyled = styled.aside`
23+
width: 275px;
24+
overflow-y: auto;
25+
`;
26+
27+
export const InputWrapper = styled.div`
28+
margin: 0 1rem;
29+
margin-bottom: 1.5rem;
30+
`;

0 commit comments

Comments
 (0)