Skip to content

Commit d79f112

Browse files
authored
fix gh crash (codesandbox#3937)
1 parent 301efc5 commit d79f112

File tree

2 files changed

+67
-61
lines changed

2 files changed

+67
-61
lines changed

packages/app/src/app/pages/GitHub/index.tsx

+44-42
Original file line numberDiff line numberDiff line change
@@ -62,56 +62,58 @@ export const GitHub: FunctionComponent = () => {
6262

6363
return (
6464
<MaxWidth>
65-
<Margin vertical={1.5} horizontal={1.5}>
66-
<Container>
67-
<Navigation title="GitHub Import" />
65+
<div style={{ minHeight: '100vh' }}>
66+
<Margin vertical={1.5} horizontal={1.5}>
67+
<Container>
68+
<Navigation title="GitHub Import" />
6869

69-
<Content horizontal vertical>
70-
<Description>
71-
<Title>Import from GitHub</Title>
70+
<Content horizontal vertical>
71+
<Description>
72+
<Title>Import from GitHub</Title>
7273

73-
<SubTitle>
74-
Enter the URL to your GitHub repository to generate a URL to
75-
your sandbox. The sandbox will stay in sync with your
76-
repository.
77-
<br />
78-
<a
79-
href="/docs/importing#import-from-github"
80-
rel="noopener norefereer"
81-
target="_blank"
82-
>
83-
See the docs
84-
</a>
85-
</SubTitle>
86-
</Description>
74+
<SubTitle>
75+
Enter the URL to your GitHub repository to generate a URL to
76+
your sandbox. The sandbox will stay in sync with your
77+
repository.
78+
<br />
79+
<a
80+
href="/docs/importing#import-from-github"
81+
rel="noopener norefereer"
82+
target="_blank"
83+
>
84+
See the docs
85+
</a>
86+
</SubTitle>
87+
</Description>
8788

88-
<Label htmlFor="githuburl">
89-
URL to GitHub Repository (supports branches and paths too)
90-
</Label>
89+
<Label htmlFor="githuburl">
90+
URL to GitHub Repository (supports branches and paths too)
91+
</Label>
9192

92-
<Input
93-
name="githuburl"
94-
onChange={updateUrl}
95-
placeholder="Insert GitHub URL..."
96-
value={url}
97-
/>
93+
<Input
94+
name="githuburl"
95+
onChange={updateUrl}
96+
placeholder="Insert GitHub URL..."
97+
value={url}
98+
/>
9899

99-
{error !== null && <ErrorMessage>{error}</ErrorMessage>}
100+
{error !== null && <ErrorMessage>{error}</ErrorMessage>}
100101

101-
<Label htmlFor="sandboxurl">Converted Sandbox URL</Label>
102+
<Label htmlFor="sandboxurl">Converted Sandbox URL</Label>
102103

103-
<Input
104-
name="sandboxurl"
105-
placeholder="The Sandbox URL"
106-
value={transformedUrl}
107-
/>
104+
<Input
105+
name="sandboxurl"
106+
placeholder="The Sandbox URL"
107+
value={transformedUrl}
108+
/>
108109

109-
<Button disabled={!transformedUrl} to={gitHubToSandboxUrl(url)}>
110-
Open Sandbox
111-
</Button>
112-
</Content>
113-
</Container>
114-
</Margin>
110+
<Button disabled={!transformedUrl} to={gitHubToSandboxUrl(url)}>
111+
Open Sandbox
112+
</Button>
113+
</Content>
114+
</Container>
115+
</Margin>
116+
</div>
115117
</MaxWidth>
116118
);
117119
};

packages/app/src/app/pages/Sandbox/index.tsx

+23-19
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import Padding from '@codesandbox/common/lib/components/spacing/Padding';
55
import { getSandboxName } from '@codesandbox/common/lib/utils/get-sandbox-name';
66
import { Title } from 'app/components/Title';
77
import { useOvermind } from 'app/overmind';
8+
import { ThemeProvider } from '@codesandbox/components';
9+
import codesandboxBlack from '@codesandbox/components/lib/themes/codesandbox-black';
810
import { GithubIntegration } from 'app/pages/common/GithubIntegration';
911
import { Navigation } from 'app/pages/common/Navigation';
1012
import React, { useEffect } from 'react';
@@ -137,26 +139,28 @@ export const Sandbox = React.memo<Props>(
137139

138140
if (content) {
139141
return (
140-
<Fullscreen>
141-
<Padding
142-
style={{
143-
display: 'flex',
144-
flexDirection: 'column',
145-
width: '100vw',
146-
height: '100vh',
147-
}}
148-
margin={1}
149-
>
150-
<Navigation title="Sandbox Editor" />
151-
<Centered
152-
style={{ flex: 1, width: '100%', height: '100%' }}
153-
horizontal
154-
vertical
142+
<ThemeProvider theme={codesandboxBlack}>
143+
<Fullscreen>
144+
<Padding
145+
style={{
146+
display: 'flex',
147+
flexDirection: 'column',
148+
width: '100vw',
149+
height: '100vh',
150+
}}
151+
margin={1}
155152
>
156-
{content}
157-
</Centered>
158-
</Padding>
159-
</Fullscreen>
153+
<Navigation title="Sandbox Editor" />
154+
<Centered
155+
style={{ flex: 1, width: '100%', height: '100%' }}
156+
horizontal
157+
vertical
158+
>
159+
{content}
160+
</Centered>
161+
</Padding>
162+
</Fullscreen>
163+
</ThemeProvider>
160164
);
161165
}
162166

0 commit comments

Comments
 (0)