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 | BASE_FONT_SIZE_STEP, |
| 4 | MAX_BASE_FONT_SIZE, |
| 5 | MIN_BASE_FONT_SIZE, |
| 6 | } from "../../../../lib/appearancePreferences"; |
| 7 | import { SettingsSection } from "../../components/SettingsSection"; |
| 8 | import { useAppearancePreferences } from "../AppearancePreferencesProvider"; |
| 9 | import { |
| 10 | AppearancePreviewSeparator, |
| 11 | TextAppearancePreview, |
| 12 | } from "../components/AppearancePreviews"; |
| 13 | import { FontSizeSliderRow } from "../components/FontSizeSliderRow"; |
| 14 | import { SettingsSwitchRow } from "../../components/SettingsSwitchRow"; |
| 15 | |
| 16 | export function TextAppearanceSection() { |
| 17 | const gt = useGT(); |
| 18 | const { isReady, appearance, setBaseFontSize, mathRenderingEnabled, setMathRenderingEnabled } = |
| 19 | useAppearancePreferences(); |
| 20 | |
| 21 | return ( |
| 22 | <SettingsSection title={gt("Text", { $context: "settings section for text size" })}> |
| 23 | <TextAppearancePreview fontSize={appearance.baseFontSize} /> |
| 24 | <AppearancePreviewSeparator /> |
| 25 | <FontSizeSliderRow |
| 26 | disabled={!isReady} |
| 27 | icon="textformat.size" |
| 28 | label={gt("Text size")} |
| 29 | max={MAX_BASE_FONT_SIZE} |
| 30 | min={MIN_BASE_FONT_SIZE} |
| 31 | onChange={setBaseFontSize} |
| 32 | step={BASE_FONT_SIZE_STEP} |
| 33 | value={appearance.baseFontSize} |
| 34 | valueLabel={gt("{size} pt", { size: appearance.baseFontSize })} |
| 35 | /> |
| 36 | <SettingsSwitchRow |
| 37 | disabled={!isReady} |
| 38 | icon="plusminus" |
| 39 | label={gt("Render math")} |
| 40 | value={mathRenderingEnabled} |
| 41 | onValueChange={setMathRenderingEnabled} |
| 42 | /> |
| 43 | </SettingsSection> |
| 44 | ); |
| 45 | } |