Co-authored-by: Horus Lugo <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]> Co-authored-by: maria-rcks <[email protected]> Co-authored-by: Shivam Sharma <[email protected]> Co-authored-by: Ben Davis <[email protected]> Co-authored-by: Alex <[email protected]> Co-authored-by: codex <[email protected]> Co-authored-by: Julius Marminge <[email protected]>
27 lines
876 B
TypeScript
27 lines
876 B
TypeScript
import { requireNativeView } from "expo";
|
|
import type { NativeSyntheticEvent, StyleProp, ViewProps, ViewStyle } from "react-native";
|
|
|
|
interface NativeHeaderButtonProps extends ViewProps {
|
|
readonly label: string;
|
|
readonly systemImage: "gearshape" | "square.and.pencil";
|
|
readonly onTriggered: (event: NativeSyntheticEvent<Record<string, never>>) => void;
|
|
}
|
|
|
|
const NativeHeaderButton = requireNativeView<NativeHeaderButtonProps>("T3NativeControls");
|
|
|
|
export function T3HeaderButton(props: {
|
|
readonly accessibilityLabel: string;
|
|
readonly icon: NativeHeaderButtonProps["systemImage"];
|
|
readonly onPress: () => void;
|
|
readonly style?: StyleProp<ViewStyle>;
|
|
}) {
|
|
return (
|
|
<NativeHeaderButton
|
|
label={props.accessibilityLabel}
|
|
onTriggered={props.onPress}
|
|
style={[{ width: 44, height: 44 }, props.style]}
|
|
systemImage={props.icon}
|
|
/>
|
|
);
|
|
}
|