Open History to see the last commit
1import type { Icon } from "@tabler/icons-react-native/types";
2/* Package-root imports eagerly register the entire Tabler icon set in Metro. */
3import IconAdjustmentsHorizontal from "@tabler/icons-react-native/IconAdjustmentsHorizontal";
4import IconAlignLeft from "@tabler/icons-react-native/IconAlignLeft";
5import IconAlertCircle from "@tabler/icons-react-native/IconAlertCircle";
6import IconAlertTriangle from "@tabler/icons-react-native/IconAlertTriangle";
7import IconApps from "@tabler/icons-react-native/IconApps";
8import IconArchive from "@tabler/icons-react-native/IconArchive";
9import IconCalendarClock from "@tabler/icons-react-native/IconCalendarClock";
10import IconArrowBackUp from "@tabler/icons-react-native/IconArrowBackUp";
11import IconArrowDown from "@tabler/icons-react-native/IconArrowDown";
12import IconArrowForwardUp from "@tabler/icons-react-native/IconArrowForwardUp";
13import IconArrowLeft from "@tabler/icons-react-native/IconArrowLeft";
14import IconArrowRight from "@tabler/icons-react-native/IconArrowRight";
15import IconArrowDownCircle from "@tabler/icons-react-native/IconArrowDownCircle";
16import IconArrowRightCircle from "@tabler/icons-react-native/IconArrowRightCircle";
17import IconArrowUp from "@tabler/icons-react-native/IconArrowUp";
18import IconArrowUpCircle from "@tabler/icons-react-native/IconArrowUpCircle";
19import IconArrowUpRight from "@tabler/icons-react-native/IconArrowUpRight";
20import IconArrowUpRightCircle from "@tabler/icons-react-native/IconArrowUpRightCircle";
21import IconArrowsLeftRight from "@tabler/icons-react-native/IconArrowsLeftRight";
22import IconArrowsDiagonal2 from "@tabler/icons-react-native/IconArrowsDiagonal2";
23import IconArrowsMinimize from "@tabler/icons-react-native/IconArrowsMinimize";
24import IconBan from "@tabler/icons-react-native/IconBan";
25import IconBellRinging from "@tabler/icons-react-native/IconBellRinging";
26import IconBolt from "@tabler/icons-react-native/IconBolt";
27import IconBox from "@tabler/icons-react-native/IconBox";
28import IconBrain from "@tabler/icons-react-native/IconBrain";
29import IconCamera from "@tabler/icons-react-native/IconCamera";
30import IconCar from "@tabler/icons-react-native/IconCar";
31import IconChartBar from "@tabler/icons-react-native/IconChartBar";
32import IconCheck from "@tabler/icons-react-native/IconCheck";
33import IconCloud from "@tabler/icons-react-native/IconCloud";
34import IconChevronDown from "@tabler/icons-react-native/IconChevronDown";
35import IconChevronLeft from "@tabler/icons-react-native/IconChevronLeft";
36import IconChevronRight from "@tabler/icons-react-native/IconChevronRight";
37import IconChevronUp from "@tabler/icons-react-native/IconChevronUp";
38import IconCircle from "@tabler/icons-react-native/IconCircle";
39import IconCircleFilled from "@tabler/icons-react-native/IconCircleFilled";
40import IconCircleCheck from "@tabler/icons-react-native/IconCircleCheck";
41import IconCircleDashed from "@tabler/icons-react-native/IconCircleDashed";
42import IconCircleDot from "@tabler/icons-react-native/IconCircleDot";
43import IconCircleXFilled from "@tabler/icons-react-native/IconCircleXFilled";
44import IconMoodPlus from "@tabler/icons-react-native/IconMoodPlus";
45import IconTag from "@tabler/icons-react-native/IconTag";
46import IconTicket from "@tabler/icons-react-native/IconTicket";
47import IconClock from "@tabler/icons-react-native/IconClock";
48import IconCode from "@tabler/icons-react-native/IconCode";
49import IconCopy from "@tabler/icons-react-native/IconCopy";
50import IconDatabase from "@tabler/icons-react-native/IconDatabase";
51import IconDeviceDesktop from "@tabler/icons-react-native/IconDeviceDesktop";
52import IconDeviceLaptop from "@tabler/icons-react-native/IconDeviceLaptop";
53import IconDeviceMobile from "@tabler/icons-react-native/IconDeviceMobile";
54import IconDots from "@tabler/icons-react-native/IconDots";
55import IconPlusMinus from "@tabler/icons-react-native/IconPlusMinus";
56import IconDotsVertical from "@tabler/icons-react-native/IconDotsVertical";
57import IconDotsCircleHorizontal from "@tabler/icons-react-native/IconDotsCircleHorizontal";
58import IconEdit from "@tabler/icons-react-native/IconEdit";
59import IconExternalLink from "@tabler/icons-react-native/IconExternalLink";
60import IconEyeOff from "@tabler/icons-react-native/IconEyeOff";
61import IconEye from "@tabler/icons-react-native/IconEye";
62import IconFileText from "@tabler/icons-react-native/IconFileText";
63import IconFileDiff from "@tabler/icons-react-native/IconFileDiff";
64import IconFilter from "@tabler/icons-react-native/IconFilter";
65import IconFilterFilled from "@tabler/icons-react-native/IconFilterFilled";
66import IconFolder from "@tabler/icons-react-native/IconFolder";
67import IconFolderOpen from "@tabler/icons-react-native/IconFolderOpen";
68import IconHeadphones from "@tabler/icons-react-native/IconHeadphones";
69import IconFolderPlus from "@tabler/icons-react-native/IconFolderPlus";
70import IconGitPullRequestClosed from "@tabler/icons-react-native/IconGitPullRequestClosed";
71import IconGitPullRequestDraft from "@tabler/icons-react-native/IconGitPullRequestDraft";
72import IconGitCommit from "@tabler/icons-react-native/IconGitCommit";
73import IconGitBranch from "@tabler/icons-react-native/IconGitBranch";
74import IconGitMerge from "@tabler/icons-react-native/IconGitMerge";
75import IconGitPullRequest from "@tabler/icons-react-native/IconGitPullRequest";
76import IconHammer from "@tabler/icons-react-native/IconHammer";
77import IconHome from "@tabler/icons-react-native/IconHome";
78import IconInfoCircle from "@tabler/icons-react-native/IconInfoCircle";
79import IconKeyboard from "@tabler/icons-react-native/IconKeyboard";
80import IconKeyboardHide from "@tabler/icons-react-native/IconKeyboardHide";
81import IconLock from "@tabler/icons-react-native/IconLock";
82import IconLayoutColumns from "@tabler/icons-react-native/IconLayoutColumns";
83import IconLayoutSidebar from "@tabler/icons-react-native/IconLayoutSidebar";
84import IconLayoutSidebarRight from "@tabler/icons-react-native/IconLayoutSidebarRight";
85import IconLetterSpacing from "@tabler/icons-react-native/IconLetterSpacing";
86import IconMicrophone from "@tabler/icons-react-native/IconMicrophone";
87import IconLink from "@tabler/icons-react-native/IconLink";
88import IconListNumbers from "@tabler/icons-react-native/IconListNumbers";
89import IconMenu2 from "@tabler/icons-react-native/IconMenu2";
90import IconMessageCircleQuestion from "@tabler/icons-react-native/IconMessageCircleQuestion";
91import IconMessage from "@tabler/icons-react-native/IconMessage";
92import IconMessagePlus from "@tabler/icons-react-native/IconMessagePlus";
93import IconMinus from "@tabler/icons-react-native/IconMinus";
94import IconMoon from "@tabler/icons-react-native/IconMoon";
95import IconNetwork from "@tabler/icons-react-native/IconNetwork";
96import IconPalette from "@tabler/icons-react-native/IconPalette";
97import IconPencil from "@tabler/icons-react-native/IconPencil";
98import IconPlug from "@tabler/icons-react-native/IconPlug";
99import IconPhoto from "@tabler/icons-react-native/IconPhoto";
100import IconPin from "@tabler/icons-react-native/IconPin";
101import IconPinnedOff from "@tabler/icons-react-native/IconPinnedOff";
102import IconPlayerPlay from "@tabler/icons-react-native/IconPlayerPlay";
103import IconPlayerStopFilled from "@tabler/icons-react-native/IconPlayerStopFilled";
104import IconPlus from "@tabler/icons-react-native/IconPlus";
105import IconQrcode from "@tabler/icons-react-native/IconQrcode";
106import IconRefresh from "@tabler/icons-react-native/IconRefresh";
107import IconSearch from "@tabler/icons-react-native/IconSearch";
108import IconShare from "@tabler/icons-react-native/IconShare";
109import IconServer from "@tabler/icons-react-native/IconServer";
110import IconSettings from "@tabler/icons-react-native/IconSettings";
111import IconSparkles from "@tabler/icons-react-native/IconSparkles";
112import IconStack2 from "@tabler/icons-react-native/IconStack2";
113import IconStar from "@tabler/icons-react-native/IconStar";
114import IconStarFilled from "@tabler/icons-react-native/IconStarFilled";
115import IconStethoscope from "@tabler/icons-react-native/IconStethoscope";
116import IconSun from "@tabler/icons-react-native/IconSun";
117import IconShieldQuestion from "@tabler/icons-react-native/IconShieldQuestion";
118import IconTarget from "@tabler/icons-react-native/IconTarget";
119import IconTerminal2 from "@tabler/icons-react-native/IconTerminal2";
120import IconTextDecrease from "@tabler/icons-react-native/IconTextDecrease";
121import IconTextIncrease from "@tabler/icons-react-native/IconTextIncrease";
122import IconTool from "@tabler/icons-react-native/IconTool";
123import IconTrash from "@tabler/icons-react-native/IconTrash";
124import IconTypography from "@tabler/icons-react-native/IconTypography";
125import IconUpload from "@tabler/icons-react-native/IconUpload";
126import IconUserCircle from "@tabler/icons-react-native/IconUserCircle";
127import IconUserCheck from "@tabler/icons-react-native/IconUserCheck";
128import IconUserX from "@tabler/icons-react-native/IconUserX";
129import IconUserQuestion from "@tabler/icons-react-native/IconUserQuestion";
130import IconUserPlus from "@tabler/icons-react-native/IconUserPlus";
131import IconUsers from "@tabler/icons-react-native/IconUsers";
132import IconWifi from "@tabler/icons-react-native/IconWifi";
133import IconWifiOff from "@tabler/icons-react-native/IconWifiOff";
134import IconWorld from "@tabler/icons-react-native/IconWorld";
135import IconX from "@tabler/icons-react-native/IconX";
136import type { AndroidSymbol, SFSymbol, SymbolViewProps } from "expo-symbols";
137import { withUniwind } from "uniwind";
138
139const ANDROID_ICON_BY_SF_SYMBOL = {
140 plusminus: IconPlusMinus,
141 "git.pull-request.closed": IconGitPullRequestClosed,
142 "git.pull-request.draft": IconGitPullRequestDraft,
143 "git.commit": IconGitCommit,
144 "arrow.branch": IconGitBranch,
145 "arrow.left": IconArrowLeft,
146 "arrow.right": IconArrowRight,
147 "arrow.left.arrow.right": IconArrowsLeftRight,
148 "arrow.clockwise": IconRefresh,
149 "arrow.down": IconArrowDown,
150 "arrow.down.circle": IconArrowDownCircle,
151 "arrow.right.circle": IconArrowRightCircle,
152 "arrow.triangle.branch": IconGitBranch,
153 "arrow.triangle.merge": IconGitMerge,
154 "arrow.triangle.pull": IconGitPullRequest,
155 "square.3.layers.3d": IconStack2,
156 "arrow.turn.left.up": IconArrowBackUp,
157 "arrow.up": IconArrowUp,
158 "arrow.up.circle": IconArrowUpCircle,
159 "arrow.up.left.and.arrow.down.right": IconArrowsDiagonal2,
160 "arrow.down.right.and.arrow.up.left": IconArrowsMinimize,
161 "arrow.up.right": IconArrowUpRight,
162 "arrow.up.right.circle": IconArrowUpRightCircle,
163 "arrow.uturn.backward": IconArrowBackUp,
164 "arrow.uturn.forward": IconArrowForwardUp,
165 archivebox: IconArchive,
166 "archivebox.fill": IconArchive,
167 "bell.badge": IconBellRinging,
168 "bolt.circle": IconBolt,
169 "bolt.horizontal.circle": IconBolt,
170 brain: IconBrain,
171 "cable.connector": IconPlug,
172 camera: IconCamera,
173 car: IconCar,
174 "chart.bar.xaxis": IconChartBar,
175 checkmark: IconCheck,
176 "checkmark.circle": IconCircleCheck,
177 "checkmark.circle.fill": IconCircleCheck,
178 circle: IconCircle,
179 "circle.fill": IconCircleFilled,
180 "circle.dashed": IconCircleDashed,
181 "circle.inset.filled": IconCircleDot,
182 "circle.dashed.inset.filled": IconCircleDot,
183 "calendar.badge.clock": IconCalendarClock,
184 clock: IconClock,
185 timer: IconClock,
186 "face.smiling": IconMoodPlus,
187 tag: IconTag,
188 ticket: IconTicket,
189 cloud: IconCloud,
190 cube: IconBox,
191 "chevron.down": IconChevronDown,
192 "chevron.left": IconChevronLeft,
193 "chevron.left.forwardslash.chevron.right": IconCode,
194 "chevron.right": IconChevronRight,
195 "chevron.up": IconChevronUp,
196 desktopcomputer: IconDeviceDesktop,
197 doc: IconFileText,
198 "doc.on.doc": IconCopy,
199 "doc.text": IconFileText,
200 "file.diff": IconFileDiff,
201 ellipsis: IconDots,
202 moon: IconMoon,
203 "ellipsis.circle": IconDotsCircleHorizontal,
204 "exclamationmark.triangle": IconAlertTriangle,
205 "exclamationmark.circle": IconAlertCircle,
206 eye: IconEye,
207 "eye.slash": IconEyeOff,
208 folder: IconFolder,
209 "folder.badge.plus": IconFolderPlus,
210 "folder.fill": IconFolder,
211 gearshape: IconSettings,
212 globe: IconWorld,
213 hammer: IconHammer,
214 headphones: IconHeadphones,
215 house: IconHome,
216 "info.circle": IconInfoCircle,
217 internaldrive: IconDatabase,
218 iphone: IconDeviceMobile,
219 keyboard: IconKeyboard,
220 laptopcomputer: IconDeviceLaptop,
221 link: IconLink,
222 "list.number": IconListNumbers,
223 "line.3.horizontal": IconMenu2,
224 "line.3.horizontal.decrease": IconFilter,
225 "line.3.horizontal.decrease.circle": IconFilter,
226 "line.3.horizontal.decrease.circle.fill": IconFilterFilled,
227 macmini: IconServer,
228 macstudio: IconDeviceDesktop,
229 magnifyingglass: IconSearch,
230 mic: IconMicrophone,
231 paintbrush: IconPalette,
232 pencil: IconPencil,
233 "person.crop.circle": IconUserCircle,
234 "person.2": IconUsers,
235 "person.fill.checkmark": IconUserCheck,
236 "person.fill.xmark": IconUserX,
237 "person.badge.clock": IconUserQuestion,
238 "person.badge.plus": IconUserPlus,
239 photo: IconPhoto,
240 pin: IconPin,
241 "pin.slash": IconPinnedOff,
242 play: IconPlayerPlay,
243 plus: IconPlus,
244 minus: IconMinus,
245 "slash.circle": IconBan,
246 "qrcode.viewfinder": IconQrcode,
247 "point.3.connected.trianglepath.dotted": IconNetwork,
248 "point.topleft.down.curvedto.point.bottomright.up": IconGitMerge,
249 safari: IconExternalLink,
250 "server.rack": IconServer,
251 stethoscope: IconStethoscope,
252 "sidebar.left": IconLayoutSidebar,
253 "sidebar.right": IconLayoutSidebarRight,
254 "slider.horizontal.3": IconAdjustmentsHorizontal,
255 "square.and.arrow.up": IconShare,
256 "square.and.pencil": IconEdit,
257 "square.on.square": IconCopy,
258 "square.grid.2x2": IconApps,
259 "square.split.2x1": IconLayoutColumns,
260 star: IconStar,
261 "star.fill": IconStarFilled,
262 "sun.max": IconSun,
263 "stop.fill": IconPlayerStopFilled,
264 target: IconTarget,
265 terminal: IconTerminal2,
266 "text.alignleft": IconAlignLeft,
267 "text.bubble": IconMessage,
268 "questionmark.bubble": IconMessageCircleQuestion,
269 "exclamationmark.shield": IconShieldQuestion,
270 "bubble.left.and.bubble.right": IconMessage,
271 "bubble.left": IconMessage,
272 sparkles: IconSparkles,
273 "plus.bubble": IconMessagePlus,
274 "text.word.spacing": IconLetterSpacing,
275 "textformat.size": IconTypography,
276 "textformat.size.larger": IconTextIncrease,
277 "textformat.size.smaller": IconTextDecrease,
278 "tray.and.arrow.up": IconUpload,
279 trash: IconTrash,
280 wifi: IconWifi,
281 "wifi.slash": IconWifiOff,
282 xmark: IconX,
283 "xmark.circle.fill": IconCircleXFilled,
284} satisfies Partial<
285 Record<
286 SFSymbol | "git.pull-request.closed" | "git.pull-request.draft" | "git.commit" | "file.diff",
287 Icon
288 >
289>;
290const SF_ICON_LOOKUP: Partial<
291 Record<
292 SFSymbol | "git.pull-request.closed" | "git.pull-request.draft" | "git.commit" | "file.diff",
293 Icon
294 >
295> = ANDROID_ICON_BY_SF_SYMBOL;
296
297const ANDROID_ICON_BY_MATERIAL_NAME = {
298 auto_awesome: IconSparkles,
299 bolt: IconBolt,
300 build: IconTool,
301 chat: IconMessage,
302 chat_bubble: IconMessage,
303 check: IconCheck,
304 close: IconX,
305 construction: IconHammer,
306 content_copy: IconCopy,
307 desktop_windows: IconDeviceDesktop,
308 edit: IconEdit,
309 error: IconAlertCircle,
310 folder: IconFolder,
311 folder_open: IconFolderOpen,
312 keyboard: IconKeyboard,
313 keyboard_arrow_down: IconChevronDown,
314 keyboard_arrow_up: IconChevronUp,
315 keyboard_hide: IconKeyboardHide,
316 lock: IconLock,
317 more_vert: IconDotsVertical,
318 merge: IconGitMerge,
319 psychology: IconBrain,
320 public: IconWorld,
321 remove: IconMinus,
322 smartphone: IconDeviceMobile,
323 terminal: IconTerminal2,
324 visibility: IconEye,
325} satisfies Partial<Record<AndroidSymbol, Icon>>;
326
327export type { SFSymbol } from "expo-symbols";
328export type AppSymbolName =
329 | keyof typeof ANDROID_ICON_BY_SF_SYMBOL
330 | {
331 ios: SFSymbol;
332 android: keyof typeof ANDROID_ICON_BY_MATERIAL_NAME;
333 };
334
335export type AppSymbolViewProps = Omit<SymbolViewProps, "name"> & { name: AppSymbolName };
336
337export function isAppSymbolName(name: string): name is Extract<AppSymbolName, string> {
338 return Object.prototype.hasOwnProperty.call(ANDROID_ICON_BY_SF_SYMBOL, name);
339}
340
341function AppSymbolView(props: AppSymbolViewProps) {
342 const materialName = typeof props.name === "string" ? undefined : props.name.android;
343 const sfSymbol = typeof props.name === "string" ? props.name : props.name.ios;
344 const AndroidIcon =
345 (materialName ? ANDROID_ICON_BY_MATERIAL_NAME[materialName] : undefined) ??
346 (sfSymbol ? SF_ICON_LOOKUP[sfSymbol] : undefined);
347
348 if (!AndroidIcon) {
349 return props.fallback ?? null;
350 }
351
352 return (
353 <AndroidIcon
354 accessibilityLabel={props.accessibilityLabel}
355 color={props.tintColor}
356 size={props.size}
357 strokeWidth={2}
358 style={props.style}
359 testID={props.testID}
360 />
361 );
362}
363
364export const SymbolView = withUniwind(AppSymbolView);