Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions apps/mobile/src/components/AppSymbol.ios.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import IconGitPullRequest from "@tabler/icons-react-native/IconGitPullRequest";
import { SymbolView as ExpoSymbolView } from "expo-symbols";
import { withUniwind } from "uniwind";
import type { AppSymbolViewProps } from "./AppSymbol";
Expand All @@ -6,10 +7,24 @@ export type { SFSymbol } from "expo-symbols";
export type { AppSymbolName } from "./AppSymbol";

/**
* Keep the iOS implementation isolated from the Android Tabler fallback so
* Metro does not initialize the icon package when iOS renders SF Symbols.
* Use SF Symbols on iOS except for pull requests, which have no matching
* native glyph. Import only that Tabler icon to keep the bundle small.
*/
function AppSymbolView(props: AppSymbolViewProps) {
const name = typeof props.name === "string" ? props.name : props.name.ios;
if (name === "arrow.triangle.pull") {
return (
<IconGitPullRequest
accessibilityLabel={props.accessibilityLabel}
color={props.tintColor}
size={props.size}
strokeWidth={2}
style={props.style}
testID={props.testID}
/>
);
}

return <ExpoSymbolView {...props} />;
}

Expand Down
Loading