feat(web): group onebox sidebar navigation
This commit is contained in:
+11
-2
@@ -64,6 +64,7 @@ export interface IAppStoreState {
|
||||
|
||||
export interface IUiState {
|
||||
activeView: string;
|
||||
activeSubview: string | null;
|
||||
autoRefresh: boolean;
|
||||
refreshInterval: number;
|
||||
pendingAppTemplate?: any;
|
||||
@@ -161,6 +162,7 @@ export const uiStatePart = await appState.getStatePart<IUiState>(
|
||||
'ui',
|
||||
{
|
||||
activeView: 'dashboard',
|
||||
activeSubview: null,
|
||||
autoRefresh: true,
|
||||
refreshInterval: 30000,
|
||||
},
|
||||
@@ -1016,10 +1018,17 @@ export const setBackupPasswordAction = settingsStatePart.createAction<{ password
|
||||
// UI Actions
|
||||
// ============================================================================
|
||||
|
||||
export const setActiveViewAction = uiStatePart.createAction<{ view: string }>(
|
||||
export const setActiveViewAction = uiStatePart.createAction<{ view: string; subview?: string | null }>(
|
||||
async (statePartArg, dataArg) => {
|
||||
const normalizedView = dataArg.view.toLowerCase().replace(/\s+/g, '-');
|
||||
return { ...statePartArg.getState(), activeView: normalizedView };
|
||||
const normalizedSubview = dataArg.subview
|
||||
? dataArg.subview.toLowerCase().replace(/\s+/g, '-')
|
||||
: null;
|
||||
return {
|
||||
...statePartArg.getState(),
|
||||
activeView: normalizedView,
|
||||
activeSubview: normalizedSubview,
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user