MCPcopy
hub / github.com/codeaashu/claude-code / ThemePicker

Function ThemePicker

src/components/ThemePicker.tsx:30–328  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

28 onCancel?: () => void;
29};
30export function ThemePicker(t0) {
31 const $ = _c(59);
32 const {
33 onThemeSelect,
34 showIntroText: t1,
35 helpText: t2,
36 showHelpTextBelow: t3,
37 hideEscToCancel: t4,
38 skipExitHandling: t5,
39 onCancel: onCancelProp
40 } = t0;
41 const showIntroText = t1 === undefined ? false : t1;
42 const helpText = t2 === undefined ? "" : t2;
43 const showHelpTextBelow = t3 === undefined ? false : t3;
44 const hideEscToCancel = t4 === undefined ? false : t4;
45 const skipExitHandling = t5 === undefined ? false : t5;
46 const [theme] = useTheme();
47 const themeSetting = useThemeSetting();
48 const {
49 columns
50 } = useTerminalSize();
51 let t6;
52 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
53 t6 = getColorModuleUnavailableReason();
54 $[0] = t6;
55 } else {
56 t6 = $[0];
57 }
58 const colorModuleUnavailableReason = t6;
59 let t7;
60 if ($[1] !== theme) {
61 t7 = colorModuleUnavailableReason === null ? getSyntaxTheme(theme) : null;
62 $[1] = theme;
63 $[2] = t7;
64 } else {
65 t7 = $[2];
66 }
67 const syntaxTheme = t7;
68 const {
69 setPreviewTheme,
70 savePreview,
71 cancelPreview
72 } = usePreviewTheme();
73 const syntaxHighlightingDisabled = useAppState(_temp) ?? false;
74 const setAppState = useSetAppState();
75 useRegisterKeybindingContext("ThemePicker");
76 const syntaxToggleShortcut = useShortcutDisplay("theme:toggleSyntaxHighlighting", "ThemePicker", "ctrl+t");
77 let t8;
78 if ($[3] !== setAppState || $[4] !== syntaxHighlightingDisabled) {
79 t8 = () => {
80 if (colorModuleUnavailableReason === null) {
81 const newValue = !syntaxHighlightingDisabled;
82 updateSettingsForSource("userSettings", {
83 syntaxHighlightingDisabled: newValue
84 });
85 setAppState(prev => ({
86 ...prev,
87 settings: {

Callers

nothing calls this directly

Calls 15

useThemeSettingFunction · 0.85
useTerminalSizeFunction · 0.85
usePreviewThemeFunction · 0.85
useAppStateFunction · 0.85
useSetAppStateFunction · 0.85
useShortcutDisplayFunction · 0.85
updateSettingsForSourceFunction · 0.85
useKeybindingFunction · 0.85
featureFunction · 0.85

Tested by

no test coverage detected