Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

AppSymbol.ios.tsx

31 lines1007 Bytes

1import IconGitPullRequest from "@tabler/icons-react-native/IconGitPullRequest";
2import { SymbolView as ExpoSymbolView } from "expo-symbols";
3import { withUniwind } from "uniwind";
4import type { AppSymbolViewProps } from "./AppSymbol";
5​
6export type { SFSymbol } from "expo-symbols";
7export type { AppSymbolName } from "./AppSymbol";
8​
9/**
10 * Use SF Symbols on iOS except for pull requests, which have no matching
11 * native glyph. Import only that Tabler icon to keep the bundle small.
12 */
13function AppSymbolView(props: AppSymbolViewProps) {
14 const name = typeof props.name === "string" ? props.name : props.name.ios;
15 if (name === "arrow.triangle.pull") {
16 return (
17 <IconGitPullRequest
18 accessibilityLabel={props.accessibilityLabel}
19 color={props.tintColor}
20 size={props.size}
21 strokeWidth={2}
22 style={props.style}
23 testID={props.testID}
24 />
25 );
26 }
27​
28 return <ExpoSymbolView {...props} />;
30​
31export const SymbolView = withUniwind(AppSymbolView);