mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-31 21:52:54 +00:00
* feat(app): modernize compact headers and sidebar affordances Use a shared island header with quick tab creation and keep sheet footers inside their visible layout. Opt sidebar rows into touch sizing without changing global appearance settings. * test(app): match darker light-theme workspace selection * test(app): align plugin journeys with compact header
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import type { ReactNode } from "react";
|
|
import { StyleSheet } from "react-native-unistyles";
|
|
import { ScreenHeader } from "./screen-header";
|
|
import { ScreenTitle } from "./screen-title";
|
|
import { CompactHeader } from "./compact-header";
|
|
import { SidebarMenuToggle } from "./sidebar-menu-toggle";
|
|
import { useIsCompactFormFactor } from "@/constants/layout";
|
|
|
|
interface MenuHeaderProps {
|
|
title?: string;
|
|
rightContent?: ReactNode;
|
|
borderless?: boolean;
|
|
}
|
|
|
|
export function MenuHeader({ title, rightContent, borderless }: MenuHeaderProps) {
|
|
const isCompact = useIsCompactFormFactor();
|
|
if (isCompact) {
|
|
return <CompactHeader navigation="menu" title={title} actions={rightContent} />;
|
|
}
|
|
return (
|
|
<ScreenHeader
|
|
left={
|
|
<>
|
|
<SidebarMenuToggle />
|
|
{title && <ScreenTitle>{title}</ScreenTitle>}
|
|
</>
|
|
}
|
|
right={rightContent}
|
|
leftStyle={styles.left}
|
|
borderless={borderless}
|
|
/>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create((theme) => ({
|
|
left: {
|
|
gap: theme.spacing[2],
|
|
},
|
|
}));
|