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