diff --git a/.changeset/wise-mugs-impress.md b/.changeset/wise-mugs-impress.md new file mode 100644 index 000000000..8da69134e --- /dev/null +++ b/.changeset/wise-mugs-impress.md @@ -0,0 +1,5 @@ +--- +'@codeimage/app': patch +--- + +fix: fix set shadow none value diff --git a/apps/codeimage/src/components/PropertyEditor/WindowStyleForm.tsx b/apps/codeimage/src/components/PropertyEditor/WindowStyleForm.tsx index 7ad4df546..2af47d8de 100644 --- a/apps/codeimage/src/components/PropertyEditor/WindowStyleForm.tsx +++ b/apps/codeimage/src/components/PropertyEditor/WindowStyleForm.tsx @@ -1,7 +1,7 @@ import {useI18n} from '@codeimage/locale'; import {getTerminalState} from '@codeimage/store/editor/terminal'; import {Box, Group, RadioBlock, SegmentedField, Select} from '@codeimage/ui'; -import {shadowsLabel, TERMINAL_SHADOWS} from '@core/configuration/shadow'; +import {shadowsLabel} from '@core/configuration/shadow'; import {AVAILABLE_TERMINAL_THEMES} from '@core/configuration/terminal-themes'; import {useModality} from '@core/hooks/isMobile'; import {SkeletonLine} from '@ui/Skeleton/Skeleton'; @@ -154,8 +154,8 @@ export const WindowStyleForm: ParentComponent = () => { value={terminal.state.shadow} multiple={false} onSelectChange={value => { - const shadowSelected = value ?? TERMINAL_SHADOWS.bottom; - umami.trackEvent(shadowSelected, 'change-shadow'); + const shadowSelected = value; + umami.trackEvent(shadowSelected ?? 'none', 'change-shadow'); terminal.setShadow(shadowSelected); }} /> diff --git a/apps/codeimage/src/state/editor/terminal.ts b/apps/codeimage/src/state/editor/terminal.ts index 7efc3cec9..3acf93ebc 100644 --- a/apps/codeimage/src/state/editor/terminal.ts +++ b/apps/codeimage/src/state/editor/terminal.ts @@ -60,7 +60,7 @@ export function createTerminalState() { return {...state, ...persistedState}; }); }, - setShadow: (shadow: string) => setState('shadow', shadow), + setShadow: (shadow: string | null) => setState('shadow', shadow), setType: (type: string) => setState('type', type), setAccentVisible: (accentVisible: boolean) => setState('accentVisible', accentVisible),