Skip to content

Commit c027ec3

Browse files
committed
settings.experimentVSCode is always true
1 parent 96b6747 commit c027ec3

File tree

3 files changed

+14
-161
lines changed

3 files changed

+14
-161
lines changed
Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import themes from '@codesandbox/common/lib/themes';
21
import React, { FunctionComponent } from 'react';
32

43
import { useOvermind } from 'app/overmind';
54

6-
import { PaddedPreference, Rule, SubDescription } from '../../elements';
5+
import { Rule, SubDescription } from '../../elements';
76
import { BigTitle, PreferenceText } from './elements';
87

98
export const EditorTheme: FunctionComponent = () => {
@@ -20,9 +19,8 @@ export const EditorTheme: FunctionComponent = () => {
2019
setValue: value => settingChanged({ name, value }),
2120
value: setUndefined ? settings[name] || undefined : settings[name],
2221
});
23-
const themeNames = themes.map(({ name }) => name);
2422

25-
return settings.experimentVSCode ? (
23+
return (
2624
<div>
2725
<BigTitle>Editor Theme</BigTitle>
2826

@@ -57,38 +55,5 @@ export const EditorTheme: FunctionComponent = () => {
5755
{...bindValue('manualCustomVSCodeTheme', true)}
5856
/>
5957
</div>
60-
) : (
61-
<div>
62-
<BigTitle>Editor Theme</BigTitle>
63-
64-
<PaddedPreference
65-
options={themeNames}
66-
title="VSCode Theme"
67-
type="dropdown"
68-
{...bindValue('editorTheme')}
69-
/>
70-
71-
<SubDescription>
72-
This will be overwritten if you enter a custom theme.
73-
</SubDescription>
74-
75-
<Rule />
76-
77-
<SubDescription style={{ marginBottom: '1rem' }}>
78-
Custom VSCode Theme
79-
</SubDescription>
80-
81-
<PreferenceText
82-
block
83-
isTextArea
84-
placeholder={`You can use your own theme from VSCode directly:
85-
1. Open VSCode
86-
2. Press (CMD or CTRL) + SHIFT + P
87-
3. Enter: '> Developer: Generate Color Scheme From Current Settings'
88-
4. Copy the contents and paste them here!`}
89-
rows={7}
90-
{...bindValue('customVSCodeTheme', true)}
91-
/>
92-
</div>
9358
);
9459
};

packages/app/src/app/pages/common/Modals/PreferencesModal/Appearance/elements.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 12 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,20 @@
11
import React, { FunctionComponent } from 'react';
22

3-
import { useOvermind } from 'app/overmind';
4-
5-
import {
6-
PaddedPreference,
7-
PreferenceContainer,
8-
Rule,
9-
SubContainer,
10-
SubDescription,
11-
Title,
12-
} from '../elements';
3+
import { PreferenceContainer, SubContainer, Title } from '../elements';
134
import VSCodePlaceholder from '../VSCodePlaceholder';
145

156
import { EditorTheme } from './EditorTheme';
16-
import { PreferenceText } from './elements';
17-
18-
export const Appearance: FunctionComponent = () => {
19-
const {
20-
actions: {
21-
preferences: { settingChanged },
22-
},
23-
state: {
24-
preferences: { settings },
25-
},
26-
} = useOvermind();
27-
28-
const bindValue = (name: string) => ({
29-
setValue: value => settingChanged({ name, value }),
30-
value: settings[name],
31-
});
32-
const fontOptions = ['Menlo', 'Dank Mono', 'Source Code Pro'];
33-
34-
return (
35-
<div>
36-
<Title>Appearance</Title>
37-
38-
<SubContainer>
39-
<PreferenceContainer>
40-
<VSCodePlaceholder>
41-
<PaddedPreference
42-
title="Font Size"
43-
type="number"
44-
{...bindValue('fontSize')}
45-
/>
46-
47-
<Rule />
48-
49-
<PaddedPreference
50-
options={['Custom'].concat(fontOptions)}
51-
placeholder="Source Code Pro"
52-
title="Font Family"
53-
type="dropdown"
54-
{...bindValue('fontFamily')}
55-
/>
56-
57-
<SubDescription>
58-
We use{' '}
59-
<a
60-
href="https://dank.sh/affiliate?n=cjgw9wi2q7sf20a86q0k176oj"
61-
rel="noreferrer noopener"
62-
target="_blank"
63-
>
64-
Dank Mono
65-
</a>{' '}
66-
as default font, you can also use locally installed fonts
67-
</SubDescription>
68-
69-
{!fontOptions.includes(settings.fontFamily) && (
70-
<PreferenceText
71-
block
72-
placeholder="Enter your custom font"
73-
{...bindValue('fontFamily')}
74-
/>
75-
)}
76-
77-
<Rule />
78-
79-
<PaddedPreference
80-
title="Font Ligatures"
81-
type="boolean"
82-
{...bindValue('enableLigatures')}
83-
/>
84-
85-
<SubDescription>
86-
Whether we should enable{' '}
87-
<a
88-
href="https://en.wikipedia.org/wiki/Typographic_ligature"
89-
target="_blank"
90-
rel="noopener noreferrer"
91-
>
92-
font ligatures
93-
</a>
94-
.
95-
</SubDescription>
96-
97-
<Rule />
98-
99-
<PaddedPreference
100-
placeholder="1.15"
101-
step="0.05"
102-
title="Line Height"
103-
type="number"
104-
{...bindValue('lineHeight')}
105-
/>
106-
107-
<Rule />
1087

109-
<PaddedPreference
110-
title="Zen Mode"
111-
type="boolean"
112-
{...bindValue('zenMode')}
113-
/>
8+
export const Appearance: FunctionComponent = () => (
9+
<div>
10+
<Title>Appearance</Title>
11411

115-
<SubDescription>
116-
Hide all distracting elements, perfect for lessons and
117-
presentations.
118-
</SubDescription>
119-
</VSCodePlaceholder>
12+
<SubContainer>
13+
<PreferenceContainer>
14+
<VSCodePlaceholder />
12015

121-
<EditorTheme />
122-
</PreferenceContainer>
123-
</SubContainer>
124-
</div>
125-
);
126-
};
16+
<EditorTheme />
17+
</PreferenceContainer>
18+
</SubContainer>
19+
</div>
20+
);

0 commit comments

Comments
 (0)