-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathSettingsPopup.tsx
More file actions
50 lines (47 loc) · 1.39 KB
/
SettingsPopup.tsx
File metadata and controls
50 lines (47 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { Card, EditableText, Switch, Tooltip } from '@blueprintjs/core';
import { useState } from 'react';
type SettingsPopupProps = {
backend: string;
useCompiled: boolean;
onUseCompiledChange?: (newValue: boolean) => void;
onBackendChange?: (newValue: string) => void;
};
export default function SettingsPopup(props: SettingsPopupProps) {
const [backendText, setBackendText] = useState(props.backend);
return <Card>
<div style={{
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
}}>
<h3>Development Server Settings</h3>
<div style={{
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-between'
}}>
<p>Modules Backend: </p>
<EditableText value={backendText}
alwaysRenderInput
onChange={setBackendText}
onConfirm={v => {
if (props.onBackendChange) props.onBackendChange(v);
}}
onCancel={() => setBackendText(props.backend)}
/>
</div>
<br/>
<Tooltip content="Load compiled assets instead of the raw Typescript">
<Switch
checked={props.useCompiled}
onChange={() => {
if (props.onUseCompiledChange) {
props.onUseCompiledChange(!props.useCompiled);
}
}}
label="Use compiled"
/>
</Tooltip>
</div>
</Card>;
}