Remove page subtitles from all dashboard pages
Subtitles added noise without value. Stripped subtitle props from all 8 PageHeader calls, removed subtitle display from TopBar, and simplified the PageTitleContext and PageHeader interfaces to title-only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,33 +2,25 @@
|
||||
|
||||
import { createContext, useContext, useState, useCallback, ReactNode } from 'react';
|
||||
|
||||
interface PageTitleState {
|
||||
interface PageTitleContextValue {
|
||||
title: string;
|
||||
subtitle: string;
|
||||
}
|
||||
|
||||
interface PageTitleContextValue extends PageTitleState {
|
||||
setPageTitle: (title: string, subtitle: string) => void;
|
||||
setPageTitle: (title: string) => void;
|
||||
}
|
||||
|
||||
const PageTitleContext = createContext<PageTitleContextValue>({
|
||||
title: '',
|
||||
subtitle: '',
|
||||
setPageTitle: () => {},
|
||||
});
|
||||
|
||||
export function PageTitleProvider({ children }: { children: ReactNode }) {
|
||||
const [state, setState] = useState<PageTitleState>({ title: '', subtitle: '' });
|
||||
const [title, setTitle] = useState('');
|
||||
|
||||
const setPageTitle = useCallback((title: string, subtitle: string) => {
|
||||
setState(prev => {
|
||||
if (prev.title === title && prev.subtitle === subtitle) return prev;
|
||||
return { title, subtitle };
|
||||
});
|
||||
const setPageTitle = useCallback((t: string) => {
|
||||
setTitle(prev => prev === t ? prev : t);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<PageTitleContext.Provider value={{ ...state, setPageTitle }}>
|
||||
<PageTitleContext.Provider value={{ title, setPageTitle }}>
|
||||
{children}
|
||||
</PageTitleContext.Provider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user