* Revert "feat: temporary remove dark mode :( (#2168)" This reverts commit 222b4ad897c275dab0eaec3c8a8472bf3df7afc4. * fix: revert darkmode and fix darkmode for import model * fix: prettier format import model --------- Co-authored-by: Louis <louis@jan.ai>
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
import { useEffect, useState } from 'react'
|
|
|
|
import Advanced from '@/screens/Settings/Advanced'
|
|
import AppearanceOptions from '@/screens/Settings/Appearance'
|
|
import ExtensionCatalog from '@/screens/Settings/CoreExtensions'
|
|
|
|
import Models from '@/screens/Settings/Models'
|
|
|
|
import { SUCCESS_SET_NEW_DESTINATION } from './Advanced/DataFolder'
|
|
import SettingMenu from './SettingMenu'
|
|
|
|
const handleShowOptions = (menu: string) => {
|
|
switch (menu) {
|
|
case 'Extensions':
|
|
return <ExtensionCatalog />
|
|
|
|
case 'My Settings':
|
|
return <AppearanceOptions />
|
|
|
|
case 'Advanced Settings':
|
|
return <Advanced />
|
|
|
|
case 'My Models':
|
|
return <Models />
|
|
}
|
|
}
|
|
|
|
const SettingsScreen: React.FC = () => {
|
|
const [activeStaticMenu, setActiveStaticMenu] = useState('My Models')
|
|
|
|
useEffect(() => {
|
|
if (localStorage.getItem(SUCCESS_SET_NEW_DESTINATION) === 'true') {
|
|
setActiveStaticMenu('Advanced Settings')
|
|
localStorage.removeItem(SUCCESS_SET_NEW_DESTINATION)
|
|
}
|
|
}, [])
|
|
|
|
return (
|
|
<div
|
|
className="flex h-full bg-background"
|
|
data-testid="testid-setting-description"
|
|
>
|
|
<SettingMenu
|
|
activeMenu={activeStaticMenu}
|
|
onMenuClick={setActiveStaticMenu}
|
|
/>
|
|
|
|
{handleShowOptions(activeStaticMenu)}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default SettingsScreen
|