| ... | @@ -1,3 +1,4 @@ | ... | @@ -1,3 +1,4 @@ |
| | 1 | import IconGitPullRequest from "@tabler/icons-react-native/IconGitPullRequest"; |
| 1 | import { SymbolView as ExpoSymbolView } from "expo-symbols"; | 2 | import { SymbolView as ExpoSymbolView } from "expo-symbols"; |
| 2 | import { withUniwind } from "uniwind"; | 3 | import { withUniwind } from "uniwind"; |
| 3 | import type { AppSymbolViewProps } from "./AppSymbol"; | 4 | import type { AppSymbolViewProps } from "./AppSymbol"; |
| ... | @@ -6,10 +7,24 @@ export type { SFSymbol } from "expo-symbols"; | ... | @@ -6,10 +7,24 @@ export type { SFSymbol } from "expo-symbols"; |
| 6 | export type { AppSymbolName } from "./AppSymbol"; | 7 | export type { AppSymbolName } from "./AppSymbol"; |
| 7 | | 8 | |
| 8 | /** | 9 | /** |
| 9 | * Keep the iOS implementation isolated from the Android Tabler fallback so | 10 | * Use SF Symbols on iOS except for pull requests, which have no matching |
| 10 | * Metro does not initialize the icon package when iOS renders SF Symbols. | 11 | * native glyph. Import only that Tabler icon to keep the bundle small. |
| 11 | */ | 12 | */ |
| 12 | function AppSymbolView(props: AppSymbolViewProps) { | 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 | return <ExpoSymbolView {...props} />; | 28 | return <ExpoSymbolView {...props} />; |
| 14 | } | 29 | } |
| 15 | | 30 | |