feat(auth): enhance header links with dynamic navigation and add setLinks method to store
This commit is contained in:
@@ -34,6 +34,7 @@ export type LayoutStore = {
|
||||
};
|
||||
setLoginPageConfig: (config: Partial<LayoutStore['loginPageConfig']>) => void;
|
||||
links: HeaderLink[];
|
||||
setLinks: (links: HeaderLink[]) => void;
|
||||
};
|
||||
type HeaderLink = {
|
||||
title?: string;
|
||||
@@ -41,6 +42,7 @@ type HeaderLink = {
|
||||
description?: string;
|
||||
icon?: React.ReactNode;
|
||||
key?: string;
|
||||
isRoot?: boolean;
|
||||
};
|
||||
|
||||
export const useLayoutStore = create<LayoutStore>((set, get) => ({
|
||||
@@ -100,4 +102,5 @@ export const useLayoutStore = create<LayoutStore>((set, get) => ({
|
||||
loginPageConfig: { ...state.loginPageConfig, ...config },
|
||||
})),
|
||||
links: [{ title: '', href: '/', key: 'home' }],
|
||||
setLinks: (links) => set({ links }),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user