CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/account/terminal-settings.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { useIntl } from "react-intl";
7
import { Panel } from "@cocalc/frontend/antd-bootstrap";
8
import { useTypedRedux } from "@cocalc/frontend/app-framework";
9
import {
10
Icon,
11
LabeledRow,
12
Loading,
13
SelectorInput,
14
} from "@cocalc/frontend/components";
15
import { theme_desc } from "@cocalc/frontend/frame-editors/terminal-editor/theme-data";
16
import { set_account_table } from "./util";
17
18
declare global {
19
interface Window {
20
Terminal: any;
21
}
22
}
23
24
export function TerminalSettings() {
25
const intl = useIntl();
26
27
const terminal = useTypedRedux("account", "terminal");
28
29
if (terminal == null) {
30
return <Loading />;
31
}
32
33
const label = intl.formatMessage({
34
id: "account.terminal-settings.label-row.label",
35
defaultMessage: "Terminal color scheme",
36
});
37
38
return (
39
<Panel
40
header={
41
<>
42
<Icon name="terminal" /> Terminal Settings
43
</>
44
}
45
>
46
<LabeledRow label={label}>
47
<SelectorInput
48
selected={terminal?.get("color_scheme")}
49
options={theme_desc}
50
on_change={(color_scheme) =>
51
set_account_table({ terminal: { color_scheme } })
52
}
53
/>
54
</LabeledRow>
55
</Panel>
56
);
57
}
58
59