Open History to see the last commit
1import { requireNativeView } from "expo";
2import type { NativeSyntheticEvent, StyleProp, ViewProps, ViewStyle } from "react-native";
3
4interface NativeHeaderButtonProps extends ViewProps {
5 readonly label: string;
6 readonly systemImage: "gearshape" | "square.and.pencil";
7 readonly onTriggered: (event: NativeSyntheticEvent<Record<string, never>>) => void;
8}
9
10const NativeHeaderButton = requireNativeView<NativeHeaderButtonProps>("T3NativeControls");
11
12export function T3HeaderButton(props: {
13 readonly accessibilityLabel: string;
14 readonly icon: NativeHeaderButtonProps["systemImage"];
15 readonly onPress: () => void;
16 readonly style?: StyleProp<ViewStyle>;
17}) {
18 return (
19 <NativeHeaderButton
20 label={props.accessibilityLabel}
21 onTriggered={props.onPress}
22 style={[{ width: 44, height: 44 }, props.style]}
23 systemImage={props.icon}
24 />
25 );
26}