@bigbinary/neeto-commons-rn 1.8.5 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -0
- package/eslint-config/index.js +84 -17
- package/eslint-config/rules/no-dangling-constants.js +1 -1
- package/lib/typescript/api/app_version.d.ts +10 -0
- package/lib/typescript/api/app_version.d.ts.map +1 -0
- package/lib/typescript/api/auth.d.ts +26 -0
- package/lib/typescript/api/auth.d.ts.map +1 -0
- package/lib/typescript/api/global_roles.d.ts +10 -0
- package/lib/typescript/api/global_roles.d.ts.map +1 -0
- package/lib/typescript/api/notifications.d.ts +38 -0
- package/lib/typescript/api/notifications.d.ts.map +1 -0
- package/lib/typescript/api/organization_roles.d.ts +11 -0
- package/lib/typescript/api/organization_roles.d.ts.map +1 -0
- package/lib/typescript/api/profile.d.ts +15 -0
- package/lib/typescript/api/profile.d.ts.map +1 -0
- package/lib/typescript/api/team_members.d.ts +34 -0
- package/lib/typescript/api/team_members.d.ts.map +1 -0
- package/lib/typescript/auth/index.d.ts +3 -0
- package/lib/typescript/auth/index.d.ts.map +1 -0
- package/lib/typescript/components/AppVersion.d.ts +2 -0
- package/lib/typescript/components/AppVersion.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheet.d.ts +9 -0
- package/lib/typescript/components/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheetMenu.d.ts +7 -0
- package/lib/typescript/components/BottomSheetMenu.d.ts.map +1 -0
- package/lib/typescript/components/ConfirmSheet.d.ts +15 -0
- package/lib/typescript/components/ConfirmSheet.d.ts.map +1 -0
- package/lib/typescript/components/EmptyView.d.ts +19 -0
- package/lib/typescript/components/EmptyView.d.ts.map +1 -0
- package/lib/typescript/components/Header/BaseHeader.d.ts +7 -0
- package/lib/typescript/components/Header/BaseHeader.d.ts.map +1 -0
- package/lib/typescript/components/Header/ScreenHeader.d.ts +7 -0
- package/lib/typescript/components/Header/ScreenHeader.d.ts.map +1 -0
- package/lib/typescript/components/Header.d.ts +22 -0
- package/lib/typescript/components/Header.d.ts.map +1 -0
- package/lib/typescript/components/HyperlinkText.d.ts +17 -0
- package/lib/typescript/components/HyperlinkText.d.ts.map +1 -0
- package/lib/typescript/components/LineLoader.d.ts +13 -0
- package/lib/typescript/components/LineLoader.d.ts.map +1 -0
- package/lib/typescript/components/NotificationIcon.d.ts +6 -0
- package/lib/typescript/components/NotificationIcon.d.ts.map +1 -0
- package/lib/typescript/components/NotificationPreferenceList.d.ts +14 -0
- package/lib/typescript/components/NotificationPreferenceList.d.ts.map +1 -0
- package/lib/typescript/components/OfflineScreen.d.ts +7 -0
- package/lib/typescript/components/OfflineScreen.d.ts.map +1 -0
- package/lib/typescript/components/OrganizationItem.d.ts +8 -0
- package/lib/typescript/components/OrganizationItem.d.ts.map +1 -0
- package/lib/typescript/components/SocialButton.d.ts +11 -0
- package/lib/typescript/components/SocialButton.d.ts.map +1 -0
- package/lib/typescript/components/TextWithUrl.d.ts +7 -0
- package/lib/typescript/components/TextWithUrl.d.ts.map +1 -0
- package/lib/typescript/components/ToggleSwitch.d.ts +8 -0
- package/lib/typescript/components/ToggleSwitch.d.ts.map +1 -0
- package/lib/typescript/components/WorkspaceSwitcherPane.d.ts +9 -0
- package/lib/typescript/components/WorkspaceSwitcherPane.d.ts.map +1 -0
- package/lib/typescript/components/constants.d.ts +7 -0
- package/lib/typescript/components/constants.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +14 -0
- package/lib/typescript/components/index.d.ts.map +1 -0
- package/lib/typescript/config/axios/caseConversion.d.ts +4 -0
- package/lib/typescript/config/axios/caseConversion.d.ts.map +1 -0
- package/lib/typescript/config/axios/constants.d.ts +4 -0
- package/lib/typescript/config/axios/constants.d.ts.map +1 -0
- package/lib/typescript/config/axios/index.d.ts +13 -0
- package/lib/typescript/config/axios/index.d.ts.map +1 -0
- package/lib/typescript/config/axios/networkErrorHandler.d.ts +5 -0
- package/lib/typescript/config/axios/networkErrorHandler.d.ts.map +1 -0
- package/lib/typescript/config/axios/paramsSerializer.d.ts +3 -0
- package/lib/typescript/config/axios/paramsSerializer.d.ts.map +1 -0
- package/lib/typescript/config/axios/types.d.ts +10 -0
- package/lib/typescript/config/axios/types.d.ts.map +1 -0
- package/lib/typescript/config/bugsnag.d.ts +4 -0
- package/lib/typescript/config/bugsnag.d.ts.map +1 -0
- package/lib/typescript/config/dayjs.d.ts +23 -0
- package/lib/typescript/config/dayjs.d.ts.map +1 -0
- package/lib/typescript/config/googleSignin.d.ts +2 -0
- package/lib/typescript/config/googleSignin.d.ts.map +1 -0
- package/lib/typescript/config/index.d.ts +2 -0
- package/lib/typescript/config/index.d.ts.map +1 -0
- package/lib/typescript/config/validations.d.ts +2 -0
- package/lib/typescript/config/validations.d.ts.map +1 -0
- package/lib/typescript/constants/index.d.ts +8 -0
- package/lib/typescript/constants/index.d.ts.map +1 -0
- package/lib/typescript/contexts/index.d.ts +2 -0
- package/lib/typescript/contexts/index.d.ts.map +1 -0
- package/lib/typescript/contexts/localization.d.ts +26 -0
- package/lib/typescript/contexts/localization.d.ts.map +1 -0
- package/lib/typescript/helpers/asyncStore.d.ts +6 -0
- package/lib/typescript/helpers/asyncStore.d.ts.map +1 -0
- package/lib/typescript/helpers/index.d.ts +2 -0
- package/lib/typescript/helpers/index.d.ts.map +1 -0
- package/lib/typescript/helpers/keychain.d.ts +4 -0
- package/lib/typescript/helpers/keychain.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/apnsToken.d.ts +2 -0
- package/lib/typescript/helpers/notifications/apnsToken.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/constants.d.ts +5 -0
- package/lib/typescript/helpers/notifications/constants.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/getDeviceToken.d.ts +2 -0
- package/lib/typescript/helpers/notifications/getDeviceToken.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/index.d.ts +4 -0
- package/lib/typescript/helpers/notifications/index.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/registerBackgroundHandlers.d.ts +3 -0
- package/lib/typescript/helpers/notifications/registerBackgroundHandlers.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/types.d.ts +19 -0
- package/lib/typescript/helpers/notifications/types.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/usePushNotification.d.ts +7 -0
- package/lib/typescript/helpers/notifications/usePushNotification.d.ts.map +1 -0
- package/lib/typescript/helpers/scale.d.ts +2 -0
- package/lib/typescript/helpers/scale.d.ts.map +1 -0
- package/lib/typescript/helpers/utils.d.ts +5 -0
- package/lib/typescript/helpers/utils.d.ts.map +1 -0
- package/lib/typescript/hooks/index.d.ts +3 -0
- package/lib/typescript/hooks/index.d.ts.map +1 -0
- package/lib/typescript/hooks/query/queryKeys.d.ts +9 -0
- package/lib/typescript/hooks/query/queryKeys.d.ts.map +1 -0
- package/lib/typescript/hooks/query/useAppVersionApi.d.ts +2 -0
- package/lib/typescript/hooks/query/useAppVersionApi.d.ts.map +1 -0
- package/lib/typescript/hooks/query/useAuth.d.ts +27 -0
- package/lib/typescript/hooks/query/useAuth.d.ts.map +1 -0
- package/lib/typescript/hooks/query/useNotification.d.ts +19 -0
- package/lib/typescript/hooks/query/useNotification.d.ts.map +1 -0
- package/lib/typescript/hooks/query/useProfile.d.ts +9 -0
- package/lib/typescript/hooks/query/useProfile.d.ts.map +1 -0
- package/lib/typescript/hooks/query/useRolesApi.d.ts +4 -0
- package/lib/typescript/hooks/query/useRolesApi.d.ts.map +1 -0
- package/lib/typescript/hooks/query/useTeamMembersApi.d.ts +23 -0
- package/lib/typescript/hooks/query/useTeamMembersApi.d.ts.map +1 -0
- package/lib/typescript/hooks/useAppState.d.ts +2 -0
- package/lib/typescript/hooks/useAppState.d.ts.map +1 -0
- package/lib/typescript/hooks/usePushNotificationPermissions.d.ts +2 -0
- package/lib/typescript/hooks/usePushNotificationPermissions.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +9 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/initializers/index.d.ts +3 -0
- package/lib/typescript/initializers/index.d.ts.map +1 -0
- package/lib/typescript/initializers/logRocket.d.ts +2 -0
- package/lib/typescript/initializers/logRocket.d.ts.map +1 -0
- package/lib/typescript/localization/i18n.d.ts +4 -0
- package/lib/typescript/localization/i18n.d.ts.map +1 -0
- package/lib/typescript/localization/index.d.ts +7 -0
- package/lib/typescript/localization/index.d.ts.map +1 -0
- package/lib/typescript/navigation/navigationService.d.ts +14 -0
- package/lib/typescript/navigation/navigationService.d.ts.map +1 -0
- package/lib/typescript/navigation/screenNames.d.ts +10 -0
- package/lib/typescript/navigation/screenNames.d.ts.map +1 -0
- package/lib/typescript/navigation/stacks.d.ts +3 -0
- package/lib/typescript/navigation/stacks.d.ts.map +1 -0
- package/lib/typescript/navigation/types.d.ts +24 -0
- package/lib/typescript/navigation/types.d.ts.map +1 -0
- package/lib/typescript/providers/NeetoCommonsRNProvider.d.ts +14 -0
- package/lib/typescript/providers/NeetoCommonsRNProvider.d.ts.map +1 -0
- package/lib/typescript/providers/index.d.ts +2 -0
- package/lib/typescript/providers/index.d.ts.map +1 -0
- package/lib/typescript/screens/NotificationsScreen.d.ts +11 -0
- package/lib/typescript/screens/NotificationsScreen.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/AuthOptions.d.ts +7 -0
- package/lib/typescript/screens/authentication/AuthOptions.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/IncompleteOnboardingInfo.d.ts +4 -0
- package/lib/typescript/screens/authentication/IncompleteOnboardingInfo.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/LoginScreen.d.ts +3 -0
- package/lib/typescript/screens/authentication/LoginScreen.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/OTPVerificationScreen.d.ts +4 -0
- package/lib/typescript/screens/authentication/OTPVerificationScreen.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/Organization.d.ts +11 -0
- package/lib/typescript/screens/authentication/Organization.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/SubDomainScreen.d.ts +4 -0
- package/lib/typescript/screens/authentication/SubDomainScreen.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/constants.d.ts +17 -0
- package/lib/typescript/screens/authentication/constants.d.ts.map +1 -0
- package/lib/typescript/screens/index.d.ts +11 -0
- package/lib/typescript/screens/index.d.ts.map +1 -0
- package/lib/typescript/screens/profile/ChatWidget.d.ts +3 -0
- package/lib/typescript/screens/profile/ChatWidget.d.ts.map +1 -0
- package/lib/typescript/screens/profile/ProfileScreen.d.ts +12 -0
- package/lib/typescript/screens/profile/ProfileScreen.d.ts.map +1 -0
- package/lib/typescript/screens/profile/UserData.d.ts +21 -0
- package/lib/typescript/screens/profile/UserData.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/Add.d.ts +4 -0
- package/lib/typescript/screens/team_members/Add.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/Card.d.ts +9 -0
- package/lib/typescript/screens/team_members/Card.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/Checkbox.d.ts +11 -0
- package/lib/typescript/screens/team_members/Checkbox.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/Edit.d.ts +5 -0
- package/lib/typescript/screens/team_members/Edit.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/Email.d.ts +11 -0
- package/lib/typescript/screens/team_members/Email.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/LoadingCard.d.ts +6 -0
- package/lib/typescript/screens/team_members/LoadingCard.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/ProductSelect.d.ts +11 -0
- package/lib/typescript/screens/team_members/ProductSelect.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/RolesRadioGroup.d.ts +14 -0
- package/lib/typescript/screens/team_members/RolesRadioGroup.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/SaveButtons.d.ts +10 -0
- package/lib/typescript/screens/team_members/SaveButtons.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/constants.d.ts +16 -0
- package/lib/typescript/screens/team_members/constants.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/index.d.ts +16 -0
- package/lib/typescript/screens/team_members/index.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/utils.d.ts +20 -0
- package/lib/typescript/screens/team_members/utils.d.ts.map +1 -0
- package/lib/typescript/slices/auth.d.ts +31 -0
- package/lib/typescript/slices/auth.d.ts.map +1 -0
- package/lib/typescript/slices/index.d.ts +6 -0
- package/lib/typescript/slices/index.d.ts.map +1 -0
- package/lib/typescript/store/hooks.d.ts +6 -0
- package/lib/typescript/store/hooks.d.ts.map +1 -0
- package/lib/typescript/store/index.d.ts +18 -0
- package/lib/typescript/store/index.d.ts.map +1 -0
- package/lib/typescript/store/utils.d.ts +8 -0
- package/lib/typescript/store/utils.d.ts.map +1 -0
- package/lib/typescript/utils/apiHelpers.d.ts +5 -0
- package/lib/typescript/utils/apiHelpers.d.ts.map +1 -0
- package/package.json +267 -70
- package/src/api/app_version.ts +24 -0
- package/src/api/auth.ts +68 -0
- package/src/api/global_roles.ts +15 -0
- package/src/api/notifications.ts +66 -0
- package/src/api/organization_roles.ts +17 -0
- package/src/api/profile.ts +17 -0
- package/src/api/team_members.ts +39 -0
- package/src/assets/images/apple-logo.svg +3 -0
- package/src/assets/images/google-logo.svg +6 -0
- package/src/auth/index.ts +2 -0
- package/src/components/AppVersion.ts +154 -0
- package/src/components/BottomSheet.ts +9 -0
- package/src/components/BottomSheetMenu.ts +6 -0
- package/src/components/ConfirmSheet.ts +15 -0
- package/src/components/EmptyView.tsx +40 -0
- package/src/components/Header/BaseHeader.ts +6 -0
- package/src/components/Header/ScreenHeader.ts +6 -0
- package/src/components/Header.tsx +139 -0
- package/src/components/HyperlinkText.tsx +34 -0
- package/src/components/LineLoader.tsx +23 -0
- package/src/components/NotificationIcon.tsx +53 -0
- package/src/components/NotificationPreferenceList.tsx +132 -0
- package/src/components/OfflineScreen.tsx +89 -0
- package/src/components/OrganizationItem.tsx +67 -0
- package/src/components/SocialButton.tsx +78 -0
- package/src/components/TextWithUrl.ts +6 -0
- package/src/components/ToggleSwitch.tsx +89 -0
- package/src/components/WorkspaceSwitcherPane.tsx +113 -0
- package/src/components/constants.ts +16 -0
- package/src/components/index.ts +13 -0
- package/src/config/axios/caseConversion.ts +60 -0
- package/src/config/axios/constants.ts +17 -0
- package/src/config/axios/index.ts +291 -0
- package/src/config/axios/networkErrorHandler.ts +47 -0
- package/src/config/axios/paramsSerializer.ts +9 -0
- package/src/config/axios/types.ts +13 -0
- package/src/config/bugsnag.ts +48 -0
- package/src/config/dayjs.ts +42 -0
- package/src/config/googleSignin.ts +36 -0
- package/src/config/index.ts +11 -0
- package/src/config/validations.ts +15 -0
- package/src/constants/index.ts +9 -0
- package/src/contexts/index.ts +4 -0
- package/src/contexts/localization.tsx +183 -0
- package/src/helpers/asyncStore.ts +39 -0
- package/src/helpers/index.ts +1 -0
- package/src/helpers/keychain.ts +46 -0
- package/src/helpers/notifications/apnsToken.ts +69 -0
- package/src/helpers/notifications/constants.ts +34 -0
- package/src/helpers/notifications/getDeviceToken.ts +17 -0
- package/src/helpers/notifications/index.ts +3 -0
- package/src/helpers/notifications/registerBackgroundHandlers.ts +62 -0
- package/src/helpers/notifications/types.ts +27 -0
- package/src/helpers/notifications/usePushNotification.ts +208 -0
- package/src/helpers/scale.ts +4 -0
- package/src/helpers/utils.ts +68 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/query/queryKeys.ts +8 -0
- package/src/hooks/query/useAppVersionApi.ts +12 -0
- package/src/hooks/query/useAuth.ts +253 -0
- package/src/hooks/query/useNotification.ts +130 -0
- package/src/hooks/query/useProfile.ts +21 -0
- package/src/hooks/query/useRolesApi.ts +25 -0
- package/src/hooks/query/useTeamMembersApi.ts +109 -0
- package/src/hooks/useAppState.ts +16 -0
- package/src/hooks/usePushNotificationPermissions.ts +111 -0
- package/src/index.ts +8 -0
- package/src/initializers/index.ts +3 -0
- package/src/initializers/logRocket.ts +25 -0
- package/src/localization/i18n.ts +19 -0
- package/src/localization/index.ts +14 -0
- package/src/navigation/navigationService.ts +37 -0
- package/src/navigation/screenNames.ts +11 -0
- package/src/navigation/stacks.tsx +30 -0
- package/src/navigation/types.ts +19 -0
- package/src/providers/NeetoCommonsRNProvider.tsx +77 -0
- package/src/providers/index.ts +1 -0
- package/src/screens/NotificationsScreen.tsx +290 -0
- package/src/screens/authentication/AuthOptions.tsx +254 -0
- package/src/screens/authentication/IncompleteOnboardingInfo.tsx +110 -0
- package/src/screens/authentication/LoginScreen.tsx +170 -0
- package/src/screens/authentication/OTPVerificationScreen.tsx +235 -0
- package/src/screens/authentication/Organization.tsx +102 -0
- package/src/screens/authentication/SubDomainScreen.tsx +176 -0
- package/src/screens/authentication/constants.ts +30 -0
- package/src/screens/index.ts +10 -0
- package/src/screens/profile/ChatWidget.tsx +8 -0
- package/src/screens/profile/ProfileScreen.tsx +251 -0
- package/src/screens/profile/UserData.tsx +92 -0
- package/src/screens/team_members/Add.tsx +248 -0
- package/src/screens/team_members/Card.tsx +124 -0
- package/src/screens/team_members/Checkbox.tsx +88 -0
- package/src/screens/team_members/Edit.tsx +171 -0
- package/src/screens/team_members/Email.tsx +59 -0
- package/src/screens/team_members/LoadingCard.tsx +75 -0
- package/src/screens/team_members/ProductSelect.tsx +218 -0
- package/src/screens/team_members/RolesRadioGroup.tsx +135 -0
- package/src/screens/team_members/SaveButtons.tsx +62 -0
- package/src/screens/team_members/constants.ts +33 -0
- package/src/screens/team_members/index.tsx +223 -0
- package/src/screens/team_members/utils.ts +84 -0
- package/src/slices/auth.ts +86 -0
- package/src/slices/index.ts +7 -0
- package/src/store/hooks.ts +8 -0
- package/src/store/index.ts +47 -0
- package/src/store/utils.ts +36 -0
- package/src/utils/apiHelpers.ts +7 -0
- package/types/assets.d.ts +38 -0
- package/types/neeto-icons-rn.d.ts +548 -0
- package/api/app_version.js +0 -1
- package/api/auth.js +0 -1
- package/api/global_roles.js +0 -1
- package/api/notifications.js +0 -1
- package/api/organization_roles.js +0 -1
- package/api/profile.js +0 -1
- package/api/team_members.js +0 -1
- package/auth/index.d.ts +0 -9
- package/auth/index.js +0 -1
- package/components/AppVersion.js +0 -1
- package/components/BottomSheet.js +0 -1
- package/components/BottomSheetMenu.js +0 -1
- package/components/ConfirmSheet.js +0 -1
- package/components/EmptyView.js +0 -1
- package/components/Header/BaseHeader.js +0 -1
- package/components/Header/ScreenHeader.js +0 -1
- package/components/Header.js +0 -1
- package/components/HyperlinkText.js +0 -1
- package/components/LineLoader.js +0 -1
- package/components/NotificationIcon.js +0 -1
- package/components/OfflineScreen.js +0 -1
- package/components/TextWithUrl.js +0 -1
- package/components/WorkspaceSwitcherPane.js +0 -1
- package/components/constants.js +0 -1
- package/components/index.js +0 -1
- package/config/axios/caseConversion.js +0 -1
- package/config/axios/constants.js +0 -1
- package/config/axios/index.js +0 -1
- package/config/axios/networkErrorHandler.js +0 -1
- package/config/axios/paramsSerializer.js +0 -1
- package/config/bugsnag.js +0 -1
- package/config/dayjs.js +0 -1
- package/config/googleSignin.js +0 -1
- package/config/index.js +0 -1
- package/config/validations.js +0 -1
- package/constants/index.d.ts +0 -5
- package/constants/index.js +0 -1
- package/contexts/index.js +0 -0
- package/contexts/localization.js +0 -1
- package/helpers/asyncStore.js +0 -1
- package/helpers/index.d.ts +0 -13
- package/helpers/index.js +0 -1
- package/helpers/keychain.d.ts +0 -4
- package/helpers/keychain.js +0 -1
- package/helpers/notifications/index.d.ts +0 -8
- package/helpers/notifications/index.js +0 -1
- package/helpers/notifications/usePushNotification.js +0 -1
- package/helpers/scale.js +0 -1
- package/helpers/utils.js +0 -1
- package/hooks/index.d.ts +0 -11
- package/hooks/index.js +0 -1
- package/hooks/query/constants.js +0 -1
- package/hooks/query/queryKeys.js +0 -1
- package/hooks/query/useAppVersionApi.js +0 -1
- package/hooks/query/useAuth.js +0 -1
- package/hooks/query/useNotification.js +0 -1
- package/hooks/query/useProfile.js +0 -1
- package/hooks/query/useRolesApi.js +0 -1
- package/hooks/query/useTeamMembersApi.js +0 -1
- package/hooks/useAppState.js +0 -1
- package/hooks/usePushNotificationPermissions.js +0 -1
- package/initializers/index.js +0 -1
- package/initializers/logRocket.js +0 -1
- package/localization/index.js +0 -1
- package/localization/translations/it.json +0 -13
- package/navigation/navigationService.js +0 -1
- package/navigation/screenNames.js +0 -1
- package/navigation/stacks.js +0 -1
- package/providers/NeetoCommonsRNProvider.js +0 -1
- package/providers/index.d.ts +0 -16
- package/providers/index.js +0 -1
- package/screens/NotificationsScreen.js +0 -1
- package/screens/authentication/AuthOptions.js +0 -1
- package/screens/authentication/IncompleteOnboardingInfo.js +0 -1
- package/screens/authentication/LoginScreen.js +0 -1
- package/screens/authentication/OTPVerificationScreen.js +0 -1
- package/screens/authentication/Organization.js +0 -1
- package/screens/authentication/SubDomainScreen.js +0 -1
- package/screens/authentication/constants.js +0 -1
- package/screens/index.js +0 -1
- package/screens/profile/ChatWidget.js +0 -1
- package/screens/profile/ProfileScreen.js +0 -1
- package/screens/profile/UserData.js +0 -1
- package/screens/team_members/Add.js +0 -1
- package/screens/team_members/Card.js +0 -1
- package/screens/team_members/Checkbox.js +0 -1
- package/screens/team_members/Edit.js +0 -1
- package/screens/team_members/Email.js +0 -1
- package/screens/team_members/LoadingCard.js +0 -1
- package/screens/team_members/ProductSelect.js +0 -1
- package/screens/team_members/RolesRadioGroup.js +0 -1
- package/screens/team_members/SaveButtons.js +0 -1
- package/screens/team_members/constants.js +0 -1
- package/screens/team_members/index.js +0 -1
- package/screens/team_members/utils.js +0 -1
- package/slices/auth.js +0 -1
- package/slices/index.js +0 -1
- package/store/index.d.ts +0 -7
- package/store/index.js +0 -1
- package/store/utils.js +0 -1
- package/utils/apiHelpers.js +0 -1
- /package/{assets → src/assets}/images/empty.svg +0 -0
- /package/{assets → src/assets}/images/wifi.png +0 -0
- /package/{localization → src/localization}/translations/en.json +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
import { Image, StyleSheet } from "react-native";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
Container,
|
|
7
|
+
Toast,
|
|
8
|
+
Typography,
|
|
9
|
+
lightTheme,
|
|
10
|
+
} from "@bigbinary/neetoui-rn";
|
|
11
|
+
import NetInfo from "@react-native-community/netinfo";
|
|
12
|
+
|
|
13
|
+
import Wifi from "../assets/images/wifi.png";
|
|
14
|
+
import { useLocalization } from "../contexts/localization";
|
|
15
|
+
import { moderateScale } from "../helpers/scale";
|
|
16
|
+
|
|
17
|
+
export interface OfflineScreenProps {
|
|
18
|
+
/** NetInfo reports an unknown connection state as `null`. */
|
|
19
|
+
setIsConnected: (isConnected: boolean | null) => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const OfflineScreen = ({ setIsConnected }: OfflineScreenProps) => {
|
|
23
|
+
const { strings } = useLocalization();
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const unsubscribe = NetInfo.addEventListener(state => {
|
|
27
|
+
setIsConnected(state.isConnected);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return () => {
|
|
31
|
+
unsubscribe();
|
|
32
|
+
};
|
|
33
|
+
}, [setIsConnected]);
|
|
34
|
+
|
|
35
|
+
const handleRetry = async () => {
|
|
36
|
+
const netInfo = await NetInfo.fetch();
|
|
37
|
+
setIsConnected(netInfo.isConnected);
|
|
38
|
+
|
|
39
|
+
if (!netInfo.isConnected) {
|
|
40
|
+
Toast.show({
|
|
41
|
+
type: "error",
|
|
42
|
+
text1: strings.commons.alertMessage.noInternetConnection,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Container style={styles.screen}>
|
|
49
|
+
<Container style={styles.content}>
|
|
50
|
+
<Image source={Wifi} style={styles.illustration} />
|
|
51
|
+
<Typography
|
|
52
|
+
color={lightTheme.colors.palette.grey600}
|
|
53
|
+
style={styles.message}
|
|
54
|
+
weight="bold"
|
|
55
|
+
>
|
|
56
|
+
{strings.commons.alertMessage.noInternetConnection}
|
|
57
|
+
</Typography>
|
|
58
|
+
</Container>
|
|
59
|
+
<Button
|
|
60
|
+
label={strings.commons.buttons.tryAgain}
|
|
61
|
+
style={styles.retryButton}
|
|
62
|
+
onPress={handleRetry}
|
|
63
|
+
/>
|
|
64
|
+
</Container>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const styles = StyleSheet.create({
|
|
69
|
+
screen: {
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
justifyContent: "center",
|
|
72
|
+
backgroundColor: lightTheme.colors.white,
|
|
73
|
+
flex: 1,
|
|
74
|
+
},
|
|
75
|
+
content: {
|
|
76
|
+
alignItems: "center",
|
|
77
|
+
},
|
|
78
|
+
illustration: {
|
|
79
|
+
height: moderateScale(100),
|
|
80
|
+
width: moderateScale(100),
|
|
81
|
+
},
|
|
82
|
+
message: {
|
|
83
|
+
marginTop: moderateScale(10),
|
|
84
|
+
},
|
|
85
|
+
retryButton: {
|
|
86
|
+
marginTop: moderateScale(20),
|
|
87
|
+
width: moderateScale(140),
|
|
88
|
+
},
|
|
89
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Linking, StyleSheet } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { Container, Typography, lightTheme } from "@bigbinary/neetoui-rn";
|
|
5
|
+
|
|
6
|
+
import { moderateScale } from "../helpers/scale";
|
|
7
|
+
|
|
8
|
+
// neetoui-rn v2 shipped this; v3 dropped it. Reproduced here against the v3
|
|
9
|
+
// primitives, with the styled-system shorthands the original used rewritten
|
|
10
|
+
// as styles.
|
|
11
|
+
export interface OrganizationItemProps {
|
|
12
|
+
name: string;
|
|
13
|
+
subdomain: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const OrganizationItem = ({
|
|
18
|
+
name,
|
|
19
|
+
subdomain,
|
|
20
|
+
label = "Organization",
|
|
21
|
+
}: OrganizationItemProps) => (
|
|
22
|
+
<Container style={styles.container}>
|
|
23
|
+
<Container style={styles.labelRow}>
|
|
24
|
+
<Typography
|
|
25
|
+
color={lightTheme.colors.palette.grey800}
|
|
26
|
+
size="s"
|
|
27
|
+
weight="medium"
|
|
28
|
+
>
|
|
29
|
+
{label}
|
|
30
|
+
</Typography>
|
|
31
|
+
</Container>
|
|
32
|
+
<Typography
|
|
33
|
+
color={lightTheme.colors.palette.grey700}
|
|
34
|
+
size="m"
|
|
35
|
+
style={styles.name}
|
|
36
|
+
weight="medium"
|
|
37
|
+
>
|
|
38
|
+
{name}
|
|
39
|
+
</Typography>
|
|
40
|
+
<Typography
|
|
41
|
+
color={lightTheme.colors.palette.grey700}
|
|
42
|
+
size="m"
|
|
43
|
+
weight="medium"
|
|
44
|
+
onPress={() => Linking.openURL(`https://${subdomain}`)}
|
|
45
|
+
>
|
|
46
|
+
{subdomain}
|
|
47
|
+
</Typography>
|
|
48
|
+
</Container>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const styles = StyleSheet.create({
|
|
52
|
+
container: {
|
|
53
|
+
justifyContent: "space-between",
|
|
54
|
+
backgroundColor: lightTheme.colors.background.secondary,
|
|
55
|
+
borderRadius: moderateScale(6),
|
|
56
|
+
paddingHorizontal: moderateScale(12),
|
|
57
|
+
paddingVertical: moderateScale(12),
|
|
58
|
+
width: "100%",
|
|
59
|
+
},
|
|
60
|
+
labelRow: {
|
|
61
|
+
alignItems: "center",
|
|
62
|
+
flexDirection: "row",
|
|
63
|
+
},
|
|
64
|
+
name: {
|
|
65
|
+
marginTop: moderateScale(8),
|
|
66
|
+
},
|
|
67
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyleSheet, type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
Container,
|
|
6
|
+
Loader,
|
|
7
|
+
Touchable,
|
|
8
|
+
Typography,
|
|
9
|
+
lightTheme,
|
|
10
|
+
} from "@bigbinary/neetoui-rn";
|
|
11
|
+
|
|
12
|
+
import AppleLogo from "../assets/images/apple-logo.svg";
|
|
13
|
+
import GoogleLogo from "../assets/images/google-logo.svg";
|
|
14
|
+
import { moderateScale } from "../helpers/scale";
|
|
15
|
+
|
|
16
|
+
// neetoui-rn v2 shipped this; v3 dropped it. Reproduced here against the v3
|
|
17
|
+
// primitives, with the styled-system shorthands the original used rewritten
|
|
18
|
+
// as styles.
|
|
19
|
+
export interface SocialButtonProps {
|
|
20
|
+
variant: "apple" | "google";
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
isLoading?: boolean;
|
|
23
|
+
style?: StyleProp<ViewStyle>;
|
|
24
|
+
onPress: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const capitalize = (value: string) =>
|
|
28
|
+
`${value.charAt(0).toUpperCase()}${value.slice(1)}`;
|
|
29
|
+
|
|
30
|
+
export const SocialButton = ({
|
|
31
|
+
variant,
|
|
32
|
+
disabled,
|
|
33
|
+
isLoading,
|
|
34
|
+
style,
|
|
35
|
+
onPress,
|
|
36
|
+
}: SocialButtonProps) => (
|
|
37
|
+
<Touchable
|
|
38
|
+
disabled={disabled}
|
|
39
|
+
rippleConfig={{ color: lightTheme.colors.palette.grey800 }}
|
|
40
|
+
style={[styles.button, style]}
|
|
41
|
+
onPress={onPress}
|
|
42
|
+
>
|
|
43
|
+
{isLoading ? (
|
|
44
|
+
<Loader color={lightTheme.colors.palette.grey800} />
|
|
45
|
+
) : (
|
|
46
|
+
<>
|
|
47
|
+
<Container style={styles.logo}>
|
|
48
|
+
{variant === "apple" && <AppleLogo />}
|
|
49
|
+
{variant === "google" && <GoogleLogo />}
|
|
50
|
+
</Container>
|
|
51
|
+
<Typography
|
|
52
|
+
color={lightTheme.colors.text.primary}
|
|
53
|
+
size="m"
|
|
54
|
+
weight="medium"
|
|
55
|
+
>
|
|
56
|
+
Continue with {capitalize(variant)}
|
|
57
|
+
</Typography>
|
|
58
|
+
</>
|
|
59
|
+
)}
|
|
60
|
+
</Touchable>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const styles = StyleSheet.create({
|
|
64
|
+
button: {
|
|
65
|
+
alignItems: "center",
|
|
66
|
+
justifyContent: "center",
|
|
67
|
+
backgroundColor: "transparent",
|
|
68
|
+
borderColor: lightTheme.colors.palette.grey800,
|
|
69
|
+
borderRadius: moderateScale(8),
|
|
70
|
+
borderWidth: moderateScale(1),
|
|
71
|
+
height: moderateScale(48),
|
|
72
|
+
width: "100%",
|
|
73
|
+
},
|
|
74
|
+
logo: {
|
|
75
|
+
position: "absolute",
|
|
76
|
+
left: moderateScale(17),
|
|
77
|
+
},
|
|
78
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Moved to @bigbinary/neetoui-rn v3. This re-export keeps one
|
|
3
|
+
* deprecation cycle of compatibility and disappears in the next commons
|
|
4
|
+
* major — import TextWithUrl from the UI library instead.
|
|
5
|
+
*/
|
|
6
|
+
export { TextWithUrl } from "@bigbinary/neetoui-rn";
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
|
+
import { Animated, StyleSheet } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { Check, Close } from "@bigbinary/neeto-icons-rn";
|
|
5
|
+
import { Container, Touchable, lightTheme } from "@bigbinary/neetoui-rn";
|
|
6
|
+
|
|
7
|
+
import { TOGGLE_ANIMATION_DURATION, TOGGLE_KNOB_TRAVEL } from "./constants";
|
|
8
|
+
|
|
9
|
+
import { moderateScale } from "../helpers/scale";
|
|
10
|
+
|
|
11
|
+
// neetoui-rn v2 shipped this; v3 dropped it. Reproduced here against the v3
|
|
12
|
+
// primitives, with the styled-system shorthands the original used rewritten
|
|
13
|
+
// as styles.
|
|
14
|
+
export interface ToggleSwitchProps {
|
|
15
|
+
value: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onValueChange?: (value: boolean) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const ToggleSwitch = ({
|
|
21
|
+
value,
|
|
22
|
+
disabled,
|
|
23
|
+
onValueChange,
|
|
24
|
+
}: ToggleSwitchProps) => {
|
|
25
|
+
const knobPosition = useRef(
|
|
26
|
+
new Animated.Value(value ? TOGGLE_KNOB_TRAVEL : 0)
|
|
27
|
+
).current;
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
Animated.timing(knobPosition, {
|
|
31
|
+
toValue: value ? TOGGLE_KNOB_TRAVEL : 0,
|
|
32
|
+
duration: TOGGLE_ANIMATION_DURATION,
|
|
33
|
+
useNativeDriver: false,
|
|
34
|
+
}).start();
|
|
35
|
+
}, [value, knobPosition]);
|
|
36
|
+
|
|
37
|
+
const iconColor = value
|
|
38
|
+
? lightTheme.colors.success
|
|
39
|
+
: lightTheme.colors.palette.grey500;
|
|
40
|
+
const Icon = value ? Check : Close;
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Touchable
|
|
44
|
+
disabled={disabled}
|
|
45
|
+
hitSlop={10}
|
|
46
|
+
style={[
|
|
47
|
+
styles.track,
|
|
48
|
+
{
|
|
49
|
+
backgroundColor: value
|
|
50
|
+
? lightTheme.colors.success
|
|
51
|
+
: lightTheme.colors.palette.grey300,
|
|
52
|
+
},
|
|
53
|
+
disabled && styles.trackDisabled,
|
|
54
|
+
]}
|
|
55
|
+
onPress={() => onValueChange?.(!value)}
|
|
56
|
+
>
|
|
57
|
+
<Animated.View style={{ transform: [{ translateX: knobPosition }] }}>
|
|
58
|
+
<Container style={styles.knob}>
|
|
59
|
+
<Icon
|
|
60
|
+
color={iconColor}
|
|
61
|
+
size={moderateScale(16)}
|
|
62
|
+
viewBox={value ? "0 0 25 27" : "0 0 25 25"}
|
|
63
|
+
/>
|
|
64
|
+
</Container>
|
|
65
|
+
</Animated.View>
|
|
66
|
+
</Touchable>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const styles = StyleSheet.create({
|
|
71
|
+
track: {
|
|
72
|
+
justifyContent: "center",
|
|
73
|
+
borderRadius: moderateScale(75),
|
|
74
|
+
height: moderateScale(28),
|
|
75
|
+
paddingHorizontal: moderateScale(5),
|
|
76
|
+
width: moderateScale(50),
|
|
77
|
+
},
|
|
78
|
+
trackDisabled: {
|
|
79
|
+
opacity: 0.5,
|
|
80
|
+
},
|
|
81
|
+
knob: {
|
|
82
|
+
alignItems: "center",
|
|
83
|
+
justifyContent: "center",
|
|
84
|
+
backgroundColor: lightTheme.colors.white,
|
|
85
|
+
borderRadius: moderateScale(10),
|
|
86
|
+
height: moderateScale(16),
|
|
87
|
+
width: moderateScale(16),
|
|
88
|
+
},
|
|
89
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SafeAreaView, StyleSheet } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { Close } from "@bigbinary/neeto-icons-rn";
|
|
5
|
+
import {
|
|
6
|
+
Container,
|
|
7
|
+
FlashList,
|
|
8
|
+
Touchable,
|
|
9
|
+
Typography,
|
|
10
|
+
lightTheme,
|
|
11
|
+
} from "@bigbinary/neetoui-rn";
|
|
12
|
+
|
|
13
|
+
import { moderateScale } from "../helpers/scale";
|
|
14
|
+
import { useAuth } from "../hooks/query/useAuth";
|
|
15
|
+
import { Organization } from "../screens/authentication/Organization";
|
|
16
|
+
import { type Organization as OrganizationRecord } from "../slices/auth";
|
|
17
|
+
import { useAppSelector } from "../store/hooks";
|
|
18
|
+
|
|
19
|
+
export interface WorkspaceSwitcherPaneProps {
|
|
20
|
+
/** The drawer navigator's navigation object, injected by `drawerContent`. */
|
|
21
|
+
navigation: { closeDrawer: () => void };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const WorkspaceSwitcherPane = ({
|
|
25
|
+
navigation,
|
|
26
|
+
}: WorkspaceSwitcherPaneProps) => {
|
|
27
|
+
const organizations = useAppSelector(state => state.auth.organizations);
|
|
28
|
+
|
|
29
|
+
const { useSelectOrganizationMutation } = useAuth();
|
|
30
|
+
const { mutate: selectOrganization } = useSelectOrganizationMutation();
|
|
31
|
+
|
|
32
|
+
const onOrganizationSelect = ({
|
|
33
|
+
organization,
|
|
34
|
+
}: {
|
|
35
|
+
organization: OrganizationRecord;
|
|
36
|
+
}) => {
|
|
37
|
+
selectOrganization({ organization });
|
|
38
|
+
navigation.closeDrawer();
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Container style={styles.pane}>
|
|
43
|
+
{/*
|
|
44
|
+
The `edges={["top"]}` this used to pass belongs to
|
|
45
|
+
react-native-safe-area-context; react-native's own SafeAreaView never
|
|
46
|
+
read it, so dropping it changes nothing at runtime.
|
|
47
|
+
*/}
|
|
48
|
+
<SafeAreaView style={styles.headerSafeArea}>
|
|
49
|
+
<Container style={styles.headerRow}>
|
|
50
|
+
<Typography size="xl" weight="semibold">
|
|
51
|
+
Switch Workspaces
|
|
52
|
+
</Typography>
|
|
53
|
+
{/*
|
|
54
|
+
Was a text-variant Button carrying the icon through `LeftIcon`.
|
|
55
|
+
v3's Button has no icon slot and requires a label, so the icon is
|
|
56
|
+
hosted by the Touchable the text variant already reduced to.
|
|
57
|
+
*/}
|
|
58
|
+
<Touchable
|
|
59
|
+
hitSlop={moderateScale(8)}
|
|
60
|
+
onPress={() => navigation.closeDrawer()}
|
|
61
|
+
>
|
|
62
|
+
<Close size={moderateScale(20)} />
|
|
63
|
+
</Touchable>
|
|
64
|
+
</Container>
|
|
65
|
+
</SafeAreaView>
|
|
66
|
+
<Container style={styles.listWrapper}>
|
|
67
|
+
<FlashList
|
|
68
|
+
contentContainerStyle={styles.contentContainerStyle}
|
|
69
|
+
data={organizations.filter(org => org.is_onboard !== false)}
|
|
70
|
+
keyExtractor={item => item.id.toString()}
|
|
71
|
+
style={styles.flatListStyle}
|
|
72
|
+
renderItem={({ item }) => (
|
|
73
|
+
<Organization
|
|
74
|
+
isSidePane
|
|
75
|
+
organization={item}
|
|
76
|
+
onOrganizationSelect={onOrganizationSelect}
|
|
77
|
+
/>
|
|
78
|
+
)}
|
|
79
|
+
/>
|
|
80
|
+
</Container>
|
|
81
|
+
</Container>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const styles = StyleSheet.create({
|
|
86
|
+
pane: {
|
|
87
|
+
backgroundColor: lightTheme.colors.white,
|
|
88
|
+
flex: 1,
|
|
89
|
+
padding: moderateScale(8),
|
|
90
|
+
},
|
|
91
|
+
headerSafeArea: {
|
|
92
|
+
flexDirection: "row",
|
|
93
|
+
justifyContent: "space-between",
|
|
94
|
+
marginTop: moderateScale(16),
|
|
95
|
+
paddingHorizontal: moderateScale(16),
|
|
96
|
+
},
|
|
97
|
+
headerRow: {
|
|
98
|
+
alignItems: "center",
|
|
99
|
+
flexDirection: "row",
|
|
100
|
+
marginVertical: moderateScale(10),
|
|
101
|
+
},
|
|
102
|
+
listWrapper: {
|
|
103
|
+
backgroundColor: lightTheme.colors.white,
|
|
104
|
+
flex: 1,
|
|
105
|
+
paddingVertical: moderateScale(8),
|
|
106
|
+
},
|
|
107
|
+
flatListStyle: {
|
|
108
|
+
flex: 1,
|
|
109
|
+
},
|
|
110
|
+
contentContainerStyle: {
|
|
111
|
+
paddingBottom: moderateScale(20),
|
|
112
|
+
},
|
|
113
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Config from "react-native-config";
|
|
2
|
+
|
|
3
|
+
import { moderateScale } from "../helpers/scale";
|
|
4
|
+
|
|
5
|
+
export const ANDROID_APP_LINK = `http://play.google.com/store/apps/details?id=${Config.BUNDLE_IDENTIFIER}`;
|
|
6
|
+
|
|
7
|
+
export const IOS_PROD_APP_LINK = `https://apps.apple.com/us/app/${Config.IOS_APP_ID}`;
|
|
8
|
+
|
|
9
|
+
export const IOS_STAGING_APP_LINK = `https://testflight.apple.com/v1/app/${Config.IOS_APP_ID}`;
|
|
10
|
+
|
|
11
|
+
// ToggleSwitch knob travel and animation.
|
|
12
|
+
export const TOGGLE_KNOB_TRAVEL = moderateScale(24);
|
|
13
|
+
export const TOGGLE_ANIMATION_DURATION = 300;
|
|
14
|
+
|
|
15
|
+
// NotificationPreferenceList title row.
|
|
16
|
+
export const PREFERENCE_TITLE_LINE_HEIGHT = moderateScale(24);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { BaseHeader } from "./Header/BaseHeader";
|
|
2
|
+
export { ScreenHeader } from "./Header/ScreenHeader";
|
|
3
|
+
export { AppVersion } from "./AppVersion";
|
|
4
|
+
export { LineLoader } from "./LineLoader";
|
|
5
|
+
export { Header } from "./Header";
|
|
6
|
+
export { NotificationIcon } from "./NotificationIcon";
|
|
7
|
+
export { default as BottomSheet } from "./BottomSheet";
|
|
8
|
+
export { BottomSheetMenu } from "./BottomSheetMenu";
|
|
9
|
+
export { default as ConfirmSheet } from "./ConfirmSheet";
|
|
10
|
+
export { EmptyView } from "./EmptyView";
|
|
11
|
+
export { TextWithUrl } from "./TextWithUrl";
|
|
12
|
+
export { OfflineScreen } from "./OfflineScreen";
|
|
13
|
+
export { WorkspaceSwitcherPane } from "./WorkspaceSwitcherPane";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
serializeKeysToSnakeCase,
|
|
3
|
+
keysToCamelCase,
|
|
4
|
+
} from "@bigbinary/neeto-cist";
|
|
5
|
+
import Bugsnag, { type NotifiableError } from "@bugsnag/react-native";
|
|
6
|
+
|
|
7
|
+
import { shouldEnableCaseConversion } from "./constants";
|
|
8
|
+
import { type CaseConversionOptions } from "./types";
|
|
9
|
+
|
|
10
|
+
const logCaseConversionError = (
|
|
11
|
+
error: unknown,
|
|
12
|
+
context: Record<string, unknown>
|
|
13
|
+
) => {
|
|
14
|
+
if (!__DEV__) {
|
|
15
|
+
Bugsnag.notify(error as NotifiableError, event => {
|
|
16
|
+
event.severity = "warning";
|
|
17
|
+
event.context = "case_conversion";
|
|
18
|
+
event.addMetadata("caseConversion", {
|
|
19
|
+
...context,
|
|
20
|
+
feature: "case_conversion",
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const convertRequestKeys = (
|
|
27
|
+
data: unknown,
|
|
28
|
+
options: CaseConversionOptions = {}
|
|
29
|
+
) => {
|
|
30
|
+
if (!data || !shouldEnableCaseConversion(options)) return data;
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
return serializeKeysToSnakeCase(data);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
logCaseConversionError(error, {
|
|
36
|
+
type: "request",
|
|
37
|
+
data,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const convertResponseKeys = (
|
|
45
|
+
data: unknown,
|
|
46
|
+
options: CaseConversionOptions = {}
|
|
47
|
+
) => {
|
|
48
|
+
if (!data || !shouldEnableCaseConversion(options)) return data;
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
return keysToCamelCase(data);
|
|
52
|
+
} catch (error) {
|
|
53
|
+
logCaseConversionError(error, {
|
|
54
|
+
type: "response",
|
|
55
|
+
data,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return data;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Config from "react-native-config";
|
|
2
|
+
|
|
3
|
+
import { type CaseConversionOptions } from "./types";
|
|
4
|
+
|
|
5
|
+
export const DEFAULT_CASE_CONVERSION = Config.ENABLE_CASE_CONVERSION === "true";
|
|
6
|
+
|
|
7
|
+
export const shouldEnableCaseConversion = (
|
|
8
|
+
options: CaseConversionOptions = {}
|
|
9
|
+
) => {
|
|
10
|
+
if (!DEFAULT_CASE_CONVERSION) return false;
|
|
11
|
+
|
|
12
|
+
if (options.enableCaseConversion !== undefined) {
|
|
13
|
+
return options.enableCaseConversion;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return DEFAULT_CASE_CONVERSION;
|
|
17
|
+
};
|