From b42806a6e0466619ecf2db014af5f0c1f90b805a Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 1 Nov 2023 10:15:37 -0500 Subject: [PATCH] Revise icons startup code --- src/App.native.tsx | 16 +-- src/App.web.tsx | 22 ++-- src/view/{index.ts => icons.ts} | 202 ++++++++++++++++---------------- 3 files changed, 121 insertions(+), 119 deletions(-) rename src/view/{index.ts => icons.ts} (81%) diff --git a/src/App.native.tsx b/src/App.native.tsx index f4298c46..f0b1a1bc 100644 --- a/src/App.native.tsx +++ b/src/App.native.tsx @@ -1,20 +1,23 @@ import 'react-native-url-polyfill/auto' +import 'lib/sentry' // must be near top + import React, {useState, useEffect} from 'react' -import 'lib/sentry' // must be relatively on top -import {withSentry} from 'lib/sentry' import {RootSiblingParent} from 'react-native-root-siblings' import * as SplashScreen from 'expo-splash-screen' import {GestureHandlerRootView} from 'react-native-gesture-handler' import {observer} from 'mobx-react-lite' +import {QueryClientProvider} from '@tanstack/react-query' + +import 'view/icons' + +import {withSentry} from 'lib/sentry' import {ThemeProvider} from 'lib/ThemeContext' import {s} from 'lib/styles' -import * as view from './view/index' import {RootStoreModel, setupState, RootStoreProvider} from './state' -import {Shell} from './view/shell' +import {Shell} from 'view/shell' import * as notifications from 'lib/notifications/notifications' import * as analytics from 'lib/analytics/analytics' -import * as Toast from './view/com/util/Toast' -import {QueryClientProvider} from '@tanstack/react-query' +import * as Toast from 'view/com/util/Toast' import {queryClient} from 'lib/react-query' import {TestCtrls} from 'view/com/testing/TestCtrls' @@ -27,7 +30,6 @@ const App = observer(function AppImpl() { // init useEffect(() => { - view.setup() setupState().then(store => { setRootStore(store) analytics.init(store) diff --git a/src/App.web.tsx b/src/App.web.tsx index a9123cc5..3b67af0d 100644 --- a/src/App.web.tsx +++ b/src/App.web.tsx @@ -1,15 +1,18 @@ +import 'lib/sentry' // must be near top + import React, {useState, useEffect} from 'react' -import 'lib/sentry' // must be relatively on top -import {SafeAreaProvider} from 'react-native-safe-area-context' -import {RootSiblingParent} from 'react-native-root-siblings' -import * as view from './view/index' -import * as analytics from 'lib/analytics/analytics' -import {RootStoreModel, setupState, RootStoreProvider} from './state' -import {Shell} from './view/shell/index' -import {ToastContainer} from './view/com/util/Toast.web' -import {ThemeProvider} from 'lib/ThemeContext' import {observer} from 'mobx-react-lite' import {QueryClientProvider} from '@tanstack/react-query' +import {SafeAreaProvider} from 'react-native-safe-area-context' +import {RootSiblingParent} from 'react-native-root-siblings' + +import 'view/icons' + +import * as analytics from 'lib/analytics/analytics' +import {RootStoreModel, setupState, RootStoreProvider} from './state' +import {Shell} from 'view/shell/index' +import {ToastContainer} from 'view/com/util/Toast.web' +import {ThemeProvider} from 'lib/ThemeContext' import {queryClient} from 'lib/react-query' const App = observer(function AppImpl() { @@ -19,7 +22,6 @@ const App = observer(function AppImpl() { // init useEffect(() => { - view.setup() setupState().then(store => { setRootStore(store) analytics.init(store) diff --git a/src/view/index.ts b/src/view/icons.ts similarity index 81% rename from src/view/index.ts rename to src/view/icons.ts index 1e6f2741..089d3f0a 100644 --- a/src/view/index.ts +++ b/src/view/icons.ts @@ -99,105 +99,103 @@ import {faX} from '@fortawesome/free-solid-svg-icons/faX' import {faXmark} from '@fortawesome/free-solid-svg-icons/faXmark' import {faChevronDown} from '@fortawesome/free-solid-svg-icons/faChevronDown' -export function setup() { - library.add( - faAddressCard, - faAngleDown, - faAngleLeft, - faAngleRight, - faAngleUp, - faArrowLeft, - faArrowRight, - faArrowUp, - faArrowDown, - faArrowRightFromBracket, - faArrowUpFromBracket, - faArrowUpRightFromSquare, - faArrowRotateLeft, - faArrowTrendUp, - faArrowsRotate, - faAt, - faBan, - faBars, - faBell, - farBell, - faBookmark, - farBookmark, - farCalendar, - faCamera, - faCheck, - faChevronRight, - faCircle, - faCircleCheck, - farCircleCheck, - faCircleExclamation, - faCircleUser, - faCircleDot, - faClone, - farClone, - faComment, - faCommentSlash, - faComments, - faCompass, - faEllipsis, - faEnvelope, - faEye, - faExclamation, - farEyeSlash, - faFaceSmile, - faFire, - faFlask, - faFloppyDisk, - faGear, - faGlobe, - faHand, - farHand, - faHeart, - fasHeart, - faHouse, - faImage, - farImage, - faInfo, - faLanguage, - faLink, - faList, - faListUl, - faLock, - faMagnifyingGlass, - faMessage, - faNoteSticky, - faPaste, - faPause, - faPen, - faPenNib, - faPenToSquare, - faPlay, - faPlus, - faQuoteLeft, - faReply, - faRetweet, - faRss, - faSatelliteDish, - faShare, - faShareFromSquare, - faShield, - faSignal, - faSliders, - faSquare, - faSquareCheck, - faSquarePlus, - faUser, - faUsers, - faUserCheck, - faUserSlash, - faUserPlus, - faUserXmark, - faUsersSlash, - faThumbtack, - faTicket, - faTrashCan, - faX, - faXmark, - faChevronDown, - ) -} +library.add( + faAddressCard, + faAngleDown, + faAngleLeft, + faAngleRight, + faAngleUp, + faArrowLeft, + faArrowRight, + faArrowUp, + faArrowDown, + faArrowRightFromBracket, + faArrowUpFromBracket, + faArrowUpRightFromSquare, + faArrowRotateLeft, + faArrowTrendUp, + faArrowsRotate, + faAt, + faBan, + faBars, + faBell, + farBell, + faBookmark, + farBookmark, + farCalendar, + faCamera, + faCheck, + faChevronRight, + faCircle, + faCircleCheck, + farCircleCheck, + faCircleExclamation, + faCircleUser, + faCircleDot, + faClone, + farClone, + faComment, + faCommentSlash, + faComments, + faCompass, + faEllipsis, + faEnvelope, + faEye, + faExclamation, + farEyeSlash, + faFaceSmile, + faFire, + faFlask, + faFloppyDisk, + faGear, + faGlobe, + faHand, + farHand, + faHeart, + fasHeart, + faHouse, + faImage, + farImage, + faInfo, + faLanguage, + faLink, + faList, + faListUl, + faLock, + faMagnifyingGlass, + faMessage, + faNoteSticky, + faPaste, + faPause, + faPen, + faPenNib, + faPenToSquare, + faPlay, + faPlus, + faQuoteLeft, + faReply, + faRetweet, + faRss, + faSatelliteDish, + faShare, + faShareFromSquare, + faShield, + faSignal, + faSliders, + faSquare, + faSquareCheck, + faSquarePlus, + faUser, + faUsers, + faUserCheck, + faUserSlash, + faUserPlus, + faUserXmark, + faUsersSlash, + faThumbtack, + faTicket, + faTrashCan, + faX, + faXmark, + faChevronDown, +)