@@ -17,7 +17,6 @@ import {
1717import { motion , AnimatePresence } from 'framer-motion' ;
1818import { useTranslation } from 'react-i18next' ;
1919import Button from '../ui/Button' ;
20- import SettingsPanel from './SettingsPanel' ;
2120import { ThemeProps , THEMES , DEFAULT_THEME_ID } from '../../utils/themes' ;
2221import {
2322 AppSettings ,
@@ -33,6 +32,7 @@ import { ImportState, Status } from '../ui/ExportImportProperties';
3332import Text from '../ui/Text' ;
3433import { TextColors , TextVariants , TextWeights } from '../../types/typography' ;
3534import { useLibraryStore } from '../../store/useLibraryStore' ;
35+ import { useUIStore } from '../../store/useUIStore' ;
3636
3737import LibraryGrid from './library/LibraryGrid' ;
3838import { SearchInput , ViewOptionsDropdown } from './library/LibraryHeader' ;
@@ -89,7 +89,7 @@ export interface ColumnWidths {
8989
9090export default function MainLibrary ( props : MainLibraryProps ) {
9191 const { t } = useTranslation ( ) ;
92- const [ showSettings , setShowSettings ] = useState ( false ) ;
92+ const setUI = useUIStore ( ( state ) => state . setUI ) ;
9393 const [ appVersion , setAppVersion ] = useState ( '' ) ;
9494 const [ isUpdateAvailable , setIsUpdateAvailable ] = useState ( false ) ;
9595 const [ latestVersion , setLatestVersion ] = useState ( '' ) ;
@@ -263,16 +263,7 @@ export default function MainLibrary(props: MainLibraryProps) {
263263 </ div >
264264
265265 < div className = "w-full h-full flex flex-col p-8 lg:p-16 overflow-y-auto custom-scrollbar relative z-10" >
266- { showSettings ? (
267- < SettingsPanel
268- appSettings = { props . appSettings }
269- onBack = { ( ) => setShowSettings ( false ) }
270- onLibraryRefresh = { props . onLibraryRefresh }
271- onSettingsChange = { props . onSettingsChange }
272- rootPaths = { props . rootPaths }
273- />
274- ) : (
275- < >
266+ < >
276267 < div className = "my-auto text-left relative z-10" >
277268 < Text variant = { TextVariants . displayLarge } > { t ( 'library.splash.brand' ) } </ Text >
278269 < Text
@@ -320,7 +311,7 @@ export default function MainLibrary(props: MainLibraryProps) {
320311 </ Button >
321312 < Button
322313 className = "px-3 bg-surface text-text-primary shadow-md h-11"
323- onClick = { ( ) => setShowSettings ( true ) }
314+ onClick = { ( ) => setUI ( { isSettingsOpen : true } ) }
324315 size = "lg"
325316 data-tooltip = { t ( 'settings.general.title' ) }
326317 variant = "ghost"
@@ -401,7 +392,6 @@ export default function MainLibrary(props: MainLibraryProps) {
401392 ) }
402393 </ Text >
403394 </ >
404- ) }
405395 </ div >
406396 </ div >
407397 </ div >
0 commit comments