The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { useGT } from "gt-react-native"; |
| 2 | import { |
| 3 | MAX_TERMINAL_FONT_SIZE, |
| 4 | MIN_TERMINAL_FONT_SIZE, |
| 5 | TERMINAL_FONT_SIZE_STEP, |
| 6 | } from "../../../../lib/appearancePreferences"; |
| 7 | import { SettingsSection } from "../../components/SettingsSection"; |
| 8 | import { SettingsSwitchRow } from "../../components/SettingsSwitchRow"; |
| 9 | import { useAppearancePreferences } from "../AppearancePreferencesProvider"; |
| 10 | import { |
| 11 | AppearancePreviewSeparator, |
| 12 | TerminalAppearancePreview, |
| 13 | } from "../components/AppearancePreviews"; |
| 14 | import { FontSizeSliderRow } from "../components/FontSizeSliderRow"; |
| 15 | |
| 16 | export function TerminalAppearanceSection() { |
| 17 | const gt = useGT(); |
| 18 | const { isReady, appearance, setTerminalFontSize } = useAppearancePreferences(); |
| 19 | const custom = appearance.isTerminalFontSizeCustom; |
| 20 | |
| 21 | const handleToggleCustom = (enabled: boolean) => { |
| 22 | setTerminalFontSize(enabled ? appearance.terminalFontSize : null); |
| 23 | }; |
| 24 | |
| 25 | return ( |
| 26 | <SettingsSection title={gt("Terminal", { $context: "settings section for the terminal" })}> |
| 27 | <TerminalAppearancePreview fontSize={appearance.terminalFontSize} /> |
| 28 | <AppearancePreviewSeparator /> |
| 29 | <SettingsSwitchRow |
| 30 | disabled={!isReady} |
| 31 | icon="terminal" |
| 32 | label={gt("Custom font size")} |
| 33 | onValueChange={handleToggleCustom} |
| 34 | value={custom} |
| 35 | /> |
| 36 | {custom ? ( |
| 37 | <FontSizeSliderRow |
| 38 | disabled={!isReady} |
| 39 | icon="textformat.size" |
| 40 | label={gt("Font size")} |
| 41 | max={MAX_TERMINAL_FONT_SIZE} |
| 42 | min={MIN_TERMINAL_FONT_SIZE} |
| 43 | onChange={setTerminalFontSize} |
| 44 | step={TERMINAL_FONT_SIZE_STEP} |
| 45 | value={appearance.terminalFontSize} |
| 46 | valueLabel={gt("{size} pt", { size: appearance.terminalFontSize.toFixed(1) })} |
| 47 | /> |
| 48 | ) : null} |
| 49 | </SettingsSection> |
| 50 | ); |
| 51 | } |