@bifold/core 2.2.0 → 2.2.1
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 +3 -3
- 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 -0
- package/lib/commonjs/contexts/reducers/store.js.map +1 -1
- package/lib/commonjs/contexts/store.js +2 -1
- 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 -0
- package/lib/commonjs/localization/pt-br/pt-br.json +3 -0
- package/lib/commonjs/navigators/MainStack.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/PINChange.js +9 -4
- package/lib/commonjs/screens/PINChange.js.map +1 -1
- package/lib/commonjs/screens/PINEnter.js +8 -2
- 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/ToggleBiometry.js +2 -1
- package/lib/commonjs/screens/ToggleBiometry.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 +3 -3
- 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 -0
- package/lib/module/contexts/reducers/store.js.map +1 -1
- package/lib/module/contexts/store.js +2 -1
- 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 -0
- package/lib/module/localization/pt-br/pt-br.json +3 -0
- package/lib/module/navigators/MainStack.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/PINChange.js +9 -4
- package/lib/module/screens/PINChange.js.map +1 -1
- package/lib/module/screens/PINEnter.js +8 -2
- 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/ToggleBiometry.js +2 -1
- package/lib/module/screens/ToggleBiometry.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/inputs/PINInput.d.ts +1 -0
- package/lib/typescript/src/components/inputs/PINInput.d.ts.map +1 -1
- package/lib/typescript/src/components/modals/DeveloperModal.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/network.d.ts.map +1 -1
- package/lib/typescript/src/contexts/reducers/store.d.ts +5 -1
- 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/index.d.ts +1 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigators/MainStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/defaultStackOptions.d.ts.map +1 -1
- package/lib/typescript/src/screens/Chat.d.ts.map +1 -1
- 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/ToggleBiometry.d.ts.map +1 -1
- package/lib/typescript/src/types/state.d.ts +2 -0
- package/lib/typescript/src/types/state.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/App.tsx +0 -2
- package/src/assets/oca-bundles.json +4 -4
- package/src/components/inputs/PINInput.tsx +3 -1
- package/src/components/misc/CredentialCard11.tsx +5 -5
- 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 -0
- package/src/contexts/store.tsx +1 -0
- package/src/index.ts +0 -2
- package/src/localization/en/en.json +3 -0
- package/src/localization/fr/fr.json +3 -0
- package/src/localization/pt-br/pt-br.json +3 -0
- package/src/navigators/MainStack.tsx +4 -1
- package/src/navigators/defaultStackOptions.tsx +2 -0
- package/src/screens/Chat.tsx +25 -19
- package/src/screens/PINChange.tsx +4 -1
- package/src/screens/PINEnter.tsx +5 -1
- package/src/screens/PINVerify.tsx +34 -32
- package/src/screens/ToggleBiometry.tsx +1 -0
- package/src/types/state.ts +3 -0
- package/lib/commonjs/components/network/NetInfo.js +0 -43
- package/lib/commonjs/components/network/NetInfo.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/typescript/src/components/network/NetInfo.d.ts +0 -3
- package/lib/typescript/src/components/network/NetInfo.d.ts.map +0 -1
- package/src/components/network/NetInfo.tsx +0 -36
|
@@ -64,6 +64,8 @@ enum PreferencesDispatchAction {
|
|
|
64
64
|
SET_SELECTED_MEDIATOR = 'preferences/setSelectedMediator',
|
|
65
65
|
ADD_AVAILABLE_MEDIATOR = 'preferences/addAvailableMediator',
|
|
66
66
|
RESET_MEDIATORS = 'preferences/resetMediators',
|
|
67
|
+
BANNER_MESSAGES = 'preferences/bannerMessages',
|
|
68
|
+
REMOVE_BANNER_MESSAGE = 'REMOVE_BANNER_MESSAGE',
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
enum ToursDispatchAction {
|
|
@@ -561,6 +563,34 @@ export const reducer = <S extends State>(state: S, action: ReducerAction<Dispatc
|
|
|
561
563
|
}
|
|
562
564
|
}
|
|
563
565
|
|
|
566
|
+
case PreferencesDispatchAction.BANNER_MESSAGES: {
|
|
567
|
+
const bannerMessageToAdd = action?.payload ?? []
|
|
568
|
+
const newBannerMessages = [...state.preferences.bannerMessages, ...bannerMessageToAdd]
|
|
569
|
+
const preferences: Preferences = {
|
|
570
|
+
...state.preferences,
|
|
571
|
+
bannerMessages: newBannerMessages,
|
|
572
|
+
}
|
|
573
|
+
PersistentStorage.storeValueForKey(LocalStorageKeys.Preferences, preferences)
|
|
574
|
+
return {
|
|
575
|
+
...state,
|
|
576
|
+
preferences,
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
case PreferencesDispatchAction.REMOVE_BANNER_MESSAGE: {
|
|
581
|
+
const keysToRemove = action?.payload ?? []
|
|
582
|
+
const newBannerMessages = state.preferences.bannerMessages.filter((msg) => !keysToRemove.includes(msg.id))
|
|
583
|
+
const preferences: Preferences = {
|
|
584
|
+
...state.preferences,
|
|
585
|
+
bannerMessages: newBannerMessages,
|
|
586
|
+
}
|
|
587
|
+
PersistentStorage.storeValueForKey(LocalStorageKeys.Preferences, preferences)
|
|
588
|
+
return {
|
|
589
|
+
...state,
|
|
590
|
+
preferences,
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
564
594
|
case OnboardingDispatchAction.ONBOARDING_VERSION: {
|
|
565
595
|
const version = (action?.payload || []).pop()
|
|
566
596
|
const onboarding = {
|
package/src/contexts/store.tsx
CHANGED
|
@@ -60,6 +60,7 @@ export const defaultState: State = {
|
|
|
60
60
|
autoLockTime: defaultAutoLockTime, // default wallets lockout time to 5 minutes
|
|
61
61
|
availableMediators: [Config.MEDIATOR_URL ?? ''],
|
|
62
62
|
selectedMediator: Config.MEDIATOR_URL ?? '',
|
|
63
|
+
bannerMessages: [],
|
|
63
64
|
},
|
|
64
65
|
tours: {
|
|
65
66
|
seenToursPrompt: false,
|
package/src/index.ts
CHANGED
|
@@ -15,7 +15,6 @@ import CredentialCard from './components/misc/CredentialCard'
|
|
|
15
15
|
import InfoBox, { InfoBoxType } from './components/misc/InfoBox'
|
|
16
16
|
import ErrorModal from './components/modals/ErrorModal'
|
|
17
17
|
import SafeAreaModal from './components/modals/SafeAreaModal'
|
|
18
|
-
import NetInfo from './components/network/NetInfo'
|
|
19
18
|
import Record from './components/record/Record'
|
|
20
19
|
import InfoTextBox from './components/texts/InfoTextBox'
|
|
21
20
|
import Link from './components/texts/Link'
|
|
@@ -189,7 +188,6 @@ export {
|
|
|
189
188
|
ToastType,
|
|
190
189
|
toastConfig,
|
|
191
190
|
NavContainer,
|
|
192
|
-
NetInfo,
|
|
193
191
|
OnboardingPages,
|
|
194
192
|
OpenIDCredentialRecordProvider,
|
|
195
193
|
NotificationListItem,
|
|
@@ -68,7 +68,10 @@ const MainStack: React.FC = () => {
|
|
|
68
68
|
<View style={{ flex: 1 }} importantForAccessibility={hideElements}>
|
|
69
69
|
<Stack.Navigator
|
|
70
70
|
initialRouteName={Stacks.TabStack}
|
|
71
|
-
screenOptions={{
|
|
71
|
+
screenOptions={{
|
|
72
|
+
...defaultStackOptions,
|
|
73
|
+
headerShown: false,
|
|
74
|
+
}}
|
|
72
75
|
>
|
|
73
76
|
<Stack.Screen name={Stacks.TabStack} component={TabStack} />
|
|
74
77
|
<Stack.Screen
|
|
@@ -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 } 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,28 @@ 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 style={{ flex: 1 }} behavior="padding" keyboardVerticalOffset={headerHeight}>
|
|
112
|
+
<GiftedChat
|
|
113
|
+
keyboardShouldPersistTaps={'handled'}
|
|
114
|
+
messages={chatMessages}
|
|
115
|
+
showAvatarForEveryMessage={true}
|
|
116
|
+
alignTop
|
|
117
|
+
renderAvatar={() => null}
|
|
118
|
+
messageIdGenerator={(msg) => msg?._id.toString() || '0'}
|
|
119
|
+
renderMessage={(props) => <ChatMessage messageProps={props} />}
|
|
120
|
+
renderInputToolbar={(props) => renderInputToolbar(props, theme)}
|
|
121
|
+
renderSend={(props) => renderSend(props, theme)}
|
|
122
|
+
renderComposer={(props) => renderComposer(props, theme, t('Contacts.TypeHere'))}
|
|
123
|
+
disableComposer={!silentAssertConnectedNetwork()}
|
|
124
|
+
onSend={onSend}
|
|
125
|
+
user={{
|
|
126
|
+
_id: Role.me,
|
|
127
|
+
}}
|
|
128
|
+
renderActions={(props) => renderActions(props, theme, actions)}
|
|
129
|
+
onPressActionButton={actions ? () => setShowActionSlider(true) : undefined}
|
|
130
|
+
/>
|
|
131
|
+
{showActionSlider && <ActionSlider onDismiss={onDismiss} actions={actions} />}
|
|
132
|
+
</KeyboardAvoidingView>
|
|
127
133
|
</SafeAreaView>
|
|
128
134
|
)
|
|
129
135
|
}
|
|
@@ -174,7 +174,7 @@ const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> =
|
|
|
174
174
|
}, [inlineMessages, isLoading, PIN, PINTwo, PINOld])
|
|
175
175
|
|
|
176
176
|
return (
|
|
177
|
-
<KeyboardView>
|
|
177
|
+
<KeyboardView keyboardAvoiding={false}>
|
|
178
178
|
<View style={style.screenContainer}>
|
|
179
179
|
<View style={style.contentContainer}>
|
|
180
180
|
<PINHeader updatePin />
|
|
@@ -185,6 +185,7 @@ const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> =
|
|
|
185
185
|
onPINChanged={(p: string) => {
|
|
186
186
|
setPINOld(p)
|
|
187
187
|
}}
|
|
188
|
+
onSubmitEditing={handleChangePinTap}
|
|
188
189
|
/>
|
|
189
190
|
<PINInput
|
|
190
191
|
label={t('PINChange.EnterPINTitle')}
|
|
@@ -202,6 +203,7 @@ const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> =
|
|
|
202
203
|
accessibilityLabel={t('PINCreate.EnterPIN')}
|
|
203
204
|
autoFocus={false}
|
|
204
205
|
inlineMessage={inlineMessageField1}
|
|
206
|
+
onSubmitEditing={handleChangePinTap}
|
|
205
207
|
/>
|
|
206
208
|
<PINInput
|
|
207
209
|
label={t('PINChange.ReenterPIN')}
|
|
@@ -220,6 +222,7 @@ const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> =
|
|
|
220
222
|
autoFocus={false}
|
|
221
223
|
ref={PINTwoInputRef}
|
|
222
224
|
inlineMessage={inlineMessageField2}
|
|
225
|
+
onSubmitEditing={handleChangePinTap}
|
|
223
226
|
/>
|
|
224
227
|
{PINSecurity.displayHelper && <PINValidationHelper validations={PINValidations} />}
|
|
225
228
|
{modalState.visible && (
|
package/src/screens/PINEnter.tsx
CHANGED
|
@@ -316,7 +316,7 @@ const PINEnter: React.FC<PINEnterProps> = ({ setAuthenticated }) => {
|
|
|
316
316
|
])
|
|
317
317
|
|
|
318
318
|
return (
|
|
319
|
-
<KeyboardView>
|
|
319
|
+
<KeyboardView keyboardAvoiding={false}>
|
|
320
320
|
<View style={style.screenContainer}>
|
|
321
321
|
<View>
|
|
322
322
|
<Pressable
|
|
@@ -333,12 +333,16 @@ const PINEnter: React.FC<PINEnterProps> = ({ setAuthenticated }) => {
|
|
|
333
333
|
setPIN(p)
|
|
334
334
|
if (p.length === minPINLength) {
|
|
335
335
|
Keyboard.dismiss()
|
|
336
|
+
onPINInputCompleted(p)
|
|
336
337
|
}
|
|
337
338
|
}}
|
|
338
339
|
testID={testIdWithKey('EnterPIN')}
|
|
339
340
|
accessibilityLabel={t('PINEnter.EnterPIN')}
|
|
340
341
|
autoFocus={true}
|
|
341
342
|
inlineMessage={inlineMessageField}
|
|
343
|
+
onSubmitEditing={() => {
|
|
344
|
+
onPINInputCompleted(PIN)
|
|
345
|
+
}}
|
|
342
346
|
/>
|
|
343
347
|
<ThemedText
|
|
344
348
|
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]}
|
|
@@ -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/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
|
|
@@ -35,6 +37,7 @@ export interface Preferences {
|
|
|
35
37
|
theme?: string
|
|
36
38
|
selectedMediator: string
|
|
37
39
|
availableMediators: string[]
|
|
40
|
+
bannerMessages: BannerMessage[]
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
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,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 +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"}
|
|
@@ -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
|
-
|
|
7
|
-
const NetInfo: React.FC = () => {
|
|
8
|
-
const { assertInternetReachable } = useNetwork()
|
|
9
|
-
const { t } = useTranslation()
|
|
10
|
-
const [hasShown, setHasShown] = useState(false)
|
|
11
|
-
|
|
12
|
-
const showNetworkWarning = useCallback(() => {
|
|
13
|
-
setHasShown(true)
|
|
14
|
-
Toast.show({
|
|
15
|
-
type: ToastType.Error,
|
|
16
|
-
autoHide: true,
|
|
17
|
-
text1: t('NetInfo.NoInternetConnectionTitle'),
|
|
18
|
-
})
|
|
19
|
-
}, [t])
|
|
20
|
-
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
const internetReachable = assertInternetReachable()
|
|
23
|
-
if (internetReachable) {
|
|
24
|
-
Toast.hide()
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Strict check for false, null means the network state is not yet known
|
|
28
|
-
if (internetReachable === false && !hasShown) {
|
|
29
|
-
showNetworkWarning()
|
|
30
|
-
}
|
|
31
|
-
}, [showNetworkWarning, assertInternetReachable, hasShown])
|
|
32
|
-
|
|
33
|
-
return null
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export default NetInfo
|