header rekated fixes
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
/**
|
||||
* Page Context - Shares current page info with header
|
||||
* Allows pages to set title, breadcrumb, badge for display in AppHeader
|
||||
* Allows pages to set title, parent module, badge for display in AppHeader
|
||||
*/
|
||||
import React, { createContext, useContext, useState, ReactNode } from 'react';
|
||||
|
||||
interface PageInfo {
|
||||
title: string;
|
||||
breadcrumb?: string;
|
||||
parent?: string; // Parent module name (e.g., "Planner", "Writer")
|
||||
badge?: {
|
||||
icon: ReactNode;
|
||||
color: 'blue' | 'green' | 'purple' | 'orange' | 'red' | 'indigo';
|
||||
color: 'blue' | 'green' | 'purple' | 'orange' | 'red' | 'indigo' | 'yellow' | 'pink' | 'emerald' | 'cyan' | 'amber' | 'teal';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -44,5 +44,5 @@ export function usePage(info: PageInfo) {
|
||||
React.useEffect(() => {
|
||||
setPageInfo(info);
|
||||
return () => setPageInfo(null);
|
||||
}, [info.title, info.breadcrumb]);
|
||||
}, [info.title, info.parent]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user