@bifold/core 2.2.0 → 2.3.0

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.
Files changed (262) hide show
  1. package/lib/commonjs/App.js +1 -2
  2. package/lib/commonjs/App.js.map +1 -1
  3. package/lib/commonjs/assets/oca-bundles.json +4 -4
  4. package/lib/commonjs/components/inputs/PINInput.js +4 -2
  5. package/lib/commonjs/components/inputs/PINInput.js.map +1 -1
  6. package/lib/commonjs/components/misc/CredentialCard11.js +34 -13
  7. package/lib/commonjs/components/misc/CredentialCard11.js.map +1 -1
  8. package/lib/commonjs/components/modals/DeveloperModal.js +2 -8
  9. package/lib/commonjs/components/modals/DeveloperModal.js.map +1 -1
  10. package/lib/commonjs/components/views/Banner.js +162 -0
  11. package/lib/commonjs/components/views/Banner.js.map +1 -0
  12. package/lib/commonjs/components/views/HeaderWithBanner.js +17 -0
  13. package/lib/commonjs/components/views/HeaderWithBanner.js.map +1 -0
  14. package/lib/commonjs/components/views/KeyboardView.js +21 -8
  15. package/lib/commonjs/components/views/KeyboardView.js.map +1 -1
  16. package/lib/commonjs/container-api.js +1 -0
  17. package/lib/commonjs/container-api.js.map +1 -1
  18. package/lib/commonjs/container-impl.js +2 -0
  19. package/lib/commonjs/container-impl.js.map +1 -1
  20. package/lib/commonjs/contexts/network.js +36 -0
  21. package/lib/commonjs/contexts/network.js.map +1 -1
  22. package/lib/commonjs/contexts/reducers/store.js +30 -14
  23. package/lib/commonjs/contexts/reducers/store.js.map +1 -1
  24. package/lib/commonjs/contexts/store.js +3 -3
  25. package/lib/commonjs/contexts/store.js.map +1 -1
  26. package/lib/commonjs/index.js +0 -8
  27. package/lib/commonjs/index.js.map +1 -1
  28. package/lib/commonjs/localization/en/en.json +3 -0
  29. package/lib/commonjs/localization/fr/fr.json +3 -1
  30. package/lib/commonjs/localization/pt-br/pt-br.json +3 -1
  31. package/lib/commonjs/modules/history/ui/HistorySettings.js.map +1 -1
  32. package/lib/commonjs/modules/openid/screens/OpenIDProofChangeCredential.js +1 -1
  33. package/lib/commonjs/modules/openid/screens/OpenIDProofChangeCredential.js.map +1 -1
  34. package/lib/commonjs/navigators/ContactStack.js +0 -16
  35. package/lib/commonjs/navigators/ContactStack.js.map +1 -1
  36. package/lib/commonjs/navigators/DeliveryStack.js +0 -16
  37. package/lib/commonjs/navigators/DeliveryStack.js.map +1 -1
  38. package/lib/commonjs/navigators/MainStack.js.map +1 -1
  39. package/lib/commonjs/navigators/NotificationStack.js +0 -16
  40. package/lib/commonjs/navigators/NotificationStack.js.map +1 -1
  41. package/lib/commonjs/navigators/OnboardingScreens.js.map +1 -1
  42. package/lib/commonjs/navigators/defaultStackOptions.js +2 -0
  43. package/lib/commonjs/navigators/defaultStackOptions.js.map +1 -1
  44. package/lib/commonjs/screens/Chat.js +11 -1
  45. package/lib/commonjs/screens/Chat.js.map +1 -1
  46. package/lib/commonjs/screens/CredentialDetails.js.map +1 -1
  47. package/lib/commonjs/screens/PINChange.js +9 -6
  48. package/lib/commonjs/screens/PINChange.js.map +1 -1
  49. package/lib/commonjs/screens/PINEnter.js +10 -8
  50. package/lib/commonjs/screens/PINEnter.js.map +1 -1
  51. package/lib/commonjs/screens/PINVerify.js +13 -11
  52. package/lib/commonjs/screens/PINVerify.js.map +1 -1
  53. package/lib/commonjs/screens/Terms.js +1 -19
  54. package/lib/commonjs/screens/Terms.js.map +1 -1
  55. package/lib/commonjs/screens/ToggleBiometry.js +2 -1
  56. package/lib/commonjs/screens/ToggleBiometry.js.map +1 -1
  57. package/lib/commonjs/services/logger.js +32 -8
  58. package/lib/commonjs/services/logger.js.map +1 -1
  59. package/lib/commonjs/types/state.js +4 -0
  60. package/lib/module/App.js +1 -2
  61. package/lib/module/App.js.map +1 -1
  62. package/lib/module/assets/oca-bundles.json +4 -4
  63. package/lib/module/components/inputs/PINInput.js +4 -2
  64. package/lib/module/components/inputs/PINInput.js.map +1 -1
  65. package/lib/module/components/misc/CredentialCard11.js +34 -13
  66. package/lib/module/components/misc/CredentialCard11.js.map +1 -1
  67. package/lib/module/components/modals/DeveloperModal.js +2 -8
  68. package/lib/module/components/modals/DeveloperModal.js.map +1 -1
  69. package/lib/module/components/views/Banner.js +152 -0
  70. package/lib/module/components/views/Banner.js.map +1 -0
  71. package/lib/module/components/views/HeaderWithBanner.js +10 -0
  72. package/lib/module/components/views/HeaderWithBanner.js.map +1 -0
  73. package/lib/module/components/views/KeyboardView.js +22 -9
  74. package/lib/module/components/views/KeyboardView.js.map +1 -1
  75. package/lib/module/container-api.js +1 -0
  76. package/lib/module/container-api.js.map +1 -1
  77. package/lib/module/container-impl.js +2 -0
  78. package/lib/module/container-impl.js.map +1 -1
  79. package/lib/module/contexts/network.js +37 -1
  80. package/lib/module/contexts/network.js.map +1 -1
  81. package/lib/module/contexts/reducers/store.js +30 -14
  82. package/lib/module/contexts/reducers/store.js.map +1 -1
  83. package/lib/module/contexts/store.js +3 -3
  84. package/lib/module/contexts/store.js.map +1 -1
  85. package/lib/module/index.js +1 -2
  86. package/lib/module/index.js.map +1 -1
  87. package/lib/module/localization/en/en.json +3 -0
  88. package/lib/module/localization/fr/fr.json +3 -1
  89. package/lib/module/localization/pt-br/pt-br.json +3 -1
  90. package/lib/module/modules/history/ui/HistorySettings.js.map +1 -1
  91. package/lib/module/modules/openid/screens/OpenIDProofChangeCredential.js +1 -1
  92. package/lib/module/modules/openid/screens/OpenIDProofChangeCredential.js.map +1 -1
  93. package/lib/module/navigators/ContactStack.js +0 -16
  94. package/lib/module/navigators/ContactStack.js.map +1 -1
  95. package/lib/module/navigators/DeliveryStack.js +0 -16
  96. package/lib/module/navigators/DeliveryStack.js.map +1 -1
  97. package/lib/module/navigators/MainStack.js.map +1 -1
  98. package/lib/module/navigators/NotificationStack.js +0 -16
  99. package/lib/module/navigators/NotificationStack.js.map +1 -1
  100. package/lib/module/navigators/OnboardingScreens.js.map +1 -1
  101. package/lib/module/navigators/defaultStackOptions.js +2 -0
  102. package/lib/module/navigators/defaultStackOptions.js.map +1 -1
  103. package/lib/module/screens/Chat.js +11 -1
  104. package/lib/module/screens/Chat.js.map +1 -1
  105. package/lib/module/screens/CredentialDetails.js.map +1 -1
  106. package/lib/module/screens/PINChange.js +9 -6
  107. package/lib/module/screens/PINChange.js.map +1 -1
  108. package/lib/module/screens/PINEnter.js +10 -8
  109. package/lib/module/screens/PINEnter.js.map +1 -1
  110. package/lib/module/screens/PINVerify.js +13 -11
  111. package/lib/module/screens/PINVerify.js.map +1 -1
  112. package/lib/module/screens/Terms.js +1 -19
  113. package/lib/module/screens/Terms.js.map +1 -1
  114. package/lib/module/screens/ToggleBiometry.js +2 -1
  115. package/lib/module/screens/ToggleBiometry.js.map +1 -1
  116. package/lib/module/services/logger.js +32 -8
  117. package/lib/module/services/logger.js.map +1 -1
  118. package/lib/module/types/state.js +1 -1
  119. package/lib/typescript/src/App.d.ts.map +1 -1
  120. package/lib/typescript/src/components/chat/ChatActions.d.ts.map +1 -1
  121. package/lib/typescript/src/components/chat/ChatBubble.d.ts.map +1 -1
  122. package/lib/typescript/src/components/chat/MessageInput.d.ts.map +1 -1
  123. package/lib/typescript/src/components/inputs/PINInput.d.ts +1 -0
  124. package/lib/typescript/src/components/inputs/PINInput.d.ts.map +1 -1
  125. package/lib/typescript/src/components/listItems/ContactCredentialListItem.d.ts.map +1 -1
  126. package/lib/typescript/src/components/misc/CredentialCard11.d.ts.map +1 -1
  127. package/lib/typescript/src/components/misc/CredentialCard11ActionFooter.d.ts.map +1 -1
  128. package/lib/typescript/src/components/misc/PINHeader.d.ts.map +1 -1
  129. package/lib/typescript/src/components/modals/DeveloperModal.d.ts.map +1 -1
  130. package/lib/typescript/src/components/tour/TourOverlay.d.ts.map +1 -1
  131. package/lib/typescript/src/components/views/Banner.d.ts +16 -0
  132. package/lib/typescript/src/components/views/Banner.d.ts.map +1 -0
  133. package/lib/typescript/src/components/views/HeaderWithBanner.d.ts +5 -0
  134. package/lib/typescript/src/components/views/HeaderWithBanner.d.ts.map +1 -0
  135. package/lib/typescript/src/components/views/KeyboardView.d.ts +1 -0
  136. package/lib/typescript/src/components/views/KeyboardView.d.ts.map +1 -1
  137. package/lib/typescript/src/container-api.d.ts +3 -0
  138. package/lib/typescript/src/container-api.d.ts.map +1 -1
  139. package/lib/typescript/src/container-impl.d.ts +1 -0
  140. package/lib/typescript/src/container-impl.d.ts.map +1 -1
  141. package/lib/typescript/src/contexts/navigation.d.ts.map +1 -1
  142. package/lib/typescript/src/contexts/network.d.ts.map +1 -1
  143. package/lib/typescript/src/contexts/reducers/store.d.ts +6 -4
  144. package/lib/typescript/src/contexts/reducers/store.d.ts.map +1 -1
  145. package/lib/typescript/src/contexts/store.d.ts.map +1 -1
  146. package/lib/typescript/src/contexts/theme.d.ts.map +1 -1
  147. package/lib/typescript/src/hooks/chat-messages.d.ts.map +1 -1
  148. package/lib/typescript/src/hooks/connections.d.ts.map +1 -1
  149. package/lib/typescript/src/hooks/credential-card-styles.d.ts +2 -2
  150. package/lib/typescript/src/hooks/credential-card-styles.d.ts.map +1 -1
  151. package/lib/typescript/src/hooks/credentials.d.ts.map +1 -1
  152. package/lib/typescript/src/hooks/developer-mode.d.ts.map +1 -1
  153. package/lib/typescript/src/hooks/notifications.d.ts.map +1 -1
  154. package/lib/typescript/src/hooks/oob.d.ts.map +1 -1
  155. package/lib/typescript/src/hooks/proof-request-templates.d.ts.map +1 -1
  156. package/lib/typescript/src/hooks/proofs.d.ts.map +1 -1
  157. package/lib/typescript/src/hooks/screen-capture.d.ts.map +1 -1
  158. package/lib/typescript/src/hooks/useOnboardingState.d.ts.map +1 -1
  159. package/lib/typescript/src/hooks/usePINValidation.d.ts.map +1 -1
  160. package/lib/typescript/src/index.d.ts +1 -2
  161. package/lib/typescript/src/index.d.ts.map +1 -1
  162. package/lib/typescript/src/localization/index.d.ts.map +1 -1
  163. package/lib/typescript/src/modules/history/ui/HistorySettings.d.ts +2 -3
  164. package/lib/typescript/src/modules/history/ui/HistorySettings.d.ts.map +1 -1
  165. package/lib/typescript/src/modules/openid/hooks/openid.d.ts.map +1 -1
  166. package/lib/typescript/src/modules/openid/offerResolve.d.ts.map +1 -1
  167. package/lib/typescript/src/modules/openid/resolverProof.d.ts.map +1 -1
  168. package/lib/typescript/src/modules/openid/utils/utils.d.ts.map +1 -1
  169. package/lib/typescript/src/navigators/ContactStack.d.ts.map +1 -1
  170. package/lib/typescript/src/navigators/DeliveryStack.d.ts.map +1 -1
  171. package/lib/typescript/src/navigators/MainStack.d.ts.map +1 -1
  172. package/lib/typescript/src/navigators/NotificationStack.d.ts.map +1 -1
  173. package/lib/typescript/src/navigators/OnboardingScreens.d.ts +10 -10
  174. package/lib/typescript/src/navigators/OnboardingScreens.d.ts.map +1 -1
  175. package/lib/typescript/src/navigators/defaultStackOptions.d.ts.map +1 -1
  176. package/lib/typescript/src/onboarding.d.ts.map +1 -1
  177. package/lib/typescript/src/screens/Chat.d.ts.map +1 -1
  178. package/lib/typescript/src/screens/ConfigureMediator.d.ts.map +1 -1
  179. package/lib/typescript/src/screens/CredentialDetails.d.ts +2 -2
  180. package/lib/typescript/src/screens/CredentialDetails.d.ts.map +1 -1
  181. package/lib/typescript/src/screens/JSONDetails.d.ts.map +1 -1
  182. package/lib/typescript/src/screens/OnboardingPages.d.ts.map +1 -1
  183. package/lib/typescript/src/screens/PINChange.d.ts +2 -3
  184. package/lib/typescript/src/screens/PINChange.d.ts.map +1 -1
  185. package/lib/typescript/src/screens/PINEnter.d.ts.map +1 -1
  186. package/lib/typescript/src/screens/PINVerify.d.ts.map +1 -1
  187. package/lib/typescript/src/screens/Terms.d.ts.map +1 -1
  188. package/lib/typescript/src/screens/ToggleBiometry.d.ts.map +1 -1
  189. package/lib/typescript/src/services/keychain.d.ts.map +1 -1
  190. package/lib/typescript/src/services/storage.d.ts.map +1 -1
  191. package/lib/typescript/src/types/navigators.d.ts +1 -0
  192. package/lib/typescript/src/types/navigators.d.ts.map +1 -1
  193. package/lib/typescript/src/types/state.d.ts +2 -1
  194. package/lib/typescript/src/types/state.d.ts.map +1 -1
  195. package/lib/typescript/src/utils/PINValidation.d.ts.map +1 -1
  196. package/lib/typescript/src/utils/agent.d.ts.map +1 -1
  197. package/lib/typescript/src/utils/anonCredsProofRequestMapper.d.ts.map +1 -1
  198. package/lib/typescript/src/utils/contacts.d.ts.map +1 -1
  199. package/lib/typescript/src/utils/credential.d.ts.map +1 -1
  200. package/lib/typescript/src/utils/crypto.d.ts.map +1 -1
  201. package/lib/typescript/src/utils/fileCache.d.ts.map +1 -1
  202. package/lib/typescript/src/utils/helpers.d.ts +1 -3
  203. package/lib/typescript/src/utils/helpers.d.ts.map +1 -1
  204. package/lib/typescript/src/utils/luminance.d.ts.map +1 -1
  205. package/lib/typescript/src/utils/mediatorhelpers.d.ts.map +1 -1
  206. package/lib/typescript/src/utils/migration.d.ts.map +1 -1
  207. package/lib/typescript/src/utils/network.d.ts.map +1 -1
  208. package/lib/typescript/src/utils/oca.d.ts.map +1 -1
  209. package/lib/typescript/src/utils/parsers.d.ts.map +1 -1
  210. package/lib/typescript/src/utils/proofBundle.d.ts.map +1 -1
  211. package/lib/typescript/src/utils/testable.d.ts.map +1 -1
  212. package/package.json +147 -148
  213. package/src/App.tsx +0 -2
  214. package/src/assets/oca-bundles.json +4 -4
  215. package/src/components/buttons/Button.tsx +24 -24
  216. package/src/components/inputs/PINInput.tsx +3 -1
  217. package/src/components/misc/CredentialCard11.tsx +40 -16
  218. package/src/components/modals/DeveloperModal.tsx +1 -2
  219. package/src/components/views/Banner.tsx +174 -0
  220. package/src/components/views/HeaderWithBanner.tsx +17 -0
  221. package/src/components/views/KeyboardView.tsx +23 -9
  222. package/src/container-api.ts +2 -0
  223. package/src/container-impl.ts +2 -0
  224. package/src/contexts/network.tsx +39 -1
  225. package/src/contexts/reducers/store.ts +30 -13
  226. package/src/contexts/store.tsx +1 -1
  227. package/src/index.ts +0 -2
  228. package/src/localization/en/en.json +3 -0
  229. package/src/localization/fr/fr.json +3 -1
  230. package/src/localization/pt-br/pt-br.json +3 -1
  231. package/src/modules/history/ui/HistorySettings.tsx +2 -3
  232. package/src/modules/openid/screens/OpenIDProofChangeCredential.tsx +1 -1
  233. package/src/navigators/ContactStack.tsx +0 -15
  234. package/src/navigators/DeliveryStack.tsx +0 -18
  235. package/src/navigators/MainStack.tsx +6 -3
  236. package/src/navigators/NotificationStack.tsx +0 -18
  237. package/src/navigators/OnboardingScreens.ts +10 -10
  238. package/src/navigators/defaultStackOptions.tsx +2 -0
  239. package/src/screens/Chat.tsx +29 -19
  240. package/src/screens/CredentialDetails.tsx +5 -2
  241. package/src/screens/PINChange.tsx +7 -5
  242. package/src/screens/PINEnter.tsx +6 -7
  243. package/src/screens/PINVerify.tsx +34 -32
  244. package/src/screens/Terms.tsx +3 -13
  245. package/src/screens/ToggleBiometry.tsx +1 -0
  246. package/src/services/logger.ts +8 -8
  247. package/src/types/navigators.ts +1 -0
  248. package/src/types/state.ts +3 -1
  249. package/lib/commonjs/components/network/NetInfo.js +0 -43
  250. package/lib/commonjs/components/network/NetInfo.js.map +0 -1
  251. package/lib/commonjs/hooks/onboarding.js +0 -23
  252. package/lib/commonjs/hooks/onboarding.js.map +0 -1
  253. package/lib/module/components/network/NetInfo.js +0 -36
  254. package/lib/module/components/network/NetInfo.js.map +0 -1
  255. package/lib/module/hooks/onboarding.js +0 -16
  256. package/lib/module/hooks/onboarding.js.map +0 -1
  257. package/lib/typescript/src/components/network/NetInfo.d.ts +0 -3
  258. package/lib/typescript/src/components/network/NetInfo.d.ts.map +0 -1
  259. package/lib/typescript/src/hooks/onboarding.d.ts +0 -2
  260. package/lib/typescript/src/hooks/onboarding.d.ts.map +0 -1
  261. package/src/components/network/NetInfo.tsx +0 -36
  262. package/src/hooks/onboarding.ts +0 -16
@@ -1,8 +1,8 @@
1
- import { TFunction } from 'i18next'
2
- import { TransitionPresets, StackNavigationOptions, StackScreenProps } from '@react-navigation/stack'
3
1
  import { ParamListBase, RouteConfig, StackNavigationState } from '@react-navigation/native'
4
- import { Screens, ScreenOptionsType } from '../types/navigators'
2
+ import { StackNavigationOptions, TransitionPresets } from '@react-navigation/stack'
5
3
  import type { StackNavigationEventMap } from '@react-navigation/stack/lib/typescript/src/types'
4
+ import { TFunction } from 'i18next'
5
+ import { ScreenOptionsType, Screens } from '../types/navigators'
6
6
 
7
7
  type ScreenOptions = RouteConfig<
8
8
  ParamListBase,
@@ -13,14 +13,14 @@ type ScreenOptions = RouteConfig<
13
13
  >
14
14
 
15
15
  interface ScreenComponents {
16
- SplashScreen: React.FC<StackScreenProps<ParamListBase>>
17
- Preface: React.FC<StackScreenProps<ParamListBase>>
16
+ SplashScreen: React.FC
17
+ Preface: React.FC
18
18
  UpdateAvailableScreen: React.FC
19
- Terms: React.FC<StackScreenProps<ParamListBase>>
20
- NameWallet: React.FC<StackScreenProps<ParamListBase>>
21
- Biometry: React.FC<StackScreenProps<ParamListBase>>
22
- PushNotifications: React.FC<StackScreenProps<ParamListBase>>
23
- AttemptLockout: React.FC<StackScreenProps<ParamListBase>>
19
+ Terms: React.FC
20
+ NameWallet: React.FC
21
+ Biometry: React.FC
22
+ PushNotifications: React.FC
23
+ AttemptLockout: React.FC
24
24
  OnboardingScreen: React.FC
25
25
  CreatePINScreen: React.FC
26
26
  EnterPINScreen: React.FC
@@ -7,6 +7,7 @@ import { ITheme, OnboardingTheme } from '../theme'
7
7
  import { ScreenOptionsType, Screens } from '../types/navigators'
8
8
  import { testIdWithKey } from '../utils/testable'
9
9
  import { TOKENS, useServices } from '../container-api'
10
+ import HeaderWithBanner from '../components/views/HeaderWithBanner'
10
11
 
11
12
  export const DefaultScreenOptionsDictionary: ScreenOptionsType = {
12
13
  [Screens.Preface]: {
@@ -94,6 +95,7 @@ export function useDefaultStackOptions({ ColorPallet }: ITheme): StackNavigation
94
95
  },
95
96
  headerTitleAlign: 'center' as 'center' | 'left',
96
97
  headerTitle: (props: { children: React.ReactNode }) => <HeaderTitle {...props} />,
98
+ header: (props) => <HeaderWithBanner {...props} />,
97
99
  headerBackAccessibilityLabel: t('Global.Back'),
98
100
  }
99
101
  )
@@ -1,6 +1,7 @@
1
1
  import { BasicMessageRepository, ConnectionRecord } from '@credo-ts/core'
2
2
  import { useAgent, useBasicMessagesByConnectionId, useConnectionById } from '@credo-ts/react-hooks'
3
3
  import { useIsFocused, useNavigation } from '@react-navigation/native'
4
+ import { useHeaderHeight } from '@react-navigation/elements'
4
5
  import { StackNavigationProp, StackScreenProps } from '@react-navigation/stack'
5
6
  import React, { useCallback, useEffect, useMemo, useState } from 'react'
6
7
  import { useTranslation } from 'react-i18next'
@@ -20,6 +21,7 @@ import { Role } from '../types/chat'
20
21
  import { BasicMessageMetadata, basicMessageCustomMetadata } from '../types/metadata'
21
22
  import { RootStackParams, ContactStackParams, Screens, Stacks } from '../types/navigators'
22
23
  import { getConnectionName } from '../utils/helpers'
24
+ import { KeyboardAvoidingView, Platform } from 'react-native'
23
25
 
24
26
  type ChatProps = StackScreenProps<ContactStackParams, Screens.Chat> | StackScreenProps<RootStackParams, Screens.Chat>
25
27
 
@@ -41,6 +43,7 @@ const Chat: React.FC<ChatProps> = ({ route }) => {
41
43
  const [showActionSlider, setShowActionSlider] = useState(false)
42
44
  const { ChatTheme: theme, Assets } = useTheme()
43
45
  const [theirLabel, setTheirLabel] = useState(getConnectionName(connection, store.preferences.alternateContactNames))
46
+ const headerHeight = useHeaderHeight()
44
47
 
45
48
  // This useEffect is for properly rendering changes to the alt contact name, useMemo did not pick them up
46
49
  useEffect(() => {
@@ -105,25 +108,32 @@ const Chat: React.FC<ChatProps> = ({ route }) => {
105
108
 
106
109
  return (
107
110
  <SafeAreaView edges={['bottom', 'left', 'right']} style={{ flex: 1, paddingTop: 20 }}>
108
- <GiftedChat
109
- messages={chatMessages}
110
- showAvatarForEveryMessage={true}
111
- alignTop
112
- renderAvatar={() => null}
113
- messageIdGenerator={(msg) => msg?._id.toString() || '0'}
114
- renderMessage={(props) => <ChatMessage messageProps={props} />}
115
- renderInputToolbar={(props) => renderInputToolbar(props, theme)}
116
- renderSend={(props) => renderSend(props, theme)}
117
- renderComposer={(props) => renderComposer(props, theme, t('Contacts.TypeHere'))}
118
- disableComposer={!silentAssertConnectedNetwork()}
119
- onSend={onSend}
120
- user={{
121
- _id: Role.me,
122
- }}
123
- renderActions={(props) => renderActions(props, theme, actions)}
124
- onPressActionButton={actions ? () => setShowActionSlider(true) : undefined}
125
- />
126
- {showActionSlider && <ActionSlider onDismiss={onDismiss} actions={actions} />}
111
+ <KeyboardAvoidingView
112
+ style={{ flex: 1 }}
113
+ behavior={Platform.OS === 'ios' ? undefined : 'padding'}
114
+ keyboardVerticalOffset={headerHeight}
115
+ >
116
+ <GiftedChat
117
+ keyboardShouldPersistTaps={'handled'}
118
+ messages={chatMessages}
119
+ showAvatarForEveryMessage={true}
120
+ alignTop
121
+ renderAvatar={() => null}
122
+ messageIdGenerator={(msg) => msg?._id.toString() || '0'}
123
+ renderMessage={(props) => <ChatMessage messageProps={props} />}
124
+ renderInputToolbar={(props) => renderInputToolbar(props, theme)}
125
+ renderSend={(props) => renderSend(props, theme)}
126
+ renderComposer={(props) => renderComposer(props, theme, t('Contacts.TypeHere'))}
127
+ disableComposer={!silentAssertConnectedNetwork()}
128
+ onSend={onSend}
129
+ user={{
130
+ _id: Role.me,
131
+ }}
132
+ renderActions={(props) => renderActions(props, theme, actions)}
133
+ onPressActionButton={actions ? () => setShowActionSlider(true) : undefined}
134
+ />
135
+ {showActionSlider && <ActionSlider onDismiss={onDismiss} actions={actions} />}
136
+ </KeyboardAvoidingView>
127
137
  </SafeAreaView>
128
138
  )
129
139
  }
@@ -22,7 +22,7 @@ import { TOKENS, useServices } from '../container-api'
22
22
  import { useTheme } from '../contexts/theme'
23
23
  import { BifoldError } from '../types/error'
24
24
  import { CredentialMetadata, credentialCustomMetadata } from '../types/metadata'
25
- import { RootStackParams, Screens, Stacks } from '../types/navigators'
25
+ import { ContactStackParams, NotificationStackParams, RootStackParams, Screens, Stacks } from '../types/navigators'
26
26
  import { ModalUsage } from '../types/remove'
27
27
  import { credentialTextColor, getCredentialIdentifiers, isValidAnonCredsCredential } from '../utils/credential'
28
28
  import { formatTime, useCredentialConnectionLabel } from '../utils/helpers'
@@ -36,7 +36,10 @@ import CredentialDetailSecondaryHeader from '../components/views/CredentialDetai
36
36
  import { ThemedText } from '../components/texts/ThemedText'
37
37
  import CardWatermark from '../components/misc/CardWatermark'
38
38
 
39
- type CredentialDetailsProps = StackScreenProps<RootStackParams, Screens.CredentialDetails>
39
+ type CredentialDetailsProps = StackScreenProps<
40
+ RootStackParams & ContactStackParams & NotificationStackParams,
41
+ Screens.CredentialDetails
42
+ >
40
43
 
41
44
  const paddingHorizontal = 24
42
45
  const paddingVertical = 16
@@ -1,4 +1,4 @@
1
- import { ParamListBase, useNavigation } from '@react-navigation/native'
1
+ import { useNavigation } from '@react-navigation/native'
2
2
  import { StackNavigationProp, StackScreenProps } from '@react-navigation/stack'
3
3
  import React, { useCallback, useMemo, useRef, useState } from 'react'
4
4
  import { useTranslation } from 'react-i18next'
@@ -13,7 +13,6 @@ import {
13
13
  View,
14
14
  } from 'react-native'
15
15
 
16
- // eslint-disable-next-line import/no-named-as-default
17
16
  import { ButtonType } from '../components/buttons/Button-api'
18
17
  import PINInput from '../components/inputs/PINInput'
19
18
  import PINValidationHelper from '../components/misc/PINValidationHelper'
@@ -29,11 +28,11 @@ import usePreventScreenCapture from '../hooks/screen-capture'
29
28
  import { usePINValidation } from '../hooks/usePINValidation'
30
29
  import { HistoryCardType, HistoryRecord } from '../modules/history/types'
31
30
  import { BifoldError } from '../types/error'
32
- import { OnboardingStackParams, Screens } from '../types/navigators'
31
+ import { OnboardingStackParams, Screens, SettingStackParams } from '../types/navigators'
33
32
  import { useAppAgent } from '../utils/agent'
34
33
  import { testIdWithKey } from '../utils/testable'
35
34
 
36
- const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> = () => {
35
+ const PINChange: React.FC<StackScreenProps<SettingStackParams, Screens.ChangePIN>> = () => {
37
36
  const { agent } = useAppAgent()
38
37
  const { checkWalletPIN, rekeyWallet } = useAuth()
39
38
  const [PIN, setPIN] = useState('')
@@ -174,7 +173,7 @@ const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> =
174
173
  }, [inlineMessages, isLoading, PIN, PINTwo, PINOld])
175
174
 
176
175
  return (
177
- <KeyboardView>
176
+ <KeyboardView keyboardAvoiding={false}>
178
177
  <View style={style.screenContainer}>
179
178
  <View style={style.contentContainer}>
180
179
  <PINHeader updatePin />
@@ -185,6 +184,7 @@ const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> =
185
184
  onPINChanged={(p: string) => {
186
185
  setPINOld(p)
187
186
  }}
187
+ onSubmitEditing={handleChangePinTap}
188
188
  />
189
189
  <PINInput
190
190
  label={t('PINChange.EnterPINTitle')}
@@ -202,6 +202,7 @@ const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> =
202
202
  accessibilityLabel={t('PINCreate.EnterPIN')}
203
203
  autoFocus={false}
204
204
  inlineMessage={inlineMessageField1}
205
+ onSubmitEditing={handleChangePinTap}
205
206
  />
206
207
  <PINInput
207
208
  label={t('PINChange.ReenterPIN')}
@@ -220,6 +221,7 @@ const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> =
220
221
  autoFocus={false}
221
222
  ref={PINTwoInputRef}
222
223
  inlineMessage={inlineMessageField2}
224
+ onSubmitEditing={handleChangePinTap}
223
225
  />
224
226
  {PINSecurity.displayHelper && <PINValidationHelper validations={PINValidations} />}
225
227
  {modalState.visible && (
@@ -19,7 +19,6 @@ import { useStore } from '../contexts/store'
19
19
  import { useTheme } from '../contexts/theme'
20
20
  import { useDeveloperMode } from '../hooks/developer-mode'
21
21
  import { useLockout } from '../hooks/lockout'
22
- import { useGotoPostAuthScreens } from '../hooks/onboarding'
23
22
  import usePreventScreenCapture from '../hooks/screen-capture'
24
23
  import { BifoldError } from '../types/error'
25
24
  import { testIdWithKey } from '../utils/testable'
@@ -61,7 +60,6 @@ const PINEnter: React.FC<PINEnterProps> = ({ setAuthenticated }) => {
61
60
  setDevModalVisible(true)
62
61
  }
63
62
  const { incrementDeveloperMenuCounter } = useDeveloperMode(onDevModeTriggered)
64
- const gotoPostAuthScreens = useGotoPostAuthScreens()
65
63
  const isContinueDisabled = inlineMessages.enabled ? !continueEnabled : !continueEnabled || PIN.length < minPINLength
66
64
  usePreventScreenCapture(preventScreenCapture)
67
65
 
@@ -89,9 +87,8 @@ const PINEnter: React.FC<PINEnterProps> = ({ setAuthenticated }) => {
89
87
  payload: [{ loginAttempts: 0 }],
90
88
  })
91
89
  setAuthenticated(true)
92
- gotoPostAuthScreens()
93
90
  }
94
- }, [getWalletSecret, dispatch, setAuthenticated, gotoPostAuthScreens])
91
+ }, [getWalletSecret, dispatch, setAuthenticated])
95
92
 
96
93
  useEffect(() => {
97
94
  const handle = InteractionManager.runAfterInteractions(async () => {
@@ -189,7 +186,6 @@ const PINEnter: React.FC<PINEnterProps> = ({ setAuthenticated }) => {
189
186
  payload: [{ displayNotification: false }],
190
187
  })
191
188
  setAuthenticated(true)
192
- gotoPostAuthScreens()
193
189
  } catch (err: unknown) {
194
190
  const error = new BifoldError(
195
191
  t('Error.Title1041'),
@@ -207,7 +203,6 @@ const PINEnter: React.FC<PINEnterProps> = ({ setAuthenticated }) => {
207
203
  getLockoutPenalty,
208
204
  dispatch,
209
205
  setAuthenticated,
210
- gotoPostAuthScreens,
211
206
  t,
212
207
  attemptLockout,
213
208
  inlineMessages,
@@ -316,7 +311,7 @@ const PINEnter: React.FC<PINEnterProps> = ({ setAuthenticated }) => {
316
311
  ])
317
312
 
318
313
  return (
319
- <KeyboardView>
314
+ <KeyboardView keyboardAvoiding={false}>
320
315
  <View style={style.screenContainer}>
321
316
  <View>
322
317
  <Pressable
@@ -333,12 +328,16 @@ const PINEnter: React.FC<PINEnterProps> = ({ setAuthenticated }) => {
333
328
  setPIN(p)
334
329
  if (p.length === minPINLength) {
335
330
  Keyboard.dismiss()
331
+ onPINInputCompleted(p)
336
332
  }
337
333
  }}
338
334
  testID={testIdWithKey('EnterPIN')}
339
335
  accessibilityLabel={t('PINEnter.EnterPIN')}
340
336
  autoFocus={true}
341
337
  inlineMessage={inlineMessageField}
338
+ onSubmitEditing={() => {
339
+ onPINInputCompleted(PIN)
340
+ }}
342
341
  />
343
342
  <ThemedText
344
343
  variant="bold"
@@ -37,8 +37,6 @@ const PINVerify: React.FC<Props> = ({ setAuthenticated, usage = PINEntryUsage.PI
37
37
  const { ColorPallet } = useTheme()
38
38
  const { ButtonLoading } = useAnimatedComponents()
39
39
  const [inlineMessageField, setInlineMessageField] = useState<InlineMessageProps>()
40
- // Temporary until all use cases are built with the new design
41
- const isNewDesign = usage === PINEntryUsage.ChangeBiometrics
42
40
  const [{ preventScreenCapture }] = useServices([TOKENS.CONFIG])
43
41
  usePreventScreenCapture(preventScreenCapture)
44
42
 
@@ -97,61 +95,65 @@ const PINVerify: React.FC<Props> = ({ setAuthenticated, usage = PINEntryUsage.PI
97
95
  flex: 1,
98
96
  padding: 20,
99
97
  backgroundColor: ColorPallet.brand.primaryBackground,
100
- justifyContent: isNewDesign ? 'flex-start' : 'space-between',
98
+ justifyContent: 'space-between',
101
99
  },
102
100
  buttonContainer: {
103
- marginTop: 'auto',
104
101
  width: '100%',
105
102
  },
106
103
  helpText: {
107
104
  alignSelf: 'auto',
108
105
  textAlign: 'left',
109
- marginBottom: isNewDesign ? 40 : 20,
106
+ marginBottom: 40,
110
107
  },
111
108
  inputLabelText: {
112
109
  alignSelf: 'auto',
113
110
  textAlign: 'left',
114
- marginBottom: isNewDesign ? 20 : 4,
111
+ marginBottom: 20,
115
112
  },
116
113
  modalText: {
117
114
  marginVertical: 5,
118
115
  },
119
116
  changeBiometricsHeader: {
120
117
  marginTop: 0,
121
- marginBottom: isNewDesign ? 40 : 20,
118
+ marginBottom: 40,
122
119
  },
123
120
  })
124
121
 
125
122
  return (
126
- <KeyboardView>
123
+ <KeyboardView keyboardAvoiding={false}>
127
124
  <View style={style.screenContainer}>
128
- {usage === PINEntryUsage.ChangeBiometrics && (
129
- <ThemedText variant="headingTwo" style={style.changeBiometricsHeader}>
130
- {t('PINEnter.ChangeBiometricsHeader')}
131
- </ThemedText>
132
- )}
133
- <ThemedText style={style.helpText}>{helpText[usage]}</ThemedText>
134
- <ThemedText variant="bold" style={style.inputLabelText}>
135
- {inputLabelText[usage]}
125
+ <View>
136
126
  {usage === PINEntryUsage.ChangeBiometrics && (
137
- <ThemedText variant="caption">
138
- {` `}
139
- {t('PINEnter.ChangeBiometricsInputLabelParenthesis')}
127
+ <ThemedText variant="headingTwo" style={style.changeBiometricsHeader}>
128
+ {t('PINEnter.ChangeBiometricsHeader')}
140
129
  </ThemedText>
141
130
  )}
142
- </ThemedText>
143
- <PINInput
144
- onPINChanged={(p: string) => {
145
- setPIN(p)
146
- if (p.length === minPINLength) {
147
- Keyboard.dismiss()
148
- }
149
- }}
150
- testID={testIdWithKey(inputTestId[usage])}
151
- accessibilityLabel={inputLabelText[usage]}
152
- autoFocus={true}
153
- inlineMessage={inlineMessageField}
154
- />
131
+ <ThemedText style={style.helpText}>{helpText[usage]}</ThemedText>
132
+ <ThemedText variant="bold" style={style.inputLabelText}>
133
+ {inputLabelText[usage]}
134
+ {usage === PINEntryUsage.ChangeBiometrics && (
135
+ <ThemedText variant="caption">
136
+ {` `}
137
+ {t('PINEnter.ChangeBiometricsInputLabelParenthesis')}
138
+ </ThemedText>
139
+ )}
140
+ </ThemedText>
141
+ <PINInput
142
+ onPINChanged={(p: string) => {
143
+ setPIN(p)
144
+ if (p.length === minPINLength) {
145
+ Keyboard.dismiss()
146
+ }
147
+ }}
148
+ testID={testIdWithKey(inputTestId[usage])}
149
+ accessibilityLabel={inputLabelText[usage]}
150
+ autoFocus={true}
151
+ inlineMessage={inlineMessageField}
152
+ onSubmitEditing={async () => {
153
+ await onPINInputCompleted()
154
+ }}
155
+ />
156
+ </View>
155
157
  <View style={style.buttonContainer}>
156
158
  <Button
157
159
  title={primaryButtonText[usage]}
@@ -27,25 +27,14 @@ const Terms: React.FC = () => {
27
27
  const navigation = useNavigation<StackNavigationProp<OnboardingStackParams>>()
28
28
  const { OnboardingTheme, TextTheme } = useTheme()
29
29
  const [Button] = useServices([TOKENS.COMP_BUTTON])
30
+
30
31
  const onSubmitPressed = useCallback(() => {
31
32
  dispatch({
32
33
  type: DispatchAction.DID_AGREE_TO_TERMS,
33
34
  payload: [{ DidAgreeToTerms: TermsVersion }],
34
35
  })
36
+ }, [dispatch])
35
37
 
36
- if (!(agreedToPreviousTerms && store.onboarding.didCreatePIN)) {
37
- navigation.navigate(Screens.CreatePIN)
38
- } else if (store.onboarding.postAuthScreens.length) {
39
- const screens: string[] = store.onboarding.postAuthScreens
40
- screens.shift()
41
- dispatch({ type: DispatchAction.SET_POST_AUTH_SCREENS, payload: [screens] })
42
- if (screens.length) {
43
- navigation.navigate(screens[0] as never)
44
- } else {
45
- dispatch({ type: DispatchAction.DID_COMPLETE_ONBOARDING, payload: [true] })
46
- }
47
- }
48
- }, [dispatch, agreedToPreviousTerms, navigation, store.onboarding.postAuthScreens, store.onboarding.didCreatePIN])
49
38
  const style = StyleSheet.create({
50
39
  container: {
51
40
  ...OnboardingTheme.container,
@@ -60,6 +49,7 @@ const Terms: React.FC = () => {
60
49
  marginBottom: 20,
61
50
  },
62
51
  })
52
+
63
53
  const onBackPressed = () => {
64
54
  //TODO:(jl) goBack() does not unwind the navigation stack but rather goes
65
55
  //back to the splash screen. Needs fixing before the following code will
@@ -136,6 +136,7 @@ const ToggleBiometry: React.FC = () => {
136
136
  transparent={false}
137
137
  animationType={'slide'}
138
138
  presentationStyle={'fullScreen'}
139
+ statusBarTranslucent={true}
139
140
  >
140
141
  <SafeAreaView edges={['top']} style={{ backgroundColor: NavigationTheme.colors.primary }} />
141
142
  <FauxHeader title={t('Screens.EnterPIN')} onBackPressed={onBackPressed} />
@@ -35,34 +35,34 @@ export class BifoldLogger extends BaseLogger {
35
35
  }
36
36
 
37
37
  public test(message: string, data?: object | undefined): void {
38
- this._log?.test(message, data)
38
+ this._log?.test({ message, data })
39
39
  }
40
40
 
41
41
  public trace(message: string, data?: object | undefined): void {
42
- this._log?.trace(message, data)
42
+ this._log?.trace({ message, data })
43
43
  }
44
44
 
45
45
  public debug(message: string, data?: object | undefined): void {
46
- this._log?.debug(message, data)
46
+ this._log?.debug({ message, data })
47
47
  }
48
48
 
49
49
  public info(message: string, data?: object | undefined): void {
50
- this._log?.info(message, data)
50
+ this._log?.info({ message, data })
51
51
  }
52
52
 
53
53
  public warn(message: string, data?: object | undefined): void {
54
- this._log?.warn(message, data)
54
+ this._log?.warn({ message, data })
55
55
  }
56
56
 
57
57
  public error(message: string, data?: object | undefined): void {
58
- this._log?.error(message, data)
58
+ this._log?.error({ message, data })
59
59
  }
60
60
 
61
61
  public fatal(message: string, data?: object | undefined): void {
62
- this._log?.fatal(message, data)
62
+ this._log?.fatal({ message, data })
63
63
  }
64
64
 
65
65
  public report(bifoldError: BifoldError): void {
66
- this._log?.info('No remote logging configured, report not sent for error:', bifoldError)
66
+ this._log?.info({ message: 'No remote logging configured, report not sent for error:', data: bifoldError.message })
67
67
  }
68
68
  }
@@ -86,6 +86,7 @@ export type RootStackParams = {
86
86
  [Stacks.TabStack]: NavigatorScreenParams<TabStackParams>
87
87
  [Screens.Chat]: { connectionId: string }
88
88
  [Stacks.ConnectStack]: NavigatorScreenParams<ConnectStackParams>
89
+ [Stacks.ConnectionStack]: NavigatorScreenParams<DeliveryStackParams>
89
90
  [Stacks.SettingStack]: NavigatorScreenParams<SettingStackParams>
90
91
  [Stacks.ContactStack]: NavigatorScreenParams<ContactStackParams>
91
92
  [Stacks.ProofRequestsStack]: NavigatorScreenParams<ProofRequestsStackParams>
@@ -1,3 +1,5 @@
1
+ import { BannerMessage } from '../components/views/Banner'
2
+
1
3
  export interface Onboarding {
2
4
  didSeePreface: boolean
3
5
  didCompleteTutorial: boolean
@@ -8,7 +10,6 @@ export interface Onboarding {
8
10
  didNameWallet: boolean
9
11
  onboardingVersion: number
10
12
  didCompleteOnboarding: boolean
11
- postAuthScreens: string[]
12
13
  }
13
14
 
14
15
  export interface Migration {
@@ -35,6 +36,7 @@ export interface Preferences {
35
36
  theme?: string
36
37
  selectedMediator: string
37
38
  availableMediators: string[]
39
+ bannerMessages: BannerMessage[]
38
40
  }
39
41
 
40
42
  export interface Tours {
@@ -1,43 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _reactI18next = require("react-i18next");
9
- var _reactNativeToastMessage = _interopRequireDefault(require("react-native-toast-message"));
10
- var _network = require("../../contexts/network");
11
- var _BaseToast = require("../toast/BaseToast");
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- const NetInfo = () => {
14
- const {
15
- assertInternetReachable
16
- } = (0, _network.useNetwork)();
17
- const {
18
- t
19
- } = (0, _reactI18next.useTranslation)();
20
- const [hasShown, setHasShown] = (0, _react.useState)(false);
21
- const showNetworkWarning = (0, _react.useCallback)(() => {
22
- setHasShown(true);
23
- _reactNativeToastMessage.default.show({
24
- type: _BaseToast.ToastType.Error,
25
- autoHide: true,
26
- text1: t('NetInfo.NoInternetConnectionTitle')
27
- });
28
- }, [t]);
29
- (0, _react.useEffect)(() => {
30
- const internetReachable = assertInternetReachable();
31
- if (internetReachable) {
32
- _reactNativeToastMessage.default.hide();
33
- }
34
-
35
- // Strict check for false, null means the network state is not yet known
36
- if (internetReachable === false && !hasShown) {
37
- showNetworkWarning();
38
- }
39
- }, [showNetworkWarning, assertInternetReachable, hasShown]);
40
- return null;
41
- };
42
- var _default = exports.default = NetInfo;
43
- //# sourceMappingURL=NetInfo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_reactI18next","_reactNativeToastMessage","_interopRequireDefault","_network","_BaseToast","e","__esModule","default","NetInfo","assertInternetReachable","useNetwork","t","useTranslation","hasShown","setHasShown","useState","showNetworkWarning","useCallback","Toast","show","type","ToastType","Error","autoHide","text1","useEffect","internetReachable","hide","_default","exports"],"sourceRoot":"../../../../src","sources":["components/network/NetInfo.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,wBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAA8C,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C,MAAMG,OAAiB,GAAGA,CAAA,KAAM;EAC9B,MAAM;IAAEC;EAAwB,CAAC,GAAG,IAAAC,mBAAU,EAAC,CAAC;EAChD,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,4BAAc,EAAC,CAAC;EAC9B,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAE/C,MAAMC,kBAAkB,GAAG,IAAAC,kBAAW,EAAC,MAAM;IAC3CH,WAAW,CAAC,IAAI,CAAC;IACjBI,gCAAK,CAACC,IAAI,CAAC;MACTC,IAAI,EAAEC,oBAAS,CAACC,KAAK;MACrBC,QAAQ,EAAE,IAAI;MACdC,KAAK,EAAEb,CAAC,CAAC,mCAAmC;IAC9C,CAAC,CAAC;EACJ,CAAC,EAAE,CAACA,CAAC,CAAC,CAAC;EAEP,IAAAc,gBAAS,EAAC,MAAM;IACd,MAAMC,iBAAiB,GAAGjB,uBAAuB,CAAC,CAAC;IACnD,IAAIiB,iBAAiB,EAAE;MACrBR,gCAAK,CAACS,IAAI,CAAC,CAAC;IACd;;IAEA;IACA,IAAID,iBAAiB,KAAK,KAAK,IAAI,CAACb,QAAQ,EAAE;MAC5CG,kBAAkB,CAAC,CAAC;IACtB;EACF,CAAC,EAAE,CAACA,kBAAkB,EAAEP,uBAAuB,EAAEI,QAAQ,CAAC,CAAC;EAE3D,OAAO,IAAI;AACb,CAAC;AAAA,IAAAe,QAAA,GAAAC,OAAA,CAAAtB,OAAA,GAEcC,OAAO","ignoreList":[]}
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useGotoPostAuthScreens = void 0;
7
- var _react = require("react");
8
- var _core = require("@react-navigation/core");
9
- var _store = require("../contexts/store");
10
- const useGotoPostAuthScreens = () => {
11
- const [store] = (0, _store.useStore)();
12
- const navigation = (0, _core.useNavigation)();
13
- return (0, _react.useCallback)(() => {
14
- if (store.onboarding.postAuthScreens.length) {
15
- const screen = store.onboarding.postAuthScreens[0];
16
- if (screen) {
17
- navigation.navigate(screen);
18
- }
19
- }
20
- }, [store.onboarding.postAuthScreens, navigation]);
21
- };
22
- exports.useGotoPostAuthScreens = useGotoPostAuthScreens;
23
- //# sourceMappingURL=onboarding.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_core","_store","useGotoPostAuthScreens","store","useStore","navigation","useNavigation","useCallback","onboarding","postAuthScreens","length","screen","navigate","exports"],"sourceRoot":"../../../src","sources":["hooks/onboarding.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEO,MAAMG,sBAAsB,GAAGA,CAAA,KAAM;EAC1C,MAAM,CAACC,KAAK,CAAC,GAAG,IAAAC,eAAQ,EAAC,CAAC;EAC1B,MAAMC,UAAU,GAAG,IAAAC,mBAAa,EAAC,CAAC;EAClC,OAAO,IAAAC,kBAAW,EAAC,MAAM;IACvB,IAAIJ,KAAK,CAACK,UAAU,CAACC,eAAe,CAACC,MAAM,EAAE;MAC3C,MAAMC,MAAM,GAAGR,KAAK,CAACK,UAAU,CAACC,eAAe,CAAC,CAAC,CAAC;MAClD,IAAIE,MAAM,EAAE;QACVN,UAAU,CAACO,QAAQ,CAACD,MAAe,CAAC;MACtC;IACF;EACF,CAAC,EAAE,CAACR,KAAK,CAACK,UAAU,CAACC,eAAe,EAAEJ,UAAU,CAAC,CAAC;AACpD,CAAC;AAAAQ,OAAA,CAAAX,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -1,36 +0,0 @@
1
- import { useEffect, useCallback, useState } from 'react';
2
- import { useTranslation } from 'react-i18next';
3
- import Toast from 'react-native-toast-message';
4
- import { useNetwork } from '../../contexts/network';
5
- import { ToastType } from '../toast/BaseToast';
6
- const NetInfo = () => {
7
- const {
8
- assertInternetReachable
9
- } = useNetwork();
10
- const {
11
- t
12
- } = useTranslation();
13
- const [hasShown, setHasShown] = useState(false);
14
- const showNetworkWarning = useCallback(() => {
15
- setHasShown(true);
16
- Toast.show({
17
- type: ToastType.Error,
18
- autoHide: true,
19
- text1: t('NetInfo.NoInternetConnectionTitle')
20
- });
21
- }, [t]);
22
- useEffect(() => {
23
- const internetReachable = assertInternetReachable();
24
- if (internetReachable) {
25
- Toast.hide();
26
- }
27
-
28
- // Strict check for false, null means the network state is not yet known
29
- if (internetReachable === false && !hasShown) {
30
- showNetworkWarning();
31
- }
32
- }, [showNetworkWarning, assertInternetReachable, hasShown]);
33
- return null;
34
- };
35
- export default NetInfo;
36
- //# sourceMappingURL=NetInfo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","useCallback","useState","useTranslation","Toast","useNetwork","ToastType","NetInfo","assertInternetReachable","t","hasShown","setHasShown","showNetworkWarning","show","type","Error","autoHide","text1","internetReachable","hide"],"sourceRoot":"../../../../src","sources":["components/network/NetInfo.tsx"],"mappings":"AAAA,SAASA,SAAS,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SAASC,cAAc,QAAQ,eAAe;AAC9C,OAAOC,KAAK,MAAM,4BAA4B;AAC9C,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,SAAS,QAAQ,oBAAoB;AAE9C,MAAMC,OAAiB,GAAGA,CAAA,KAAM;EAC9B,MAAM;IAAEC;EAAwB,CAAC,GAAGH,UAAU,CAAC,CAAC;EAChD,MAAM;IAAEI;EAAE,CAAC,GAAGN,cAAc,CAAC,CAAC;EAC9B,MAAM,CAACO,QAAQ,EAAEC,WAAW,CAAC,GAAGT,QAAQ,CAAC,KAAK,CAAC;EAE/C,MAAMU,kBAAkB,GAAGX,WAAW,CAAC,MAAM;IAC3CU,WAAW,CAAC,IAAI,CAAC;IACjBP,KAAK,CAACS,IAAI,CAAC;MACTC,IAAI,EAAER,SAAS,CAACS,KAAK;MACrBC,QAAQ,EAAE,IAAI;MACdC,KAAK,EAAER,CAAC,CAAC,mCAAmC;IAC9C,CAAC,CAAC;EACJ,CAAC,EAAE,CAACA,CAAC,CAAC,CAAC;EAEPT,SAAS,CAAC,MAAM;IACd,MAAMkB,iBAAiB,GAAGV,uBAAuB,CAAC,CAAC;IACnD,IAAIU,iBAAiB,EAAE;MACrBd,KAAK,CAACe,IAAI,CAAC,CAAC;IACd;;IAEA;IACA,IAAID,iBAAiB,KAAK,KAAK,IAAI,CAACR,QAAQ,EAAE;MAC5CE,kBAAkB,CAAC,CAAC;IACtB;EACF,CAAC,EAAE,CAACA,kBAAkB,EAAEJ,uBAAuB,EAAEE,QAAQ,CAAC,CAAC;EAE3D,OAAO,IAAI;AACb,CAAC;AAED,eAAeH,OAAO","ignoreList":[]}
@@ -1,16 +0,0 @@
1
- import { useCallback } from 'react';
2
- import { useNavigation } from '@react-navigation/core';
3
- import { useStore } from '../contexts/store';
4
- export const useGotoPostAuthScreens = () => {
5
- const [store] = useStore();
6
- const navigation = useNavigation();
7
- return useCallback(() => {
8
- if (store.onboarding.postAuthScreens.length) {
9
- const screen = store.onboarding.postAuthScreens[0];
10
- if (screen) {
11
- navigation.navigate(screen);
12
- }
13
- }
14
- }, [store.onboarding.postAuthScreens, navigation]);
15
- };
16
- //# sourceMappingURL=onboarding.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useCallback","useNavigation","useStore","useGotoPostAuthScreens","store","navigation","onboarding","postAuthScreens","length","screen","navigate"],"sourceRoot":"../../../src","sources":["hooks/onboarding.ts"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,QAAQ,QAAQ,mBAAmB;AAE5C,OAAO,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;EAC1C,MAAM,CAACC,KAAK,CAAC,GAAGF,QAAQ,CAAC,CAAC;EAC1B,MAAMG,UAAU,GAAGJ,aAAa,CAAC,CAAC;EAClC,OAAOD,WAAW,CAAC,MAAM;IACvB,IAAII,KAAK,CAACE,UAAU,CAACC,eAAe,CAACC,MAAM,EAAE;MAC3C,MAAMC,MAAM,GAAGL,KAAK,CAACE,UAAU,CAACC,eAAe,CAAC,CAAC,CAAC;MAClD,IAAIE,MAAM,EAAE;QACVJ,UAAU,CAACK,QAAQ,CAACD,MAAe,CAAC;MACtC;IACF;EACF,CAAC,EAAE,CAACL,KAAK,CAACE,UAAU,CAACC,eAAe,EAAEF,UAAU,CAAC,CAAC;AACpD,CAAC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- declare const NetInfo: React.FC;
2
- export default NetInfo;
3
- //# sourceMappingURL=NetInfo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NetInfo.d.ts","sourceRoot":"","sources":["../../../../../src/components/network/NetInfo.tsx"],"names":[],"mappings":"AAMA,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EA2BpB,CAAA;AAED,eAAe,OAAO,CAAA"}