@bifold/core 2.2.1 → 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/components/misc/CredentialCard11.js +31 -10
- package/lib/commonjs/components/misc/CredentialCard11.js.map +1 -1
- package/lib/commonjs/contexts/reducers/store.js +0 -14
- package/lib/commonjs/contexts/reducers/store.js.map +1 -1
- package/lib/commonjs/contexts/store.js +1 -2
- package/lib/commonjs/contexts/store.js.map +1 -1
- package/lib/commonjs/localization/fr/fr.json +0 -1
- package/lib/commonjs/localization/pt-br/pt-br.json +1 -2
- 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/screens/Chat.js +1 -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 +0 -2
- package/lib/commonjs/screens/PINChange.js.map +1 -1
- package/lib/commonjs/screens/PINEnter.js +2 -6
- package/lib/commonjs/screens/PINEnter.js.map +1 -1
- package/lib/commonjs/screens/Terms.js +1 -19
- package/lib/commonjs/screens/Terms.js.map +1 -1
- package/lib/commonjs/services/logger.js +32 -8
- package/lib/commonjs/services/logger.js.map +1 -1
- package/lib/module/components/misc/CredentialCard11.js +31 -10
- package/lib/module/components/misc/CredentialCard11.js.map +1 -1
- package/lib/module/contexts/reducers/store.js +0 -14
- package/lib/module/contexts/reducers/store.js.map +1 -1
- package/lib/module/contexts/store.js +1 -2
- package/lib/module/contexts/store.js.map +1 -1
- package/lib/module/localization/fr/fr.json +0 -1
- package/lib/module/localization/pt-br/pt-br.json +1 -2
- 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/screens/Chat.js +2 -2
- package/lib/module/screens/Chat.js.map +1 -1
- package/lib/module/screens/CredentialDetails.js.map +1 -1
- package/lib/module/screens/PINChange.js +0 -2
- package/lib/module/screens/PINChange.js.map +1 -1
- package/lib/module/screens/PINEnter.js +2 -6
- package/lib/module/screens/PINEnter.js.map +1 -1
- package/lib/module/screens/Terms.js +1 -19
- package/lib/module/screens/Terms.js.map +1 -1
- package/lib/module/services/logger.js +32 -8
- package/lib/module/services/logger.js.map +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/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/tour/TourOverlay.d.ts.map +1 -1
- package/lib/typescript/src/container-api.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 +1 -3
- 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/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/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/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/Terms.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 +1 -2
- 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/components/buttons/Button.tsx +24 -24
- package/src/components/misc/CredentialCard11.tsx +35 -11
- package/src/contexts/reducers/store.ts +0 -13
- package/src/contexts/store.tsx +0 -1
- package/src/localization/fr/fr.json +0 -1
- package/src/localization/pt-br/pt-br.json +1 -2
- 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 +2 -2
- package/src/navigators/NotificationStack.tsx +0 -18
- package/src/navigators/OnboardingScreens.ts +10 -10
- package/src/screens/Chat.tsx +6 -2
- package/src/screens/CredentialDetails.tsx +5 -2
- package/src/screens/PINChange.tsx +3 -4
- package/src/screens/PINEnter.tsx +1 -6
- package/src/screens/Terms.tsx +3 -13
- package/src/services/logger.ts +8 -8
- package/src/types/navigators.ts +1 -0
- package/src/types/state.ts +1 -2
- package/lib/commonjs/hooks/onboarding.js +0 -23
- package/lib/commonjs/hooks/onboarding.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/hooks/onboarding.d.ts +0 -2
- package/lib/typescript/src/hooks/onboarding.d.ts.map +0 -1
- package/src/hooks/onboarding.ts +0 -16
|
@@ -6,8 +6,6 @@ import HeaderRightHome from '../components/buttons/HeaderHome'
|
|
|
6
6
|
import IconButton, { ButtonLocation } from '../components/buttons/IconButton'
|
|
7
7
|
import { useTheme } from '../contexts/theme'
|
|
8
8
|
import Connection from '../screens/Connection'
|
|
9
|
-
import CredentialOffer from '../screens/CredentialOffer'
|
|
10
|
-
import ProofRequest from '../screens/ProofRequest'
|
|
11
9
|
import { DeliveryStackParams, Screens } from '../types/navigators'
|
|
12
10
|
import { testIdWithKey } from '../utils/testable'
|
|
13
11
|
|
|
@@ -38,22 +36,6 @@ const DeliveryStack: React.FC = () => {
|
|
|
38
36
|
}}
|
|
39
37
|
>
|
|
40
38
|
<Stack.Screen name={Screens.Connection} component={Connection} options={{ ...defaultStackOptions }} />
|
|
41
|
-
<Stack.Screen
|
|
42
|
-
name={Screens.ProofRequest}
|
|
43
|
-
component={ProofRequest}
|
|
44
|
-
options={{
|
|
45
|
-
title: t('Screens.ProofRequest'),
|
|
46
|
-
...ScreenOptionsDictionary[Screens.ProofRequest],
|
|
47
|
-
}}
|
|
48
|
-
/>
|
|
49
|
-
<Stack.Screen
|
|
50
|
-
name={Screens.CredentialOffer}
|
|
51
|
-
component={CredentialOffer}
|
|
52
|
-
options={{
|
|
53
|
-
title: t('Screens.CredentialOffer'),
|
|
54
|
-
...ScreenOptionsDictionary[Screens.CredentialOffer],
|
|
55
|
-
}}
|
|
56
|
-
/>
|
|
57
39
|
<Stack.Screen
|
|
58
40
|
name={Screens.OpenIDCredentialOffer}
|
|
59
41
|
component={OpenIDCredentialOffer}
|
|
@@ -11,7 +11,7 @@ import { TOKENS, useServices } from '../container-api'
|
|
|
11
11
|
import { useTheme } from '../contexts/theme'
|
|
12
12
|
import HistoryStack from '../modules/history/navigation/HistoryStack'
|
|
13
13
|
import Chat from '../screens/Chat'
|
|
14
|
-
import { Screens, Stacks, TabStacks } from '../types/navigators'
|
|
14
|
+
import { RootStackParams, Screens, Stacks, TabStacks } from '../types/navigators'
|
|
15
15
|
import { testIdWithKey } from '../utils/testable'
|
|
16
16
|
import { useStore } from '../contexts/store'
|
|
17
17
|
import { useTour } from '../contexts/tour/tour-context'
|
|
@@ -53,7 +53,7 @@ const MainStack: React.FC = () => {
|
|
|
53
53
|
})
|
|
54
54
|
}, [declinedProofs, agent, store.preferences.useDataRetention])
|
|
55
55
|
|
|
56
|
-
const Stack = createStackNavigator()
|
|
56
|
+
const Stack = createStackNavigator<RootStackParams>()
|
|
57
57
|
|
|
58
58
|
// This function is to make the fade in behavior of both iOS and
|
|
59
59
|
// Android consistent for the settings menu
|
|
@@ -5,8 +5,6 @@ import { useTranslation } from 'react-i18next'
|
|
|
5
5
|
import { TOKENS, useServices } from '../container-api'
|
|
6
6
|
import { useTheme } from '../contexts/theme'
|
|
7
7
|
import CredentialDetails from '../screens/CredentialDetails'
|
|
8
|
-
import CredentialOffer from '../screens/CredentialOffer'
|
|
9
|
-
import ProofRequest from '../screens/ProofRequest'
|
|
10
8
|
import { NotificationStackParams, Screens } from '../types/navigators'
|
|
11
9
|
|
|
12
10
|
import { useDefaultStackOptions } from './defaultStackOptions'
|
|
@@ -31,22 +29,6 @@ const NotificationStack: React.FC = () => {
|
|
|
31
29
|
...ScreenOptionsDictionary[Screens.CredentialDetails],
|
|
32
30
|
}}
|
|
33
31
|
/>
|
|
34
|
-
<Stack.Screen
|
|
35
|
-
name={Screens.CredentialOffer}
|
|
36
|
-
component={CredentialOffer}
|
|
37
|
-
options={{
|
|
38
|
-
title: t('Screens.CredentialOffer'),
|
|
39
|
-
...ScreenOptionsDictionary[Screens.CredentialOffer],
|
|
40
|
-
}}
|
|
41
|
-
/>
|
|
42
|
-
<Stack.Screen
|
|
43
|
-
name={Screens.ProofRequest}
|
|
44
|
-
component={ProofRequest}
|
|
45
|
-
options={{
|
|
46
|
-
title: t('Screens.ProofRequest'),
|
|
47
|
-
...ScreenOptionsDictionary[Screens.ProofRequest],
|
|
48
|
-
}}
|
|
49
|
-
/>
|
|
50
32
|
{customNotification && (
|
|
51
33
|
<Stack.Screen
|
|
52
34
|
name={Screens.CustomNotification}
|
|
@@ -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
|
package/src/screens/Chat.tsx
CHANGED
|
@@ -21,7 +21,7 @@ import { Role } from '../types/chat'
|
|
|
21
21
|
import { BasicMessageMetadata, basicMessageCustomMetadata } from '../types/metadata'
|
|
22
22
|
import { RootStackParams, ContactStackParams, Screens, Stacks } from '../types/navigators'
|
|
23
23
|
import { getConnectionName } from '../utils/helpers'
|
|
24
|
-
import { KeyboardAvoidingView } from 'react-native'
|
|
24
|
+
import { KeyboardAvoidingView, Platform } from 'react-native'
|
|
25
25
|
|
|
26
26
|
type ChatProps = StackScreenProps<ContactStackParams, Screens.Chat> | StackScreenProps<RootStackParams, Screens.Chat>
|
|
27
27
|
|
|
@@ -108,7 +108,11 @@ const Chat: React.FC<ChatProps> = ({ route }) => {
|
|
|
108
108
|
|
|
109
109
|
return (
|
|
110
110
|
<SafeAreaView edges={['bottom', 'left', 'right']} style={{ flex: 1, paddingTop: 20 }}>
|
|
111
|
-
<KeyboardAvoidingView
|
|
111
|
+
<KeyboardAvoidingView
|
|
112
|
+
style={{ flex: 1 }}
|
|
113
|
+
behavior={Platform.OS === 'ios' ? undefined : 'padding'}
|
|
114
|
+
keyboardVerticalOffset={headerHeight}
|
|
115
|
+
>
|
|
112
116
|
<GiftedChat
|
|
113
117
|
keyboardShouldPersistTaps={'handled'}
|
|
114
118
|
messages={chatMessages}
|
|
@@ -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('')
|
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,
|
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
|
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,4 +1,4 @@
|
|
|
1
|
-
import { BannerMessage } from 'components/views/Banner'
|
|
1
|
+
import { BannerMessage } from '../components/views/Banner'
|
|
2
2
|
|
|
3
3
|
export interface Onboarding {
|
|
4
4
|
didSeePreface: boolean
|
|
@@ -10,7 +10,6 @@ export interface Onboarding {
|
|
|
10
10
|
didNameWallet: boolean
|
|
11
11
|
onboardingVersion: number
|
|
12
12
|
didCompleteOnboarding: boolean
|
|
13
|
-
postAuthScreens: string[]
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
export interface Migration {
|
|
@@ -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,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":"onboarding.d.ts","sourceRoot":"","sources":["../../../../src/hooks/onboarding.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,kBAWlC,CAAA"}
|
package/src/hooks/onboarding.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react'
|
|
2
|
-
import { useNavigation } from '@react-navigation/core'
|
|
3
|
-
import { useStore } from '../contexts/store'
|
|
4
|
-
|
|
5
|
-
export const useGotoPostAuthScreens = () => {
|
|
6
|
-
const [store] = useStore()
|
|
7
|
-
const navigation = useNavigation()
|
|
8
|
-
return useCallback(() => {
|
|
9
|
-
if (store.onboarding.postAuthScreens.length) {
|
|
10
|
-
const screen = store.onboarding.postAuthScreens[0]
|
|
11
|
-
if (screen) {
|
|
12
|
-
navigation.navigate(screen as never)
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}, [store.onboarding.postAuthScreens, navigation])
|
|
16
|
-
}
|