From cff746aa38f2f9942a31fe60e4931601ae1dbb55 Mon Sep 17 00:00:00 2001 From: erik-sn Date: Wed, 7 Oct 2020 12:19:55 -0400 Subject: [PATCH] working typescript version --- phone/.babelrc | 20 +++---- phone/package.json | 9 ++- phone/react-app-env.d.ts | 1 + phone/src/{Phone.test.js => Phone.test.tsx} | 0 phone/src/{Phone.js => Phone.tsx} | 0 .../components/{BankApp.js => BankApp.tsx} | 0 ...transactionList.js => transactionList.tsx} | 0 phone/src/apps/bank/hooks/useBank.js | 31 ---------- phone/src/apps/bank/hooks/useBank.ts | 32 +++++++++++ .../{Calculator.js => Calculator.tsx} | 0 .../{CalculatorApp.js => CalculatorApp.tsx} | 0 .../{CalculatorIcon.js => CalculatorIcon.tsx} | 0 .../{useCalculator.js => useCalculator.tsx} | 0 .../{ContactList.js => ContactList.tsx} | 0 .../{ContactModal.js => ContactModal.tsx} | 0 .../{ContactsApp.js => ContactsApp.tsx} | 0 .../contacts/hooks/{state.js => state.ts} | 0 .../hooks/{useContacts.js => useContacts.ts} | 0 ...ntactsService.js => useContactsService.ts} | 0 .../{DialerApp.js => DialerApp.tsx} | 0 .../{DialerHistory.js => DialerHistory.tsx} | 0 ...seDialerHistory.js => useDialerHistory.ts} | 0 .../{ExampleApp.js => ExampleApp.tsx} | 0 .../home/components/{Home.js => Home.tsx} | 0 .../{MessagesApp.js => MessagesApp.tsx} | 0 .../hooks/{useMessages.js => useMessages.ts} | 0 .../src/apps/messages/{index.js => index.ts} | 0 .../{SettingItem.js => SettingItem.tsx} | 0 .../{SettingsApp.js => SettingsApp.tsx} | 0 .../hooks/{useSettings.js => useSettings.ts} | 0 .../{AddTweetModal.js => AddTweetModal.tsx} | 8 ++- .../components/{Avatar.js => Avatar.tsx} | 0 ...ttomNavigation.js => BottomNavigation.tsx} | 0 .../{EmojiSelect.js => EmojiSelect.tsx} | 0 .../{TwitterApp.js => TwitterApp.tsx} | 0 .../{TwitterSearch.js => TwitterSearch.tsx} | 0 .../{TwitterTitle.js => TwitterTitle.tsx} | 0 .../components/alerts/{Alert.js => Alert.tsx} | 0 .../alerts/{AlertBar.js => AlertBar.tsx} | 0 .../{ControlButtons.js => ControlButtons.tsx} | 0 .../{IconButtons.js => IconButtons.tsx} | 18 +++--- .../buttons/{LikeButton.js => LikeButton.tsx} | 0 ...pdateButton.js => ProfileUpdateButton.tsx} | 0 .../{QuoteButton.js => QuoteButton.tsx} | 0 .../{ReplyButton.js => ReplyButton.tsx} | 0 .../{SearchButton.js => SearchButton.tsx} | 0 .../{TweetButton.js => TweetButton.tsx} | 0 .../components/images/{Image.js => Image.tsx} | 0 .../{ImageDisplay.js => ImageDisplay.tsx} | 0 .../{ImagePrompt.js => ImagePrompt.tsx} | 0 .../profile/{Profile.js => Profile.tsx} | 3 +- .../{ProfileField.js => ProfileField.tsx} | 0 .../{ProfilePrompt.js => ProfilePrompt.tsx} | 0 .../components/tweet/{Tweet.js => Tweet.tsx} | 0 .../tweet/{TweetList.js => TweetList.tsx} | 0 ...istContainer.js => TweetListContainer.tsx} | 0 .../{TweetMessage.js => TweetMessage.tsx} | 7 ++- .../{TweetSkeleton.js => TweetSkeleton.tsx} | 0 ...tSkeletonList.js => TweetSkeletonList.tsx} | 0 .../apps/twitter/hooks/{state.js => state.ts} | 0 ...FilteredTweets.js => useFilteredTweets.ts} | 0 .../hooks/{useModal.js => useModal.ts} | 0 .../hooks/{useProfile.js => useProfile.ts} | 0 .../{useTweetStatus.js => useTweetStatus.ts} | 0 .../hooks/{useTweets.js => useTweets.ts} | 0 ...TwitterService.js => useTwitterService.ts} | 0 .../utils/{constants.js => constants.ts} | 0 .../twitter/utils/{images.js => images.ts} | 0 .../apps/twitter/utils/{time.js => time.ts} | 5 +- .../hooks/{useConfig.js => useConfig.ts} | 12 ++-- phone/src/{i18n.js => i18n.ts} | 2 +- phone/src/{index.js => index.tsx} | 0 .../{CallModal.js => CallModal.tsx} | 0 phone/src/modal/hooks/{state.js => state.ts} | 0 .../modal/hooks/{useCall.js => useCall.ts} | 0 .../{useCallService.js => useCallService.ts} | 0 .../os/apps/hooks/{useApps.js => useApps.tsx} | 0 .../hooks/{useKeyboard.js => useKeyboard.ts} | 9 ++- .../{Navigation.js => Navigation.tsx} | 0 ...seNavigationBar.js => useNavigationBar.ts} | 0 ...NotificationBar.js => NotificationBar.tsx} | 9 ++- ...tificationIcon.js => NotificationIcon.tsx} | 0 .../hooks/{useNuiEvent.js => useNuiEvent.ts} | 0 .../{useNuiService.js => useNuiService.ts} | 0 .../os/nui-events/utils/{Nui.js => Nui.ts} | 0 .../utils/{nuiUtils.js => nuiUtils.ts} | 0 .../src/os/phone/hooks/{state.js => state.ts} | 0 .../phone/hooks/{usePhone.js => usePhone.ts} | 0 ...{usePhoneService.js => usePhoneService.ts} | 0 .../os/simcard/hooks/{state.js => state.ts} | 0 .../hooks/{useSimcard.js => useSimcard.ts} | 0 ...SimcardService.js => useSimcardService.ts} | 0 phone/src/react-app-env.d.ts | 1 + .../{serviceWorker.js => serviceWorker.ts} | 44 +++++++-------- phone/src/{setupTests.js => setupTests.ts} | 0 .../{AppContent.js => AppContent.tsx} | 0 .../ui/components/{AppIcon.js => AppIcon.tsx} | 9 ++- .../components/{AppTitle.js => AppTitle.tsx} | 0 .../{AppWrapper.js => AppWrapper.tsx} | 2 +- .../ui/components/{Button.js => Button.tsx} | 0 .../{ContextMenu.js => ContextMenu.tsx} | 0 .../components/{GridMenu.js => GridMenu.tsx} | 0 .../src/ui/components/{Input.js => Input.tsx} | 0 phone/src/ui/components/{List.js => List.tsx} | 0 .../components/{ListItem.js => ListItem.tsx} | 0 .../src/ui/components/{Modal.js => Modal.tsx} | 0 phone/src/ui/components/index.js | 1 - phone/src/ui/components/index.tsx | 1 + .../ui/hooks/{phoneState.js => phoneState.ts} | 0 .../{useContextMenu.js => useContextMenu.tsx} | 4 +- .../src/ui/hooks/{useModal.js => useModal.ts} | 0 ...{usePhoneService.js => usePhoneService.ts} | 0 phone/tsconfig.json | 20 +++++++ phone/webpack/webpack.common.js | 56 +++++++++++-------- phone/webpack/webpack.resources.js | 18 +++--- phone/yarn.lock | 47 ++++++++++++++-- resources/config.lua | 8 +-- resources/html/index.html | 45 +-------------- resources/html/main.js | 14 ++--- 119 files changed, 247 insertions(+), 189 deletions(-) create mode 100644 phone/react-app-env.d.ts rename phone/src/{Phone.test.js => Phone.test.tsx} (100%) rename phone/src/{Phone.js => Phone.tsx} (100%) rename phone/src/apps/bank/components/{BankApp.js => BankApp.tsx} (100%) rename phone/src/apps/bank/components/{transactionList.js => transactionList.tsx} (100%) delete mode 100644 phone/src/apps/bank/hooks/useBank.js create mode 100644 phone/src/apps/bank/hooks/useBank.ts rename phone/src/apps/calculator/components/{Calculator.js => Calculator.tsx} (100%) rename phone/src/apps/calculator/components/{CalculatorApp.js => CalculatorApp.tsx} (100%) rename phone/src/apps/calculator/components/{CalculatorIcon.js => CalculatorIcon.tsx} (100%) rename phone/src/apps/calculator/hooks/{useCalculator.js => useCalculator.tsx} (100%) rename phone/src/apps/contacts/components/{ContactList.js => ContactList.tsx} (100%) rename phone/src/apps/contacts/components/{ContactModal.js => ContactModal.tsx} (100%) rename phone/src/apps/contacts/components/{ContactsApp.js => ContactsApp.tsx} (100%) rename phone/src/apps/contacts/hooks/{state.js => state.ts} (100%) rename phone/src/apps/contacts/hooks/{useContacts.js => useContacts.ts} (100%) rename phone/src/apps/contacts/hooks/{useContactsService.js => useContactsService.ts} (100%) rename phone/src/apps/dialer/components/{DialerApp.js => DialerApp.tsx} (100%) rename phone/src/apps/dialer/components/{DialerHistory.js => DialerHistory.tsx} (100%) rename phone/src/apps/dialer/hooks/{useDialerHistory.js => useDialerHistory.ts} (100%) rename phone/src/apps/example/components/{ExampleApp.js => ExampleApp.tsx} (100%) rename phone/src/apps/home/components/{Home.js => Home.tsx} (100%) rename phone/src/apps/messages/components/{MessagesApp.js => MessagesApp.tsx} (100%) rename phone/src/apps/messages/hooks/{useMessages.js => useMessages.ts} (100%) rename phone/src/apps/messages/{index.js => index.ts} (100%) rename phone/src/apps/settings/components/{SettingItem.js => SettingItem.tsx} (100%) rename phone/src/apps/settings/components/{SettingsApp.js => SettingsApp.tsx} (100%) rename phone/src/apps/settings/hooks/{useSettings.js => useSettings.ts} (100%) rename phone/src/apps/twitter/components/{AddTweetModal.js => AddTweetModal.tsx} (97%) rename phone/src/apps/twitter/components/{Avatar.js => Avatar.tsx} (100%) rename phone/src/apps/twitter/components/{BottomNavigation.js => BottomNavigation.tsx} (100%) rename phone/src/apps/twitter/components/{EmojiSelect.js => EmojiSelect.tsx} (100%) rename phone/src/apps/twitter/components/{TwitterApp.js => TwitterApp.tsx} (100%) rename phone/src/apps/twitter/components/{TwitterSearch.js => TwitterSearch.tsx} (100%) rename phone/src/apps/twitter/components/{TwitterTitle.js => TwitterTitle.tsx} (100%) rename phone/src/apps/twitter/components/alerts/{Alert.js => Alert.tsx} (100%) rename phone/src/apps/twitter/components/alerts/{AlertBar.js => AlertBar.tsx} (100%) rename phone/src/apps/twitter/components/buttons/{ControlButtons.js => ControlButtons.tsx} (100%) rename phone/src/apps/twitter/components/buttons/{IconButtons.js => IconButtons.tsx} (75%) rename phone/src/apps/twitter/components/buttons/{LikeButton.js => LikeButton.tsx} (100%) rename phone/src/apps/twitter/components/buttons/{ProfileUpdateButton.js => ProfileUpdateButton.tsx} (100%) rename phone/src/apps/twitter/components/buttons/{QuoteButton.js => QuoteButton.tsx} (100%) rename phone/src/apps/twitter/components/buttons/{ReplyButton.js => ReplyButton.tsx} (100%) rename phone/src/apps/twitter/components/buttons/{SearchButton.js => SearchButton.tsx} (100%) rename phone/src/apps/twitter/components/buttons/{TweetButton.js => TweetButton.tsx} (100%) rename phone/src/apps/twitter/components/images/{Image.js => Image.tsx} (100%) rename phone/src/apps/twitter/components/images/{ImageDisplay.js => ImageDisplay.tsx} (100%) rename phone/src/apps/twitter/components/images/{ImagePrompt.js => ImagePrompt.tsx} (100%) rename phone/src/apps/twitter/components/profile/{Profile.js => Profile.tsx} (97%) rename phone/src/apps/twitter/components/profile/{ProfileField.js => ProfileField.tsx} (100%) rename phone/src/apps/twitter/components/profile/{ProfilePrompt.js => ProfilePrompt.tsx} (100%) rename phone/src/apps/twitter/components/tweet/{Tweet.js => Tweet.tsx} (100%) rename phone/src/apps/twitter/components/tweet/{TweetList.js => TweetList.tsx} (100%) rename phone/src/apps/twitter/components/tweet/{TweetListContainer.js => TweetListContainer.tsx} (100%) rename phone/src/apps/twitter/components/tweet/{TweetMessage.js => TweetMessage.tsx} (83%) rename phone/src/apps/twitter/components/tweet/{TweetSkeleton.js => TweetSkeleton.tsx} (100%) rename phone/src/apps/twitter/components/tweet/{TweetSkeletonList.js => TweetSkeletonList.tsx} (100%) rename phone/src/apps/twitter/hooks/{state.js => state.ts} (100%) rename phone/src/apps/twitter/hooks/{useFilteredTweets.js => useFilteredTweets.ts} (100%) rename phone/src/apps/twitter/hooks/{useModal.js => useModal.ts} (100%) rename phone/src/apps/twitter/hooks/{useProfile.js => useProfile.ts} (100%) rename phone/src/apps/twitter/hooks/{useTweetStatus.js => useTweetStatus.ts} (100%) rename phone/src/apps/twitter/hooks/{useTweets.js => useTweets.ts} (100%) rename phone/src/apps/twitter/hooks/{useTwitterService.js => useTwitterService.ts} (100%) rename phone/src/apps/twitter/utils/{constants.js => constants.ts} (100%) rename phone/src/apps/twitter/utils/{images.js => images.ts} (100%) rename phone/src/apps/twitter/utils/{time.js => time.ts} (88%) rename phone/src/config/hooks/{useConfig.js => useConfig.ts} (64%) rename phone/src/{i18n.js => i18n.ts} (98%) rename phone/src/{index.js => index.tsx} (100%) rename phone/src/modal/components/{CallModal.js => CallModal.tsx} (100%) rename phone/src/modal/hooks/{state.js => state.ts} (100%) rename phone/src/modal/hooks/{useCall.js => useCall.ts} (100%) rename phone/src/modal/hooks/{useCallService.js => useCallService.ts} (100%) rename phone/src/os/apps/hooks/{useApps.js => useApps.tsx} (100%) rename phone/src/os/keyboard/hooks/{useKeyboard.js => useKeyboard.ts} (93%) rename phone/src/os/navigation-bar/components/{Navigation.js => Navigation.tsx} (100%) rename phone/src/os/navigation-bar/hooks/{useNavigationBar.js => useNavigationBar.ts} (100%) rename phone/src/os/notifications/components/{NotificationBar.js => NotificationBar.tsx} (88%) rename phone/src/os/notifications/components/{NotificationIcon.js => NotificationIcon.tsx} (100%) rename phone/src/os/nui-events/hooks/{useNuiEvent.js => useNuiEvent.ts} (100%) rename phone/src/os/nui-events/hooks/{useNuiService.js => useNuiService.ts} (100%) rename phone/src/os/nui-events/utils/{Nui.js => Nui.ts} (100%) rename phone/src/os/nui-events/utils/{nuiUtils.js => nuiUtils.ts} (100%) rename phone/src/os/phone/hooks/{state.js => state.ts} (100%) rename phone/src/os/phone/hooks/{usePhone.js => usePhone.ts} (100%) rename phone/src/os/phone/hooks/{usePhoneService.js => usePhoneService.ts} (100%) rename phone/src/os/simcard/hooks/{state.js => state.ts} (100%) rename phone/src/os/simcard/hooks/{useSimcard.js => useSimcard.ts} (100%) rename phone/src/os/simcard/hooks/{useSimcardService.js => useSimcardService.ts} (100%) create mode 100644 phone/src/react-app-env.d.ts rename phone/src/{serviceWorker.js => serviceWorker.ts} (77%) rename phone/src/{setupTests.js => setupTests.ts} (100%) rename phone/src/ui/components/{AppContent.js => AppContent.tsx} (100%) rename phone/src/ui/components/{AppIcon.js => AppIcon.tsx} (85%) rename phone/src/ui/components/{AppTitle.js => AppTitle.tsx} (100%) rename phone/src/ui/components/{AppWrapper.js => AppWrapper.tsx} (92%) rename phone/src/ui/components/{Button.js => Button.tsx} (100%) rename phone/src/ui/components/{ContextMenu.js => ContextMenu.tsx} (100%) rename phone/src/ui/components/{GridMenu.js => GridMenu.tsx} (100%) rename phone/src/ui/components/{Input.js => Input.tsx} (100%) rename phone/src/ui/components/{List.js => List.tsx} (100%) rename phone/src/ui/components/{ListItem.js => ListItem.tsx} (100%) rename phone/src/ui/components/{Modal.js => Modal.tsx} (100%) delete mode 100644 phone/src/ui/components/index.js create mode 100644 phone/src/ui/components/index.tsx rename phone/src/ui/hooks/{phoneState.js => phoneState.ts} (100%) rename phone/src/ui/hooks/{useContextMenu.js => useContextMenu.tsx} (89%) rename phone/src/ui/hooks/{useModal.js => useModal.ts} (100%) rename phone/src/ui/hooks/{usePhoneService.js => usePhoneService.ts} (100%) create mode 100644 phone/tsconfig.json diff --git a/phone/.babelrc b/phone/.babelrc index 3d4e1f6..58c3cd4 100644 --- a/phone/.babelrc +++ b/phone/.babelrc @@ -1,15 +1,15 @@ { "presets": [ - [ - "@babel/preset-env", - { - "modules": false - } - ], - "@babel/preset-react" + [ + "@babel/preset-env", + { + "modules": false + } + ], + "@babel/preset-react" ], "plugins": [ - "@babel/plugin-proposal-class-properties", - "@babel/plugin-syntax-dynamic-import" + "@babel/plugin-proposal-class-properties", + "@babel/plugin-syntax-dynamic-import" ] -} \ No newline at end of file +} diff --git a/phone/package.json b/phone/package.json index 713d394..45a8efe 100644 --- a/phone/package.json +++ b/phone/package.json @@ -35,6 +35,9 @@ "@babel/plugin-syntax-dynamic-import": "^7.2.0", "@babel/preset-env": "^7.4.5", "@babel/preset-react": "^7.0.0", + "@types/node": "^14.11.5", + "@types/react": "^16.9.51", + "@types/react-dom": "^16.9.8", "babel-eslint": "^10.0.1", "babel-loader": "^8.1.0", "babel-plugin-styled-components": "^1.10.0", @@ -50,6 +53,8 @@ "style-loader": "^0.23.1", "svg-url-loader": "^2.3.2", "terser-webpack-plugin": "^1.3.0", + "ts-loader": "^8.0.4", + "typescript": "^4.0.3", "url-loader": "^1.1.2", "webpack-cli": "^3.3.12" }, @@ -58,8 +63,8 @@ "watch": "cra-build-watch --disable-chunks --build-path ../resources/html --output-filename dev.js", "build": "react-scripts build", "build:resources": "cross-env NODE_ENV=production webpack --config webpack/webpack.resources.js --color -p --progress --hide-modules --display-optimization-bailout", - "test": "react-scripts test --watchAll=false --testMatch **/src/**/*.test.js", - "test:watch": "react-scripts test --watchAll --testMatch **/src/**/*.test.js", + "test": "react-scripts test --watchAll=false --testMatch **/src/**/*.test.[jt]s?(x)", + "test:watch": "react-scripts test --watchAll --testMatch **/src/**/*.test.[jt]s?(x)", "eject": "react-scripts eject" }, "eslintConfig": { diff --git a/phone/react-app-env.d.ts b/phone/react-app-env.d.ts new file mode 100644 index 0000000..6431bc5 --- /dev/null +++ b/phone/react-app-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/phone/src/Phone.test.js b/phone/src/Phone.test.tsx similarity index 100% rename from phone/src/Phone.test.js rename to phone/src/Phone.test.tsx diff --git a/phone/src/Phone.js b/phone/src/Phone.tsx similarity index 100% rename from phone/src/Phone.js rename to phone/src/Phone.tsx diff --git a/phone/src/apps/bank/components/BankApp.js b/phone/src/apps/bank/components/BankApp.tsx similarity index 100% rename from phone/src/apps/bank/components/BankApp.js rename to phone/src/apps/bank/components/BankApp.tsx diff --git a/phone/src/apps/bank/components/transactionList.js b/phone/src/apps/bank/components/transactionList.tsx similarity index 100% rename from phone/src/apps/bank/components/transactionList.js rename to phone/src/apps/bank/components/transactionList.tsx diff --git a/phone/src/apps/bank/hooks/useBank.js b/phone/src/apps/bank/hooks/useBank.js deleted file mode 100644 index ef206c4..0000000 --- a/phone/src/apps/bank/hooks/useBank.js +++ /dev/null @@ -1,31 +0,0 @@ -import { useRecoilState, atom } from 'recoil'; - -const transactionListState = atom({ - key: 'transactionList', - default: [ - { - id: 0, - amount: 300, - type: 'withdraw', - date: '3' - }, - { - id: 1, - amount: 1000, - type: 'withdraw', - date: '3' - }, - { - id: 2, - amount: 50, - type: 'transfer', - date: '2' - }, - ], -}); - -export const useBank = () => { - const [transactionList, setTransactionList] = useRecoilState - (transactionListState); - return { transactionList, setTransactionList }; -} \ No newline at end of file diff --git a/phone/src/apps/bank/hooks/useBank.ts b/phone/src/apps/bank/hooks/useBank.ts new file mode 100644 index 0000000..e4ee679 --- /dev/null +++ b/phone/src/apps/bank/hooks/useBank.ts @@ -0,0 +1,32 @@ +import { useRecoilState, atom } from "recoil"; + +const transactionListState = atom({ + key: "transactionList", + default: [ + { + id: 0, + amount: 300, + type: "withdraw", + date: "3", + }, + { + id: 1, + amount: 1000, + type: "withdraw", + date: "3", + }, + { + id: 2, + amount: 50, + type: "transfer", + date: "2", + }, + ], +}); + +export const useBank = () => { + const [transactionList, setTransactionList] = useRecoilState( + transactionListState + ); + return { transactionList, setTransactionList }; +}; diff --git a/phone/src/apps/calculator/components/Calculator.js b/phone/src/apps/calculator/components/Calculator.tsx similarity index 100% rename from phone/src/apps/calculator/components/Calculator.js rename to phone/src/apps/calculator/components/Calculator.tsx diff --git a/phone/src/apps/calculator/components/CalculatorApp.js b/phone/src/apps/calculator/components/CalculatorApp.tsx similarity index 100% rename from phone/src/apps/calculator/components/CalculatorApp.js rename to phone/src/apps/calculator/components/CalculatorApp.tsx diff --git a/phone/src/apps/calculator/components/CalculatorIcon.js b/phone/src/apps/calculator/components/CalculatorIcon.tsx similarity index 100% rename from phone/src/apps/calculator/components/CalculatorIcon.js rename to phone/src/apps/calculator/components/CalculatorIcon.tsx diff --git a/phone/src/apps/calculator/hooks/useCalculator.js b/phone/src/apps/calculator/hooks/useCalculator.tsx similarity index 100% rename from phone/src/apps/calculator/hooks/useCalculator.js rename to phone/src/apps/calculator/hooks/useCalculator.tsx diff --git a/phone/src/apps/contacts/components/ContactList.js b/phone/src/apps/contacts/components/ContactList.tsx similarity index 100% rename from phone/src/apps/contacts/components/ContactList.js rename to phone/src/apps/contacts/components/ContactList.tsx diff --git a/phone/src/apps/contacts/components/ContactModal.js b/phone/src/apps/contacts/components/ContactModal.tsx similarity index 100% rename from phone/src/apps/contacts/components/ContactModal.js rename to phone/src/apps/contacts/components/ContactModal.tsx diff --git a/phone/src/apps/contacts/components/ContactsApp.js b/phone/src/apps/contacts/components/ContactsApp.tsx similarity index 100% rename from phone/src/apps/contacts/components/ContactsApp.js rename to phone/src/apps/contacts/components/ContactsApp.tsx diff --git a/phone/src/apps/contacts/hooks/state.js b/phone/src/apps/contacts/hooks/state.ts similarity index 100% rename from phone/src/apps/contacts/hooks/state.js rename to phone/src/apps/contacts/hooks/state.ts diff --git a/phone/src/apps/contacts/hooks/useContacts.js b/phone/src/apps/contacts/hooks/useContacts.ts similarity index 100% rename from phone/src/apps/contacts/hooks/useContacts.js rename to phone/src/apps/contacts/hooks/useContacts.ts diff --git a/phone/src/apps/contacts/hooks/useContactsService.js b/phone/src/apps/contacts/hooks/useContactsService.ts similarity index 100% rename from phone/src/apps/contacts/hooks/useContactsService.js rename to phone/src/apps/contacts/hooks/useContactsService.ts diff --git a/phone/src/apps/dialer/components/DialerApp.js b/phone/src/apps/dialer/components/DialerApp.tsx similarity index 100% rename from phone/src/apps/dialer/components/DialerApp.js rename to phone/src/apps/dialer/components/DialerApp.tsx diff --git a/phone/src/apps/dialer/components/DialerHistory.js b/phone/src/apps/dialer/components/DialerHistory.tsx similarity index 100% rename from phone/src/apps/dialer/components/DialerHistory.js rename to phone/src/apps/dialer/components/DialerHistory.tsx diff --git a/phone/src/apps/dialer/hooks/useDialerHistory.js b/phone/src/apps/dialer/hooks/useDialerHistory.ts similarity index 100% rename from phone/src/apps/dialer/hooks/useDialerHistory.js rename to phone/src/apps/dialer/hooks/useDialerHistory.ts diff --git a/phone/src/apps/example/components/ExampleApp.js b/phone/src/apps/example/components/ExampleApp.tsx similarity index 100% rename from phone/src/apps/example/components/ExampleApp.js rename to phone/src/apps/example/components/ExampleApp.tsx diff --git a/phone/src/apps/home/components/Home.js b/phone/src/apps/home/components/Home.tsx similarity index 100% rename from phone/src/apps/home/components/Home.js rename to phone/src/apps/home/components/Home.tsx diff --git a/phone/src/apps/messages/components/MessagesApp.js b/phone/src/apps/messages/components/MessagesApp.tsx similarity index 100% rename from phone/src/apps/messages/components/MessagesApp.js rename to phone/src/apps/messages/components/MessagesApp.tsx diff --git a/phone/src/apps/messages/hooks/useMessages.js b/phone/src/apps/messages/hooks/useMessages.ts similarity index 100% rename from phone/src/apps/messages/hooks/useMessages.js rename to phone/src/apps/messages/hooks/useMessages.ts diff --git a/phone/src/apps/messages/index.js b/phone/src/apps/messages/index.ts similarity index 100% rename from phone/src/apps/messages/index.js rename to phone/src/apps/messages/index.ts diff --git a/phone/src/apps/settings/components/SettingItem.js b/phone/src/apps/settings/components/SettingItem.tsx similarity index 100% rename from phone/src/apps/settings/components/SettingItem.js rename to phone/src/apps/settings/components/SettingItem.tsx diff --git a/phone/src/apps/settings/components/SettingsApp.js b/phone/src/apps/settings/components/SettingsApp.tsx similarity index 100% rename from phone/src/apps/settings/components/SettingsApp.js rename to phone/src/apps/settings/components/SettingsApp.tsx diff --git a/phone/src/apps/settings/hooks/useSettings.js b/phone/src/apps/settings/hooks/useSettings.ts similarity index 100% rename from phone/src/apps/settings/hooks/useSettings.js rename to phone/src/apps/settings/hooks/useSettings.ts diff --git a/phone/src/apps/twitter/components/AddTweetModal.js b/phone/src/apps/twitter/components/AddTweetModal.tsx similarity index 97% rename from phone/src/apps/twitter/components/AddTweetModal.js rename to phone/src/apps/twitter/components/AddTweetModal.tsx index c6d6ea4..8e8b967 100644 --- a/phone/src/apps/twitter/components/AddTweetModal.js +++ b/phone/src/apps/twitter/components/AddTweetModal.tsx @@ -127,7 +127,7 @@ export const AddTweetModal = () => { withValidImage(cleanedLink, () => setImages([...images, image])); setShowImagePrompt(false); - setLink('') + setLink(""); }; const removeImage = (id) => setImages(images.filter((image) => id !== image.id)); @@ -171,7 +171,11 @@ export const AddTweetModal = () => { />
({ export const IconButtons = ({ onImageClick, onEmojiClick }) => { const classes = useStyles(); const { config } = usePhone(); - + if (!config) return null; const { enableImages, enableEmojis } = config.twitter; return (
- {enableImages && ()} - {enableEmojis && ()} + {enableImages && ( + + )} + {enableEmojis && ( + + )}
); }; diff --git a/phone/src/apps/twitter/components/buttons/LikeButton.js b/phone/src/apps/twitter/components/buttons/LikeButton.tsx similarity index 100% rename from phone/src/apps/twitter/components/buttons/LikeButton.js rename to phone/src/apps/twitter/components/buttons/LikeButton.tsx diff --git a/phone/src/apps/twitter/components/buttons/ProfileUpdateButton.js b/phone/src/apps/twitter/components/buttons/ProfileUpdateButton.tsx similarity index 100% rename from phone/src/apps/twitter/components/buttons/ProfileUpdateButton.js rename to phone/src/apps/twitter/components/buttons/ProfileUpdateButton.tsx diff --git a/phone/src/apps/twitter/components/buttons/QuoteButton.js b/phone/src/apps/twitter/components/buttons/QuoteButton.tsx similarity index 100% rename from phone/src/apps/twitter/components/buttons/QuoteButton.js rename to phone/src/apps/twitter/components/buttons/QuoteButton.tsx diff --git a/phone/src/apps/twitter/components/buttons/ReplyButton.js b/phone/src/apps/twitter/components/buttons/ReplyButton.tsx similarity index 100% rename from phone/src/apps/twitter/components/buttons/ReplyButton.js rename to phone/src/apps/twitter/components/buttons/ReplyButton.tsx diff --git a/phone/src/apps/twitter/components/buttons/SearchButton.js b/phone/src/apps/twitter/components/buttons/SearchButton.tsx similarity index 100% rename from phone/src/apps/twitter/components/buttons/SearchButton.js rename to phone/src/apps/twitter/components/buttons/SearchButton.tsx diff --git a/phone/src/apps/twitter/components/buttons/TweetButton.js b/phone/src/apps/twitter/components/buttons/TweetButton.tsx similarity index 100% rename from phone/src/apps/twitter/components/buttons/TweetButton.js rename to phone/src/apps/twitter/components/buttons/TweetButton.tsx diff --git a/phone/src/apps/twitter/components/images/Image.js b/phone/src/apps/twitter/components/images/Image.tsx similarity index 100% rename from phone/src/apps/twitter/components/images/Image.js rename to phone/src/apps/twitter/components/images/Image.tsx diff --git a/phone/src/apps/twitter/components/images/ImageDisplay.js b/phone/src/apps/twitter/components/images/ImageDisplay.tsx similarity index 100% rename from phone/src/apps/twitter/components/images/ImageDisplay.js rename to phone/src/apps/twitter/components/images/ImageDisplay.tsx diff --git a/phone/src/apps/twitter/components/images/ImagePrompt.js b/phone/src/apps/twitter/components/images/ImagePrompt.tsx similarity index 100% rename from phone/src/apps/twitter/components/images/ImagePrompt.js rename to phone/src/apps/twitter/components/images/ImagePrompt.tsx diff --git a/phone/src/apps/twitter/components/profile/Profile.js b/phone/src/apps/twitter/components/profile/Profile.tsx similarity index 97% rename from phone/src/apps/twitter/components/profile/Profile.js rename to phone/src/apps/twitter/components/profile/Profile.tsx index f14690c..292cceb 100644 --- a/phone/src/apps/twitter/components/profile/Profile.js +++ b/phone/src/apps/twitter/components/profile/Profile.tsx @@ -27,7 +27,6 @@ export function Profile() { const { profile } = useProfile(); const { config } = usePhone(); - // note that this assumes we are defensively checking // that profile is not null in a parent above this component. // Annoyingling adding conditionals above this line to not render @@ -50,7 +49,7 @@ export function Profile() { Nui.send("phone:updateTwitterProfile", data); }; - // fetching the config is an asynchronous call so defend against it + // fetching the config is an asynchronous call so defend against it if (!config) return null; const { enableAvatars, allowEdtiableProfileName } = config.twitter; diff --git a/phone/src/apps/twitter/components/profile/ProfileField.js b/phone/src/apps/twitter/components/profile/ProfileField.tsx similarity index 100% rename from phone/src/apps/twitter/components/profile/ProfileField.js rename to phone/src/apps/twitter/components/profile/ProfileField.tsx diff --git a/phone/src/apps/twitter/components/profile/ProfilePrompt.js b/phone/src/apps/twitter/components/profile/ProfilePrompt.tsx similarity index 100% rename from phone/src/apps/twitter/components/profile/ProfilePrompt.js rename to phone/src/apps/twitter/components/profile/ProfilePrompt.tsx diff --git a/phone/src/apps/twitter/components/tweet/Tweet.js b/phone/src/apps/twitter/components/tweet/Tweet.tsx similarity index 100% rename from phone/src/apps/twitter/components/tweet/Tweet.js rename to phone/src/apps/twitter/components/tweet/Tweet.tsx diff --git a/phone/src/apps/twitter/components/tweet/TweetList.js b/phone/src/apps/twitter/components/tweet/TweetList.tsx similarity index 100% rename from phone/src/apps/twitter/components/tweet/TweetList.js rename to phone/src/apps/twitter/components/tweet/TweetList.tsx diff --git a/phone/src/apps/twitter/components/tweet/TweetListContainer.js b/phone/src/apps/twitter/components/tweet/TweetListContainer.tsx similarity index 100% rename from phone/src/apps/twitter/components/tweet/TweetListContainer.js rename to phone/src/apps/twitter/components/tweet/TweetListContainer.tsx diff --git a/phone/src/apps/twitter/components/tweet/TweetMessage.js b/phone/src/apps/twitter/components/tweet/TweetMessage.tsx similarity index 83% rename from phone/src/apps/twitter/components/tweet/TweetMessage.js rename to phone/src/apps/twitter/components/tweet/TweetMessage.tsx index 595ea4e..878817a 100644 --- a/phone/src/apps/twitter/components/tweet/TweetMessage.js +++ b/phone/src/apps/twitter/components/tweet/TweetMessage.tsx @@ -23,8 +23,11 @@ export const TweetMessage = ({ message, handleChange }) => { const { config } = usePhone(); const { t } = useTranslation(); - const overCharacterLimit = message.trim().length > config.twitter.characterLimit; - const characterWarningPrompt = `${t("APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT")} (${config.twitter.characterLimit})`; + const overCharacterLimit = + message.trim().length > config.twitter.characterLimit; + const characterWarningPrompt = `${t( + "APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT" + )} (${config.twitter.characterLimit})`; return ( string, + seconds: number +): string { if (seconds < 60) { return t(JUST_NOW); } else if (seconds < ONE_HOUR) { diff --git a/phone/src/config/hooks/useConfig.js b/phone/src/config/hooks/useConfig.ts similarity index 64% rename from phone/src/config/hooks/useConfig.js rename to phone/src/config/hooks/useConfig.ts index 70ed6b1..4db3ecf 100644 --- a/phone/src/config/hooks/useConfig.js +++ b/phone/src/config/hooks/useConfig.ts @@ -2,17 +2,17 @@ import Default from "../default.json"; import { atom, useRecoilState } from "recoil"; const configState = atom({ - key: 'config', - default: Default -}) + key: "config", + default: Default, +}); export const useConfig = (state = configState) => { - const [config, _setConfig] = useRecoilState(state) + const [config, _setConfig] = useRecoilState(state); const setConfig = (key, value) => { - _setConfig(oldConfig => ({ + _setConfig((oldConfig) => ({ ...oldConfig, - [key]: value + [key]: value, })); }; diff --git a/phone/src/i18n.js b/phone/src/i18n.ts similarity index 98% rename from phone/src/i18n.js rename to phone/src/i18n.ts index 25acb8f..f4ca0de 100644 --- a/phone/src/i18n.js +++ b/phone/src/i18n.ts @@ -3,7 +3,7 @@ import { initReactI18next } from "react-i18next"; import en from "./locale/en.json"; const resources = { - en + en, }; i18n diff --git a/phone/src/index.js b/phone/src/index.tsx similarity index 100% rename from phone/src/index.js rename to phone/src/index.tsx diff --git a/phone/src/modal/components/CallModal.js b/phone/src/modal/components/CallModal.tsx similarity index 100% rename from phone/src/modal/components/CallModal.js rename to phone/src/modal/components/CallModal.tsx diff --git a/phone/src/modal/hooks/state.js b/phone/src/modal/hooks/state.ts similarity index 100% rename from phone/src/modal/hooks/state.js rename to phone/src/modal/hooks/state.ts diff --git a/phone/src/modal/hooks/useCall.js b/phone/src/modal/hooks/useCall.ts similarity index 100% rename from phone/src/modal/hooks/useCall.js rename to phone/src/modal/hooks/useCall.ts diff --git a/phone/src/modal/hooks/useCallService.js b/phone/src/modal/hooks/useCallService.ts similarity index 100% rename from phone/src/modal/hooks/useCallService.js rename to phone/src/modal/hooks/useCallService.ts diff --git a/phone/src/os/apps/hooks/useApps.js b/phone/src/os/apps/hooks/useApps.tsx similarity index 100% rename from phone/src/os/apps/hooks/useApps.js rename to phone/src/os/apps/hooks/useApps.tsx diff --git a/phone/src/os/keyboard/hooks/useKeyboard.js b/phone/src/os/keyboard/hooks/useKeyboard.ts similarity index 93% rename from phone/src/os/keyboard/hooks/useKeyboard.js rename to phone/src/os/keyboard/hooks/useKeyboard.ts index 1fe5c85..0b02a39 100644 --- a/phone/src/os/keyboard/hooks/useKeyboard.js +++ b/phone/src/os/keyboard/hooks/useKeyboard.ts @@ -78,9 +78,12 @@ export const useInitKeyboard = () => { [getters] ); - useEffect(function registerEscapeHandler() { - setEscape({ handler: () => console.log("close phone") }); - }, [setEscape]); + useEffect( + function registerEscapeHandler() { + setEscape({ handler: () => console.log("close phone") }); + }, + [setEscape] + ); }; export const useKeyboard = () => { diff --git a/phone/src/os/navigation-bar/components/Navigation.js b/phone/src/os/navigation-bar/components/Navigation.tsx similarity index 100% rename from phone/src/os/navigation-bar/components/Navigation.js rename to phone/src/os/navigation-bar/components/Navigation.tsx diff --git a/phone/src/os/navigation-bar/hooks/useNavigationBar.js b/phone/src/os/navigation-bar/hooks/useNavigationBar.ts similarity index 100% rename from phone/src/os/navigation-bar/hooks/useNavigationBar.js rename to phone/src/os/navigation-bar/hooks/useNavigationBar.ts diff --git a/phone/src/os/notifications/components/NotificationBar.js b/phone/src/os/notifications/components/NotificationBar.tsx similarity index 88% rename from phone/src/os/notifications/components/NotificationBar.js rename to phone/src/os/notifications/components/NotificationBar.tsx index 8bd028d..2ea2059 100644 --- a/phone/src/os/notifications/components/NotificationBar.js +++ b/phone/src/os/notifications/components/NotificationBar.tsx @@ -20,7 +20,7 @@ const useStyles = makeStyles((theme) => ({ color: theme.palette.text.primary, }, icon: { - padding: '4px', + padding: "4px", color: theme.palette.text.primary, }, })); @@ -36,7 +36,12 @@ export const NotificationBar = ({ notifications = [] }) => { > {notifications.map((notification) => ( - + {notification.icon} ))} diff --git a/phone/src/os/notifications/components/NotificationIcon.js b/phone/src/os/notifications/components/NotificationIcon.tsx similarity index 100% rename from phone/src/os/notifications/components/NotificationIcon.js rename to phone/src/os/notifications/components/NotificationIcon.tsx diff --git a/phone/src/os/nui-events/hooks/useNuiEvent.js b/phone/src/os/nui-events/hooks/useNuiEvent.ts similarity index 100% rename from phone/src/os/nui-events/hooks/useNuiEvent.js rename to phone/src/os/nui-events/hooks/useNuiEvent.ts diff --git a/phone/src/os/nui-events/hooks/useNuiService.js b/phone/src/os/nui-events/hooks/useNuiService.ts similarity index 100% rename from phone/src/os/nui-events/hooks/useNuiService.js rename to phone/src/os/nui-events/hooks/useNuiService.ts diff --git a/phone/src/os/nui-events/utils/Nui.js b/phone/src/os/nui-events/utils/Nui.ts similarity index 100% rename from phone/src/os/nui-events/utils/Nui.js rename to phone/src/os/nui-events/utils/Nui.ts diff --git a/phone/src/os/nui-events/utils/nuiUtils.js b/phone/src/os/nui-events/utils/nuiUtils.ts similarity index 100% rename from phone/src/os/nui-events/utils/nuiUtils.js rename to phone/src/os/nui-events/utils/nuiUtils.ts diff --git a/phone/src/os/phone/hooks/state.js b/phone/src/os/phone/hooks/state.ts similarity index 100% rename from phone/src/os/phone/hooks/state.js rename to phone/src/os/phone/hooks/state.ts diff --git a/phone/src/os/phone/hooks/usePhone.js b/phone/src/os/phone/hooks/usePhone.ts similarity index 100% rename from phone/src/os/phone/hooks/usePhone.js rename to phone/src/os/phone/hooks/usePhone.ts diff --git a/phone/src/os/phone/hooks/usePhoneService.js b/phone/src/os/phone/hooks/usePhoneService.ts similarity index 100% rename from phone/src/os/phone/hooks/usePhoneService.js rename to phone/src/os/phone/hooks/usePhoneService.ts diff --git a/phone/src/os/simcard/hooks/state.js b/phone/src/os/simcard/hooks/state.ts similarity index 100% rename from phone/src/os/simcard/hooks/state.js rename to phone/src/os/simcard/hooks/state.ts diff --git a/phone/src/os/simcard/hooks/useSimcard.js b/phone/src/os/simcard/hooks/useSimcard.ts similarity index 100% rename from phone/src/os/simcard/hooks/useSimcard.js rename to phone/src/os/simcard/hooks/useSimcard.ts diff --git a/phone/src/os/simcard/hooks/useSimcardService.js b/phone/src/os/simcard/hooks/useSimcardService.ts similarity index 100% rename from phone/src/os/simcard/hooks/useSimcardService.js rename to phone/src/os/simcard/hooks/useSimcardService.ts diff --git a/phone/src/react-app-env.d.ts b/phone/src/react-app-env.d.ts new file mode 100644 index 0000000..6431bc5 --- /dev/null +++ b/phone/src/react-app-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/phone/src/serviceWorker.js b/phone/src/serviceWorker.ts similarity index 77% rename from phone/src/serviceWorker.js rename to phone/src/serviceWorker.ts index b04b771..c7cd666 100644 --- a/phone/src/serviceWorker.js +++ b/phone/src/serviceWorker.ts @@ -11,9 +11,9 @@ // opt-in, read https://bit.ly/CRA-PWA const isLocalhost = Boolean( - window.location.hostname === 'localhost' || + window.location.hostname === "localhost" || // [::1] is the IPv6 localhost address. - window.location.hostname === '[::1]' || + window.location.hostname === "[::1]" || // 127.0.0.0/8 are considered localhost for IPv4. window.location.hostname.match( /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ @@ -21,7 +21,7 @@ const isLocalhost = Boolean( ); export function register(config) { - if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { + if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) { // The URL constructor is available in all browsers that support SW. const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); if (publicUrl.origin !== window.location.origin) { @@ -31,7 +31,7 @@ export function register(config) { return; } - window.addEventListener('load', () => { + window.addEventListener("load", () => { const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; if (isLocalhost) { @@ -42,8 +42,8 @@ export function register(config) { // service worker/PWA documentation. navigator.serviceWorker.ready.then(() => { console.log( - 'This web app is being served cache-first by a service ' + - 'worker. To learn more, visit https://bit.ly/CRA-PWA' + "This web app is being served cache-first by a service " + + "worker. To learn more, visit https://bit.ly/CRA-PWA" ); }); } else { @@ -57,21 +57,21 @@ export function register(config) { function registerValidSW(swUrl, config) { navigator.serviceWorker .register(swUrl) - .then(registration => { + .then((registration) => { registration.onupdatefound = () => { const installingWorker = registration.installing; if (installingWorker == null) { return; } installingWorker.onstatechange = () => { - if (installingWorker.state === 'installed') { + if (installingWorker.state === "installed") { if (navigator.serviceWorker.controller) { // At this point, the updated precached content has been fetched, // but the previous service worker will still serve the older // content until all client tabs are closed. console.log( - 'New content is available and will be used when all ' + - 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' + "New content is available and will be used when all " + + "tabs for this page are closed. See https://bit.ly/CRA-PWA." ); // Execute callback @@ -82,7 +82,7 @@ function registerValidSW(swUrl, config) { // At this point, everything has been precached. // It's the perfect time to display a // "Content is cached for offline use." message. - console.log('Content is cached for offline use.'); + console.log("Content is cached for offline use."); // Execute callback if (config && config.onSuccess) { @@ -93,25 +93,25 @@ function registerValidSW(swUrl, config) { }; }; }) - .catch(error => { - console.error('Error during service worker registration:', error); + .catch((error) => { + console.error("Error during service worker registration:", error); }); } function checkValidServiceWorker(swUrl, config) { // Check if the service worker can be found. If it can't reload the page. fetch(swUrl, { - headers: { 'Service-Worker': 'script' }, + headers: { "Service-Worker": "script" }, }) - .then(response => { + .then((response) => { // Ensure service worker exists, and that we really are getting a JS file. - const contentType = response.headers.get('content-type'); + const contentType = response.headers.get("content-type"); if ( response.status === 404 || - (contentType != null && contentType.indexOf('javascript') === -1) + (contentType != null && contentType.indexOf("javascript") === -1) ) { // No service worker found. Probably a different app. Reload the page. - navigator.serviceWorker.ready.then(registration => { + navigator.serviceWorker.ready.then((registration) => { registration.unregister().then(() => { window.location.reload(); }); @@ -123,18 +123,18 @@ function checkValidServiceWorker(swUrl, config) { }) .catch(() => { console.log( - 'No internet connection found. App is running in offline mode.' + "No internet connection found. App is running in offline mode." ); }); } export function unregister() { - if ('serviceWorker' in navigator) { + if ("serviceWorker" in navigator) { navigator.serviceWorker.ready - .then(registration => { + .then((registration) => { registration.unregister(); }) - .catch(error => { + .catch((error) => { console.error(error.message); }); } diff --git a/phone/src/setupTests.js b/phone/src/setupTests.ts similarity index 100% rename from phone/src/setupTests.js rename to phone/src/setupTests.ts diff --git a/phone/src/ui/components/AppContent.js b/phone/src/ui/components/AppContent.tsx similarity index 100% rename from phone/src/ui/components/AppContent.js rename to phone/src/ui/components/AppContent.tsx diff --git a/phone/src/ui/components/AppIcon.js b/phone/src/ui/components/AppIcon.tsx similarity index 85% rename from phone/src/ui/components/AppIcon.js rename to phone/src/ui/components/AppIcon.tsx index f50ab19..c10248e 100644 --- a/phone/src/ui/components/AppIcon.js +++ b/phone/src/ui/components/AppIcon.tsx @@ -10,7 +10,7 @@ const useStyles = makeStyles((theme) => ({ "& > *": { margin: theme.spacing(1), }, - padding: 0 + padding: 0, }, avatar: { backgroundColor: ({ backgroundColor }) => backgroundColor, @@ -18,11 +18,14 @@ const useStyles = makeStyles((theme) => ({ width: theme.spacing(7), height: theme.spacing(7), fontSize: theme.typography.h4.fontSize, - } + }, })); export const AppIcon = ({ name, icon, backgroundColor, color }) => { - const classes = useStyles({ backgroundColor: backgroundColor || green[50], color: color || green[400] }); + const classes = useStyles({ + backgroundColor: backgroundColor || green[50], + color: color || green[400], + }); return (