@@ -20,6 +20,9 @@ import {
2020import { createStore , reconcile } from "solid-js/store" ;
2121import themePreviewAuto from "~/assets/theme-previews/auto.jpg" ;
2222import themePreviewDark from "~/assets/theme-previews/dark.jpg" ;
23+ import themePreviewLegacyAuto from "~/assets/theme-previews/legacy-auto.jpg" ;
24+ import themePreviewLegacyDark from "~/assets/theme-previews/legacy-dark.jpg" ;
25+ import themePreviewLegacyLight from "~/assets/theme-previews/legacy-light.jpg" ;
2326import themePreviewLight from "~/assets/theme-previews/light.jpg" ;
2427import { Input } from "~/routes/editor/ui" ;
2528import { authStore , generalSettingsStore } from "~/store" ;
@@ -111,13 +114,35 @@ export default function GeneralSettings() {
111114
112115function AppearanceSection ( props : {
113116 currentTheme : AppTheme ;
117+ newRecordingFlow : boolean ;
114118 onThemeChange : ( theme : AppTheme ) => void ;
115119} ) {
116120 const options = [
117- { id : "system" , name : "System" , preview : themePreviewAuto } ,
118- { id : "light" , name : "Light" , preview : themePreviewLight } ,
119- { id : "dark" , name : "Dark" , preview : themePreviewDark } ,
120- ] satisfies { id : AppTheme ; name : string ; preview : string } [ ] ;
121+ {
122+ id : "system" ,
123+ name : "System" ,
124+ } ,
125+ {
126+ id : "light" ,
127+ name : "Light" ,
128+ } ,
129+ {
130+ id : "dark" ,
131+ name : "Dark" ,
132+ } ,
133+ ] satisfies { id : AppTheme ; name : string } [ ] ;
134+
135+ const previews = createMemo ( ( ) => {
136+ return {
137+ system : props . newRecordingFlow
138+ ? themePreviewAuto
139+ : themePreviewLegacyAuto ,
140+ light : props . newRecordingFlow
141+ ? themePreviewLight
142+ : themePreviewLegacyLight ,
143+ dark : props . newRecordingFlow ? themePreviewDark : themePreviewLegacyDark ,
144+ } ;
145+ } ) ;
121146
122147 return (
123148 < div class = "flex flex-col gap-4" >
@@ -155,11 +180,16 @@ function AppearanceSection(props: {
155180 aria-label = { `Select theme: ${ theme . name } ` }
156181 >
157182 < div class = "flex justify-center items-center w-full h-full" >
158- < img
159- draggable = { false }
160- src = { theme . preview }
161- alt = { `Preview of ${ theme . name } theme` }
162- />
183+ < Show when = { previews ( ) [ theme . id ] } keyed >
184+ { ( preview ) => (
185+ < img
186+ class = "animate-in fade-in duration-300"
187+ draggable = { false }
188+ src = { preview }
189+ alt = { `Preview of ${ theme . name } theme` }
190+ />
191+ ) }
192+ </ Show >
163193 </ div >
164194 </ div >
165195 < span
@@ -376,6 +406,7 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
376406 < div class = "p-4 space-y-6" >
377407 < AppearanceSection
378408 currentTheme = { settings . theme ?? "system" }
409+ newRecordingFlow = { settings . enableNewRecordingFlow }
379410 onThemeChange = { ( newTheme ) => {
380411 setSettings ( "theme" , newTheme ) ;
381412 generalSettingsStore . set ( { theme : newTheme } ) ;
0 commit comments