Skip to content
Source
Sign inSign up

Toolbar.tsx

22 lines766 Bytes

1import { GlassContainer } from "expo-glass-effect";
2import { NativeHeaderToolbar } from "../../native/NativeHeaderToolbar";
3import type { ToolbarProps } from "./Toolbar.types";
4​
5function ToolbarRoot(props: ToolbarProps) {
6 if (props.placement) return <NativeHeaderToolbar {...props} />;
7 return (
8 <GlassContainer style={{ flexDirection: "row", alignItems: "center" }}>
9 {props.children}
10 </GlassContainer>
11 );
13​
14export const Toolbar = Object.assign(ToolbarRoot, {
15 Button: NativeHeaderToolbar.Button,
16 Custom: NativeHeaderToolbar.Custom,
17 Label: NativeHeaderToolbar.Label,
18 Menu: NativeHeaderToolbar.Menu,
19 MenuAction: NativeHeaderToolbar.MenuAction,
20 SearchBarSlot: NativeHeaderToolbar.SearchBarSlot,
21 Spacer: NativeHeaderToolbar.Spacer,
22});