Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/frontend/account/editor-settings/x11-keyboard.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { useIntl } from "react-intl";67import {8LabeledRow,9Loading,10SelectorInput,11} from "@cocalc/frontend/components";12import { PHYSICAL_KEYBOARDS } from "@cocalc/frontend/frame-editors/x11-editor/xpra/keyboards";1314interface PhysicalKeyboardProps {15physical_keyboard: string;16on_change: (selected: string) => void;17}1819export function EditorSettingsPhysicalKeyboard(20props: PhysicalKeyboardProps,21): JSX.Element {22const intl = useIntl();2324if (props.physical_keyboard === "NO_DATA") {25return <Loading />;26} else {27const label = intl.formatMessage({28id: "account.editor-settings.x11-physical-keyboard.label",29defaultMessage: "Keyboard layout (for X11 Desktop)",30});3132return (33<LabeledRow label={label}>34<SelectorInput35options={PHYSICAL_KEYBOARDS}36selected={props.physical_keyboard}37on_change={props.on_change}38showSearch={true}39/>40</LabeledRow>41);42}43}4445interface KeyboardVariantProps {46keyboard_variant: string;47on_change: (selected: string) => void;48keyboard_variant_options: { value: string; display: string }[];49}5051export function EditorSettingsKeyboardVariant(52props: KeyboardVariantProps,53): JSX.Element {54const intl = useIntl();5556if (props.keyboard_variant === "NO_DATA") {57return <Loading />;58} else {59const label = intl.formatMessage({60id: "account.editor-settings.x11-keyboard-variant.label",61defaultMessage: "Keyboard variant (for X11 Desktop)",62});6364return (65<LabeledRow label={label}>66<SelectorInput67options={props.keyboard_variant_options}68selected={props.keyboard_variant}69on_change={props.on_change}70showSearch={true}71/>72</LabeledRow>73);74}75}767778