Skip to content

Commit b60a4ef

Browse files
authored
Fix File UI (#3972)
* fix ui * move themeProvider
1 parent 324d1c6 commit b60a4ef

File tree

4 files changed

+21
-105
lines changed

4 files changed

+21
-105
lines changed

packages/app/src/app/components/CodeEditor/VSCode/Configuration/index.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { ConfigurationFile } from '@codesandbox/common/lib/templates/configuration/types';
2+
import { withTheme } from 'styled-components';
3+
import { ThemeProvider } from '@codesandbox/components';
24
import getUI from '@codesandbox/common/lib/templates/configuration/ui';
35
import theme from '@codesandbox/common/lib/theme';
46
import { Module } from '@codesandbox/common/lib/types';
@@ -23,9 +25,10 @@ type Props = EditorProps & {
2325
onChangeVSCode: (val: string) => void;
2426
onDispose: (cb: () => void) => void;
2527
openText: () => void;
28+
theme: any;
2629
};
2730

28-
export class Configuration extends React.PureComponent<Props>
31+
export class ConfigurationComponent extends React.PureComponent<Props>
2932
implements Editor {
3033
disposeInitializer: Function;
3134
currentModule: Module;
@@ -147,13 +150,16 @@ export class Configuration extends React.PureComponent<Props>
147150
More info...
148151
</a>
149152
</Description>
150-
151-
<ConfigWizard
152-
sandbox={sandbox}
153-
updateFile={this.updateFile}
154-
file={this.props.getCode()}
155-
/>
153+
<ThemeProvider theme={this.props.theme.vscodeTheme}>
154+
<ConfigWizard
155+
sandbox={sandbox}
156+
updateFile={this.updateFile}
157+
file={this.props.getCode()}
158+
/>
159+
</ThemeProvider>
156160
</Container>
157161
);
158162
}
159163
}
164+
165+
export const Configuration = withTheme(ConfigurationComponent);

packages/common/src/templates/configuration/elements.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ export const PaddedPreference = (styled(Preference)`
66
width: 100%;
77
padding: 0;
88
font-weight: 400;
9+
10+
span[data-component='SwitchToggle'] {
11+
top: 1px;
12+
}
13+
14+
input[type='checkbox']:focus {
15+
display: none;
16+
}
917
` as unknown) as typeof Preference;
1018

1119
export const PaddedConfig = styled.div`

packages/common/src/templates/configuration/prettierRC/ui.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
32
import {
43
ConfigDescription,
54
PaddedConfig,
@@ -43,7 +42,6 @@ export class ConfigWizard extends React.Component<ConfigurationUIProps> {
4342
if (!parsedFile) {
4443
return <div>Could not parse .prettierrc</div>;
4544
}
46-
4745
return (
4846
<div>
4947
<PaddedConfig>

packages/homepage/src/pages/who-uses-codesandbox.js

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)