Neue Seite um Betriebe zu überwachen
This commit is contained in:
28
src/App.js
28
src/App.js
@@ -12,6 +12,7 @@ import useStoreSync from './hooks/useStoreSync';
|
||||
import useDirtyNavigationGuard from './hooks/useDirtyNavigationGuard';
|
||||
import useSessionManager from './hooks/useSessionManager';
|
||||
import useAdminSettings from './hooks/useAdminSettings';
|
||||
import useUserPreferences from './hooks/useUserPreferences';
|
||||
import NavigationTabs from './components/NavigationTabs';
|
||||
import LoginView from './components/LoginView';
|
||||
import DashboardView from './components/DashboardView';
|
||||
@@ -116,6 +117,17 @@ function App() {
|
||||
setLoading
|
||||
});
|
||||
|
||||
const {
|
||||
preferences,
|
||||
loading: preferencesLoading,
|
||||
saving: locationSaving,
|
||||
error: preferencesError,
|
||||
updateLocation
|
||||
} = useUserPreferences({
|
||||
authorizedFetch,
|
||||
sessionToken: session?.token
|
||||
});
|
||||
|
||||
const {
|
||||
fetchConfig,
|
||||
syncStoresWithProgress,
|
||||
@@ -667,6 +679,11 @@ function App() {
|
||||
canDelete={Boolean(session?.isAdmin)}
|
||||
focusedStoreId={focusedStoreId}
|
||||
onClearFocus={() => setFocusedStoreId(null)}
|
||||
userLocation={preferences?.location || null}
|
||||
locationLoading={preferencesLoading}
|
||||
locationSaving={locationSaving}
|
||||
locationError={preferencesError}
|
||||
onUpdateLocation={updateLocation}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -696,7 +713,16 @@ function App() {
|
||||
<NavigationTabs isAdmin={session?.isAdmin} onProtectedNavigate={requestNavigation} />
|
||||
<Routes>
|
||||
<Route path="/" element={dashboardContent} />
|
||||
<Route path="/store-watch" element={<StoreWatchPage authorizedFetch={authorizedFetch} knownStores={stores} />} />
|
||||
<Route
|
||||
path="/store-watch"
|
||||
element={
|
||||
<StoreWatchPage
|
||||
authorizedFetch={authorizedFetch}
|
||||
knownStores={stores}
|
||||
userLocation={preferences?.location || null}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<Route path="/admin" element={adminPageContent} />
|
||||
<Route path="*" element={<Navigate to="/" replace />} />
|
||||
</Routes>
|
||||
|
||||
Reference in New Issue
Block a user