Skip to content

Commit 1eeeabb

Browse files
fix(mobile): use a proper pull request icon on iOS (pingdotgg#12855)
1 parent 5781b52 commit 1eeeabb

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

‎apps/mobile/src/components/AppSymbol.ios.tsx‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import IconGitPullRequest from "@tabler/icons-react-native/IconGitPullRequest";
12
import { SymbolView as ExpoSymbolView } from "expo-symbols";
23
import { withUniwind } from "uniwind";
34
import type { AppSymbolViewProps } from "./AppSymbol";
@@ -6,10 +7,24 @@ export type { SFSymbol } from "expo-symbols";
67
export type { AppSymbolName } from "./AppSymbol";
78

89
/**
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.
1112
*/
1213
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+
1328
return <ExpoSymbolView {...props} />;
1429
}
1530

0 commit comments

Comments
 (0)