| ... | ... | @@ -1,3 +1,4 @@ |
| 1 | import IconGitPullRequest from "@tabler/icons-react-native/IconGitPullRequest"; |
| 1 | 2 | import { SymbolView as ExpoSymbolView } from "expo-symbols"; |
| 2 | 3 | import { withUniwind } from "uniwind"; |
| 3 | 4 | import type { AppSymbolViewProps } from "./AppSymbol"; |
| ... | ... | @@ -6,10 +7,24 @@ export type { SFSymbol } from "expo-symbols"; |
| 6 | 7 | export type { AppSymbolName } from "./AppSymbol"; |
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | | * Keep the iOS implementation isolated from the Android Tabler fallback so |
| 10 | | * Metro does not initialize the icon package when iOS renders SF Symbols. |
| 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. |
| 11 | 12 | */ |
| 12 | 13 | function 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 | |
| 13 | 28 | return <ExpoSymbolView {...props} />; |
| 14 | 29 | } |
| 15 | 30 | |