Update AppBar.tsx

This commit is contained in:
Timo K
2026-04-10 18:46:44 +02:00
parent 9905afd2ad
commit c59de789e5

View File

@@ -50,7 +50,9 @@ export const AppBar: FC<Props> = ({ children }) => {
const [title, setTitle] = useState<string>(""); const [title, setTitle] = useState<string>("");
const [hidden, setHidden] = useState<boolean>(false); const [hidden, setHidden] = useState<boolean>(false);
const [secondaryButton, setSecondaryButton] = useState<ReactNode>(null); const [secondaryButton, setSecondaryButton] = useState<ReactNode | null>(
null,
);
const context = useMemo( const context = useMemo(
() => ({ setTitle, setSecondaryButton, setHidden }), () => ({ setTitle, setSecondaryButton, setHidden }),
[setTitle, setHidden, setSecondaryButton], [setTitle, setHidden, setSecondaryButton],
@@ -86,7 +88,7 @@ export const AppBar: FC<Props> = ({ children }) => {
{title} {title}
</Heading> </Heading>
)} )}
<RightNav>{secondaryButton}</RightNav> <RightNav>{secondaryButton ?? "x"}</RightNav>
</Header> </Header>
</div> </div>
<AppBarContext value={context}>{children}</AppBarContext> <AppBarContext value={context}>{children}</AppBarContext>