@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.
- package/lib/commonjs/App.js +1 -2
- package/lib/commonjs/App.js.map +1 -1
- package/lib/commonjs/assets/oca-bundles.json +4 -4
- package/lib/commonjs/components/inputs/PINInput.js +4 -2
- package/lib/commonjs/components/inputs/PINInput.js.map +1 -1
- package/lib/commonjs/components/misc/CredentialCard11.js +34 -13
- package/lib/commonjs/components/misc/CredentialCard11.js.map +1 -1
- package/lib/commonjs/components/modals/DeveloperModal.js +2 -8
- package/lib/commonjs/components/modals/DeveloperModal.js.map +1 -1
- package/lib/commonjs/components/views/Banner.js +162 -0
- package/lib/commonjs/components/views/Banner.js.map +1 -0
- package/lib/commonjs/components/views/HeaderWithBanner.js +17 -0
- package/lib/commonjs/components/views/HeaderWithBanner.js.map +1 -0
- package/lib/commonjs/components/views/KeyboardView.js +21 -8
- package/lib/commonjs/components/views/KeyboardView.js.map +1 -1
- package/lib/commonjs/container-api.js +1 -0
- package/lib/commonjs/container-api.js.map +1 -1
- package/lib/commonjs/container-impl.js +2 -0
- package/lib/commonjs/container-impl.js.map +1 -1
- package/lib/commonjs/contexts/network.js +36 -0
- package/lib/commonjs/contexts/network.js.map +1 -1
- package/lib/commonjs/contexts/reducers/store.js +30 -14
- package/lib/commonjs/contexts/reducers/store.js.map +1 -1
- package/lib/commonjs/contexts/store.js +3 -3
- package/lib/commonjs/contexts/store.js.map +1 -1
- package/lib/commonjs/index.js +0 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/localization/en/en.json +3 -0
- package/lib/commonjs/localization/fr/fr.json +3 -1
- package/lib/commonjs/localization/pt-br/pt-br.json +3 -1
- package/lib/commonjs/modules/history/ui/HistorySettings.js.map +1 -1
- package/lib/commonjs/modules/openid/screens/OpenIDProofChangeCredential.js +1 -1
- package/lib/commonjs/modules/openid/screens/OpenIDProofChangeCredential.js.map +1 -1
- package/lib/commonjs/navigators/ContactStack.js +0 -16
- package/lib/commonjs/navigators/ContactStack.js.map +1 -1
- package/lib/commonjs/navigators/DeliveryStack.js +0 -16
- package/lib/commonjs/navigators/DeliveryStack.js.map +1 -1
- package/lib/commonjs/navigators/MainStack.js.map +1 -1
- package/lib/commonjs/navigators/NotificationStack.js +0 -16
- package/lib/commonjs/navigators/NotificationStack.js.map +1 -1
- package/lib/commonjs/navigators/OnboardingScreens.js.map +1 -1
- package/lib/commonjs/navigators/defaultStackOptions.js +2 -0
- package/lib/commonjs/navigators/defaultStackOptions.js.map +1 -1
- package/lib/commonjs/screens/Chat.js +11 -1
- package/lib/commonjs/screens/Chat.js.map +1 -1
- package/lib/commonjs/screens/CredentialDetails.js.map +1 -1
- package/lib/commonjs/screens/PINChange.js +9 -6
- package/lib/commonjs/screens/PINChange.js.map +1 -1
- package/lib/commonjs/screens/PINEnter.js +10 -8
- package/lib/commonjs/screens/PINEnter.js.map +1 -1
- package/lib/commonjs/screens/PINVerify.js +13 -11
- package/lib/commonjs/screens/PINVerify.js.map +1 -1
- package/lib/commonjs/screens/Terms.js +1 -19
- package/lib/commonjs/screens/Terms.js.map +1 -1
- package/lib/commonjs/screens/ToggleBiometry.js +2 -1
- package/lib/commonjs/screens/ToggleBiometry.js.map +1 -1
- package/lib/commonjs/services/logger.js +32 -8
- package/lib/commonjs/services/logger.js.map +1 -1
- package/lib/commonjs/types/state.js +4 -0
- package/lib/module/App.js +1 -2
- package/lib/module/App.js.map +1 -1
- package/lib/module/assets/oca-bundles.json +4 -4
- package/lib/module/components/inputs/PINInput.js +4 -2
- package/lib/module/components/inputs/PINInput.js.map +1 -1
- package/lib/module/components/misc/CredentialCard11.js +34 -13
- package/lib/module/components/misc/CredentialCard11.js.map +1 -1
- package/lib/module/components/modals/DeveloperModal.js +2 -8
- package/lib/module/components/modals/DeveloperModal.js.map +1 -1
- package/lib/module/components/views/Banner.js +152 -0
- package/lib/module/components/views/Banner.js.map +1 -0
- package/lib/module/components/views/HeaderWithBanner.js +10 -0
- package/lib/module/components/views/HeaderWithBanner.js.map +1 -0
- package/lib/module/components/views/KeyboardView.js +22 -9
- package/lib/module/components/views/KeyboardView.js.map +1 -1
- package/lib/module/container-api.js +1 -0
- package/lib/module/container-api.js.map +1 -1
- package/lib/module/container-impl.js +2 -0
- package/lib/module/container-impl.js.map +1 -1
- package/lib/module/contexts/network.js +37 -1
- package/lib/module/contexts/network.js.map +1 -1
- package/lib/module/contexts/reducers/store.js +30 -14
- package/lib/module/contexts/reducers/store.js.map +1 -1
- package/lib/module/contexts/store.js +3 -3
- package/lib/module/contexts/store.js.map +1 -1
- package/lib/module/index.js +1 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/localization/en/en.json +3 -0
- package/lib/module/localization/fr/fr.json +3 -1
- package/lib/module/localization/pt-br/pt-br.json +3 -1
- package/lib/module/modules/history/ui/HistorySettings.js.map +1 -1
- package/lib/module/modules/openid/screens/OpenIDProofChangeCredential.js +1 -1
- package/lib/module/modules/openid/screens/OpenIDProofChangeCredential.js.map +1 -1
- package/lib/module/navigators/ContactStack.js +0 -16
- package/lib/module/navigators/ContactStack.js.map +1 -1
- package/lib/module/navigators/DeliveryStack.js +0 -16
- package/lib/module/navigators/DeliveryStack.js.map +1 -1
- package/lib/module/navigators/MainStack.js.map +1 -1
- package/lib/module/navigators/NotificationStack.js +0 -16
- package/lib/module/navigators/NotificationStack.js.map +1 -1
- package/lib/module/navigators/OnboardingScreens.js.map +1 -1
- package/lib/module/navigators/defaultStackOptions.js +2 -0
- package/lib/module/navigators/defaultStackOptions.js.map +1 -1
- package/lib/module/screens/Chat.js +11 -1
- package/lib/module/screens/Chat.js.map +1 -1
- package/lib/module/screens/CredentialDetails.js.map +1 -1
- package/lib/module/screens/PINChange.js +9 -6
- package/lib/module/screens/PINChange.js.map +1 -1
- package/lib/module/screens/PINEnter.js +10 -8
- package/lib/module/screens/PINEnter.js.map +1 -1
- package/lib/module/screens/PINVerify.js +13 -11
- package/lib/module/screens/PINVerify.js.map +1 -1
- package/lib/module/screens/Terms.js +1 -19
- package/lib/module/screens/Terms.js.map +1 -1
- package/lib/module/screens/ToggleBiometry.js +2 -1
- package/lib/module/screens/ToggleBiometry.js.map +1 -1
- package/lib/module/services/logger.js +32 -8
- package/lib/module/services/logger.js.map +1 -1
- package/lib/module/types/state.js +1 -1
- package/lib/typescript/src/App.d.ts.map +1 -1
- package/lib/typescript/src/components/chat/ChatActions.d.ts.map +1 -1
- package/lib/typescript/src/components/chat/ChatBubble.d.ts.map +1 -1
- package/lib/typescript/src/components/chat/MessageInput.d.ts.map +1 -1
- package/lib/typescript/src/components/inputs/PINInput.d.ts +1 -0
- package/lib/typescript/src/components/inputs/PINInput.d.ts.map +1 -1
- package/lib/typescript/src/components/listItems/ContactCredentialListItem.d.ts.map +1 -1
- package/lib/typescript/src/components/misc/CredentialCard11.d.ts.map +1 -1
- package/lib/typescript/src/components/misc/CredentialCard11ActionFooter.d.ts.map +1 -1
- package/lib/typescript/src/components/misc/PINHeader.d.ts.map +1 -1
- package/lib/typescript/src/components/modals/DeveloperModal.d.ts.map +1 -1
- package/lib/typescript/src/components/tour/TourOverlay.d.ts.map +1 -1
- package/lib/typescript/src/components/views/Banner.d.ts +16 -0
- package/lib/typescript/src/components/views/Banner.d.ts.map +1 -0
- package/lib/typescript/src/components/views/HeaderWithBanner.d.ts +5 -0
- package/lib/typescript/src/components/views/HeaderWithBanner.d.ts.map +1 -0
- package/lib/typescript/src/components/views/KeyboardView.d.ts +1 -0
- package/lib/typescript/src/components/views/KeyboardView.d.ts.map +1 -1
- package/lib/typescript/src/container-api.d.ts +3 -0
- package/lib/typescript/src/container-api.d.ts.map +1 -1
- package/lib/typescript/src/container-impl.d.ts +1 -0
- package/lib/typescript/src/container-impl.d.ts.map +1 -1
- package/lib/typescript/src/contexts/navigation.d.ts.map +1 -1
- package/lib/typescript/src/contexts/network.d.ts.map +1 -1
- package/lib/typescript/src/contexts/reducers/store.d.ts +6 -4
- package/lib/typescript/src/contexts/reducers/store.d.ts.map +1 -1
- package/lib/typescript/src/contexts/store.d.ts.map +1 -1
- package/lib/typescript/src/contexts/theme.d.ts.map +1 -1
- package/lib/typescript/src/hooks/chat-messages.d.ts.map +1 -1
- package/lib/typescript/src/hooks/connections.d.ts.map +1 -1
- package/lib/typescript/src/hooks/credential-card-styles.d.ts +2 -2
- package/lib/typescript/src/hooks/credential-card-styles.d.ts.map +1 -1
- package/lib/typescript/src/hooks/credentials.d.ts.map +1 -1
- package/lib/typescript/src/hooks/developer-mode.d.ts.map +1 -1
- package/lib/typescript/src/hooks/notifications.d.ts.map +1 -1
- package/lib/typescript/src/hooks/oob.d.ts.map +1 -1
- package/lib/typescript/src/hooks/proof-request-templates.d.ts.map +1 -1
- package/lib/typescript/src/hooks/proofs.d.ts.map +1 -1
- package/lib/typescript/src/hooks/screen-capture.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useOnboardingState.d.ts.map +1 -1
- package/lib/typescript/src/hooks/usePINValidation.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/localization/index.d.ts.map +1 -1
- package/lib/typescript/src/modules/history/ui/HistorySettings.d.ts +2 -3
- package/lib/typescript/src/modules/history/ui/HistorySettings.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/hooks/openid.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/offerResolve.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/resolverProof.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/utils/utils.d.ts.map +1 -1
- package/lib/typescript/src/navigators/ContactStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/DeliveryStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/MainStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/NotificationStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/OnboardingScreens.d.ts +10 -10
- package/lib/typescript/src/navigators/OnboardingScreens.d.ts.map +1 -1
- package/lib/typescript/src/navigators/defaultStackOptions.d.ts.map +1 -1
- package/lib/typescript/src/onboarding.d.ts.map +1 -1
- package/lib/typescript/src/screens/Chat.d.ts.map +1 -1
- package/lib/typescript/src/screens/ConfigureMediator.d.ts.map +1 -1
- package/lib/typescript/src/screens/CredentialDetails.d.ts +2 -2
- package/lib/typescript/src/screens/CredentialDetails.d.ts.map +1 -1
- package/lib/typescript/src/screens/JSONDetails.d.ts.map +1 -1
- package/lib/typescript/src/screens/OnboardingPages.d.ts.map +1 -1
- package/lib/typescript/src/screens/PINChange.d.ts +2 -3
- package/lib/typescript/src/screens/PINChange.d.ts.map +1 -1
- package/lib/typescript/src/screens/PINEnter.d.ts.map +1 -1
- package/lib/typescript/src/screens/PINVerify.d.ts.map +1 -1
- package/lib/typescript/src/screens/Terms.d.ts.map +1 -1
- package/lib/typescript/src/screens/ToggleBiometry.d.ts.map +1 -1
- package/lib/typescript/src/services/keychain.d.ts.map +1 -1
- package/lib/typescript/src/services/storage.d.ts.map +1 -1
- package/lib/typescript/src/types/navigators.d.ts +1 -0
- package/lib/typescript/src/types/navigators.d.ts.map +1 -1
- package/lib/typescript/src/types/state.d.ts +2 -1
- package/lib/typescript/src/types/state.d.ts.map +1 -1
- package/lib/typescript/src/utils/PINValidation.d.ts.map +1 -1
- package/lib/typescript/src/utils/agent.d.ts.map +1 -1
- package/lib/typescript/src/utils/anonCredsProofRequestMapper.d.ts.map +1 -1
- package/lib/typescript/src/utils/contacts.d.ts.map +1 -1
- package/lib/typescript/src/utils/credential.d.ts.map +1 -1
- package/lib/typescript/src/utils/crypto.d.ts.map +1 -1
- package/lib/typescript/src/utils/fileCache.d.ts.map +1 -1
- package/lib/typescript/src/utils/helpers.d.ts +1 -3
- package/lib/typescript/src/utils/helpers.d.ts.map +1 -1
- package/lib/typescript/src/utils/luminance.d.ts.map +1 -1
- package/lib/typescript/src/utils/mediatorhelpers.d.ts.map +1 -1
- package/lib/typescript/src/utils/migration.d.ts.map +1 -1
- package/lib/typescript/src/utils/network.d.ts.map +1 -1
- package/lib/typescript/src/utils/oca.d.ts.map +1 -1
- package/lib/typescript/src/utils/parsers.d.ts.map +1 -1
- package/lib/typescript/src/utils/proofBundle.d.ts.map +1 -1
- package/lib/typescript/src/utils/testable.d.ts.map +1 -1
- package/package.json +147 -148
- package/src/App.tsx +0 -2
- package/src/assets/oca-bundles.json +4 -4
- package/src/components/buttons/Button.tsx +24 -24
- package/src/components/inputs/PINInput.tsx +3 -1
- package/src/components/misc/CredentialCard11.tsx +40 -16
- package/src/components/modals/DeveloperModal.tsx +1 -2
- package/src/components/views/Banner.tsx +174 -0
- package/src/components/views/HeaderWithBanner.tsx +17 -0
- package/src/components/views/KeyboardView.tsx +23 -9
- package/src/container-api.ts +2 -0
- package/src/container-impl.ts +2 -0
- package/src/contexts/network.tsx +39 -1
- package/src/contexts/reducers/store.ts +30 -13
- package/src/contexts/store.tsx +1 -1
- package/src/index.ts +0 -2
- package/src/localization/en/en.json +3 -0
- package/src/localization/fr/fr.json +3 -1
- package/src/localization/pt-br/pt-br.json +3 -1
- package/src/modules/history/ui/HistorySettings.tsx +2 -3
- package/src/modules/openid/screens/OpenIDProofChangeCredential.tsx +1 -1
- package/src/navigators/ContactStack.tsx +0 -15
- package/src/navigators/DeliveryStack.tsx +0 -18
- package/src/navigators/MainStack.tsx +6 -3
- package/src/navigators/NotificationStack.tsx +0 -18
- package/src/navigators/OnboardingScreens.ts +10 -10
- package/src/navigators/defaultStackOptions.tsx +2 -0
- package/src/screens/Chat.tsx +29 -19
- package/src/screens/CredentialDetails.tsx +5 -2
- package/src/screens/PINChange.tsx +7 -5
- package/src/screens/PINEnter.tsx +6 -7
- package/src/screens/PINVerify.tsx +34 -32
- package/src/screens/Terms.tsx +3 -13
- package/src/screens/ToggleBiometry.tsx +1 -0
- package/src/services/logger.ts +8 -8
- package/src/types/navigators.ts +1 -0
- package/src/types/state.ts +3 -1
- package/lib/commonjs/components/network/NetInfo.js +0 -43
- package/lib/commonjs/components/network/NetInfo.js.map +0 -1
- package/lib/commonjs/hooks/onboarding.js +0 -23
- package/lib/commonjs/hooks/onboarding.js.map +0 -1
- package/lib/module/components/network/NetInfo.js +0 -36
- package/lib/module/components/network/NetInfo.js.map +0 -1
- package/lib/module/hooks/onboarding.js +0 -16
- package/lib/module/hooks/onboarding.js.map +0 -1
- package/lib/typescript/src/components/network/NetInfo.d.ts +0 -3
- package/lib/typescript/src/components/network/NetInfo.d.ts.map +0 -1
- package/lib/typescript/src/hooks/onboarding.d.ts +0 -2
- package/lib/typescript/src/hooks/onboarding.d.ts.map +0 -1
- package/src/components/network/NetInfo.tsx +0 -36
- 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 {
|
|
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
|
|
17
|
-
Preface: React.FC
|
|
16
|
+
SplashScreen: React.FC
|
|
17
|
+
Preface: React.FC
|
|
18
18
|
UpdateAvailableScreen: React.FC
|
|
19
|
-
Terms: React.FC
|
|
20
|
-
NameWallet: React.FC
|
|
21
|
-
Biometry: React.FC
|
|
22
|
-
PushNotifications: React.FC
|
|
23
|
-
AttemptLockout: React.FC
|
|
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
|
)
|
package/src/screens/Chat.tsx
CHANGED
|
@@ -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
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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<
|
|
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 {
|
|
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<
|
|
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 && (
|
package/src/screens/PINEnter.tsx
CHANGED
|
@@ -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
|
|
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:
|
|
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:
|
|
106
|
+
marginBottom: 40,
|
|
110
107
|
},
|
|
111
108
|
inputLabelText: {
|
|
112
109
|
alignSelf: 'auto',
|
|
113
110
|
textAlign: 'left',
|
|
114
|
-
marginBottom:
|
|
111
|
+
marginBottom: 20,
|
|
115
112
|
},
|
|
116
113
|
modalText: {
|
|
117
114
|
marginVertical: 5,
|
|
118
115
|
},
|
|
119
116
|
changeBiometricsHeader: {
|
|
120
117
|
marginTop: 0,
|
|
121
|
-
marginBottom:
|
|
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
|
-
|
|
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="
|
|
138
|
-
{
|
|
139
|
-
{t('PINEnter.ChangeBiometricsInputLabelParenthesis')}
|
|
127
|
+
<ThemedText variant="headingTwo" style={style.changeBiometricsHeader}>
|
|
128
|
+
{t('PINEnter.ChangeBiometricsHeader')}
|
|
140
129
|
</ThemedText>
|
|
141
130
|
)}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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]}
|
package/src/screens/Terms.tsx
CHANGED
|
@@ -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} />
|
package/src/services/logger.ts
CHANGED
|
@@ -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
|
}
|
package/src/types/navigators.ts
CHANGED
|
@@ -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>
|
package/src/types/state.ts
CHANGED
|
@@ -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 +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"}
|