Skip to content

Commit 00b0d0b

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch NewSandbox to use useOvermind (codesandbox#3057)
1 parent 27a2305 commit 00b0d0b

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import MaxWidthBase from '@codesandbox/common/lib/components/flex/MaxWidth';
2+
import styled from 'styled-components';
3+
4+
export const MaxWidth = styled(MaxWidthBase)`
5+
height: 100vh;
6+
`;

‎packages/app/src/app/pages/NewSandbox/index.tsx‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
import React, { useEffect } from 'react';
2-
import Media from 'react-media';
31
import Centered from '@codesandbox/common/lib/components/flex/Centered';
4-
import MaxWidth from '@codesandbox/common/lib/components/flex/MaxWidth';
52
import Margin from '@codesandbox/common/lib/components/spacing/Margin';
6-
import { Navigation } from 'app/pages/common/Navigation';
7-
import { useOvermind } from 'app/overmind';
3+
import React, { FunctionComponent, useEffect } from 'react';
4+
import Media from 'react-media';
85

96
import {
107
CreateSandbox,
118
COLUMN_MEDIA_THRESHOLD,
129
} from 'app/components/CreateNewSandbox/CreateSandbox';
10+
import { useOvermind } from 'app/overmind';
11+
import { Navigation } from 'app/pages/common/Navigation';
1312

14-
export const NewSandbox: React.FC = () => {
13+
import {MaxWidth} from './elements'
14+
15+
export const NewSandbox: FunctionComponent = () => {
1516
const {
1617
actions: { sandboxPageMounted },
1718
} = useOvermind();
@@ -21,13 +22,10 @@ export const NewSandbox: React.FC = () => {
2122
}, [sandboxPageMounted]);
2223

2324
return (
24-
<MaxWidth
25-
css={`
26-
height: 100vh;
27-
`}
28-
>
25+
<MaxWidth>
2926
<Margin horizontal={1.5} style={{ height: '100%' }} vertical={1.5}>
3027
<Navigation title="New Sandbox" />
28+
3129
<Margin top={5}>
3230
<Centered horizontal vertical>
3331
<Media query={`(min-width: ${COLUMN_MEDIA_THRESHOLD}px)`}>

0 commit comments

Comments
 (0)