@@ -7,6 +7,7 @@ import { Navigate, Outlet, useLocation, useNavigate } from 'react-router-dom';
77
88import { getActions } from '../../defaults/actions' ;
99import * as classes from '../../main.css' ;
10+ import { useUserSettingsState } from '../../states/SettingsStates' ;
1011import { useUserState } from '../../states/UserState' ;
1112import { Boundary } from '../Boundary' ;
1213import { Footer } from './Footer' ;
@@ -37,6 +38,7 @@ export const [firstStore, firstSpotlight] = createSpotlight();
3738export default function LayoutComponent ( ) {
3839 const navigate = useNavigate ( ) ;
3940 const location = useLocation ( ) ;
41+ const userSettings = useUserSettingsState ( ) ;
4042
4143 const defaultActions = getActions ( navigate ) ;
4244 const [ actions , setActions ] = useState ( defaultActions ) ;
@@ -68,17 +70,19 @@ export default function LayoutComponent() {
6870 </ Container >
6971 < Space h = 'xl' />
7072 < Footer />
71- < Spotlight
72- actions = { actions }
73- store = { firstStore }
74- highlightQuery
75- searchProps = { {
76- leftSection : < IconSearch size = '1.2rem' /> ,
77- placeholder : t `Search...`
78- } }
79- shortcut = { [ 'mod + K' , '/' ] }
80- nothingFound = { t `Nothing found...` }
81- />
73+ { userSettings . isSet ( 'SHOW_SPOTLIGHT' ) && (
74+ < Spotlight
75+ actions = { actions }
76+ store = { firstStore }
77+ highlightQuery
78+ searchProps = { {
79+ leftSection : < IconSearch size = '1.2rem' /> ,
80+ placeholder : t `Search...`
81+ } }
82+ shortcut = { [ 'mod + K' ] }
83+ nothingFound = { t `Nothing found...` }
84+ />
85+ ) }
8286 </ Flex >
8387 </ ProtectedRoute >
8488 ) ;
0 commit comments