@bifold/core 2.1.10 → 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/buttons/Button.js +26 -10
- package/lib/commonjs/components/buttons/Button.js.map +1 -1
- 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/constants.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 +78 -0
- package/lib/commonjs/contexts/reducers/store.js.map +1 -1
- package/lib/commonjs/contexts/store.js +6 -1
- package/lib/commonjs/contexts/store.js.map +1 -1
- package/lib/commonjs/hooks/useBifoldAgentSetup.js +5 -5
- package/lib/commonjs/hooks/useBifoldAgentSetup.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 +10 -1
- package/lib/commonjs/localization/fr/fr.json +10 -1
- package/lib/commonjs/localization/pt-br/pt-br.json +10 -1
- package/lib/commonjs/modules/openid/screens/OpenIDProofChangeCredential.js +7 -4
- package/lib/commonjs/modules/openid/screens/OpenIDProofChangeCredential.js.map +1 -1
- package/lib/commonjs/navigators/DeliveryStack.js +15 -3
- package/lib/commonjs/navigators/DeliveryStack.js.map +1 -1
- package/lib/commonjs/navigators/MainStack.js.map +1 -1
- package/lib/commonjs/navigators/SettingStack.js +9 -0
- package/lib/commonjs/navigators/SettingStack.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/ConfigureMediator.js +156 -0
- package/lib/commonjs/screens/ConfigureMediator.js.map +1 -0
- 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/Settings.js +6 -0
- package/lib/commonjs/screens/Settings.js.map +1 -1
- package/lib/commonjs/screens/ToggleBiometry.js +2 -1
- package/lib/commonjs/screens/ToggleBiometry.js.map +1 -1
- package/lib/commonjs/theme.js +55 -0
- package/lib/commonjs/theme.js.map +1 -1
- package/lib/commonjs/types/navigators.js +1 -0
- package/lib/commonjs/types/navigators.js.map +1 -1
- package/lib/commonjs/types/state.js +4 -0
- package/lib/commonjs/utils/helpers.js +10 -0
- package/lib/commonjs/utils/helpers.js.map +1 -1
- package/lib/commonjs/utils/mediatorhelpers.js +63 -0
- package/lib/commonjs/utils/mediatorhelpers.js.map +1 -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/buttons/Button.js +26 -10
- package/lib/module/components/buttons/Button.js.map +1 -1
- 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/constants.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 +77 -0
- package/lib/module/contexts/reducers/store.js.map +1 -1
- package/lib/module/contexts/store.js +6 -1
- package/lib/module/contexts/store.js.map +1 -1
- package/lib/module/hooks/useBifoldAgentSetup.js +5 -5
- package/lib/module/hooks/useBifoldAgentSetup.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 +10 -1
- package/lib/module/localization/fr/fr.json +10 -1
- package/lib/module/localization/pt-br/pt-br.json +10 -1
- package/lib/module/modules/openid/screens/OpenIDProofChangeCredential.js +7 -4
- package/lib/module/modules/openid/screens/OpenIDProofChangeCredential.js.map +1 -1
- package/lib/module/navigators/DeliveryStack.js +14 -3
- package/lib/module/navigators/DeliveryStack.js.map +1 -1
- package/lib/module/navigators/MainStack.js.map +1 -1
- package/lib/module/navigators/SettingStack.js +9 -0
- package/lib/module/navigators/SettingStack.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/ConfigureMediator.js +149 -0
- package/lib/module/screens/ConfigureMediator.js.map +1 -0
- 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/Settings.js +6 -0
- package/lib/module/screens/Settings.js.map +1 -1
- package/lib/module/screens/ToggleBiometry.js +2 -1
- package/lib/module/screens/ToggleBiometry.js.map +1 -1
- package/lib/module/theme.js +55 -0
- package/lib/module/theme.js.map +1 -1
- package/lib/module/types/navigators.js +1 -0
- package/lib/module/types/navigators.js.map +1 -1
- package/lib/module/types/state.js +1 -1
- package/lib/module/utils/helpers.js +10 -0
- package/lib/module/utils/helpers.js.map +1 -1
- package/lib/module/utils/mediatorhelpers.js +55 -0
- package/lib/module/utils/mediatorhelpers.js.map +1 -0
- package/lib/typescript/src/App.d.ts.map +1 -1
- package/lib/typescript/src/components/buttons/Button.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/constants.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 +11 -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/hooks/useBifoldAgentSetup.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/modules/openid/screens/OpenIDProofChangeCredential.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/SettingStack.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/ConfigureMediator.d.ts +6 -0
- package/lib/typescript/src/screens/ConfigureMediator.d.ts.map +1 -0
- 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/Settings.d.ts.map +1 -1
- package/lib/typescript/src/screens/ToggleBiometry.d.ts.map +1 -1
- package/lib/typescript/src/theme.d.ts +82 -0
- package/lib/typescript/src/theme.d.ts.map +1 -1
- package/lib/typescript/src/types/navigators.d.ts +5 -1
- package/lib/typescript/src/types/navigators.d.ts.map +1 -1
- package/lib/typescript/src/types/state.d.ts +4 -0
- package/lib/typescript/src/types/state.d.ts.map +1 -1
- package/lib/typescript/src/utils/helpers.d.ts.map +1 -1
- package/lib/typescript/src/utils/mediatorhelpers.d.ts +4 -0
- package/lib/typescript/src/utils/mediatorhelpers.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/App.tsx +0 -2
- package/src/assets/oca-bundles.json +4 -4
- package/src/components/buttons/Button.tsx +50 -20
- 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/constants.ts +0 -1
- 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 +76 -0
- package/src/contexts/store.tsx +4 -0
- package/src/hooks/useBifoldAgentSetup.ts +5 -5
- package/src/index.ts +0 -2
- package/src/localization/en/en.json +10 -1
- package/src/localization/fr/fr.json +10 -1
- package/src/localization/pt-br/pt-br.json +10 -1
- package/src/modules/openid/screens/OpenIDProofChangeCredential.tsx +5 -4
- package/src/navigators/DeliveryStack.tsx +14 -3
- package/src/navigators/MainStack.tsx +4 -1
- package/src/navigators/SettingStack.tsx +10 -0
- package/src/navigators/defaultStackOptions.tsx +2 -0
- package/src/screens/Chat.tsx +25 -19
- package/src/screens/ConfigureMediator.tsx +160 -0
- package/src/screens/PINChange.tsx +4 -1
- package/src/screens/PINEnter.tsx +5 -1
- package/src/screens/PINVerify.tsx +34 -32
- package/src/screens/Settings.tsx +7 -0
- package/src/screens/ToggleBiometry.tsx +1 -0
- package/src/theme.ts +55 -0
- package/src/types/navigators.ts +2 -0
- package/src/types/state.ts +5 -0
- package/src/utils/helpers.ts +9 -0
- package/src/utils/mediatorhelpers.ts +60 -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
package/src/contexts/network.tsx
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { NetInfoStateType, useNetInfo } from '@react-native-community/netinfo'
|
|
2
|
-
import { createContext, useContext, useState, useCallback, PropsWithChildren } from 'react'
|
|
2
|
+
import { createContext, useContext, useState, useCallback, PropsWithChildren, useEffect } from 'react'
|
|
3
3
|
|
|
4
4
|
import NetInfoModal from '../components/modals/NetInfoModal'
|
|
5
|
+
import { useTranslation } from 'react-i18next'
|
|
6
|
+
import { useStore } from './store'
|
|
7
|
+
import { DispatchAction } from './reducers/store'
|
|
5
8
|
|
|
6
9
|
export interface NetworkContext {
|
|
7
10
|
silentAssertConnectedNetwork: () => boolean | null
|
|
@@ -19,6 +22,9 @@ export const NetworkContext = createContext<NetworkContext>(null as unknown as N
|
|
|
19
22
|
export const NetworkProvider = ({ children }: PropsWithChildren) => {
|
|
20
23
|
const { isConnected, type, isInternetReachable } = useNetInfo()
|
|
21
24
|
const [isNetInfoModalDisplayed, setIsNetInfoModalDisplayed] = useState<boolean>(false)
|
|
25
|
+
const { t } = useTranslation()
|
|
26
|
+
const [hasShown, setHasShown] = useState(false)
|
|
27
|
+
const [, dispatch] = useStore()
|
|
22
28
|
|
|
23
29
|
const displayNetInfoModal = useCallback(() => {
|
|
24
30
|
setIsNetInfoModalDisplayed(true)
|
|
@@ -62,6 +68,38 @@ export const NetworkProvider = ({ children }: PropsWithChildren) => {
|
|
|
62
68
|
return isInternetReachable
|
|
63
69
|
}, [isInternetReachable])
|
|
64
70
|
|
|
71
|
+
const showNetworkWarning = useCallback(() => {
|
|
72
|
+
setHasShown(true)
|
|
73
|
+
dispatch({
|
|
74
|
+
type: DispatchAction.BANNER_MESSAGES,
|
|
75
|
+
payload: [
|
|
76
|
+
{
|
|
77
|
+
id: 'netinfo-no-internet',
|
|
78
|
+
title: t('NetInfo.NoInternetConnectionTitle'),
|
|
79
|
+
type: 'error',
|
|
80
|
+
variant: 'detail',
|
|
81
|
+
dismissible: false,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
})
|
|
85
|
+
}, [dispatch, t])
|
|
86
|
+
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const internetReachable = assertInternetReachable()
|
|
89
|
+
if (internetReachable) {
|
|
90
|
+
setHasShown(false)
|
|
91
|
+
dispatch({
|
|
92
|
+
type: DispatchAction.REMOVE_BANNER_MESSAGE,
|
|
93
|
+
payload: ['netinfo-no-internet'],
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Strict check for false, null means the network state is not yet known
|
|
98
|
+
if (internetReachable === false && !hasShown) {
|
|
99
|
+
showNetworkWarning()
|
|
100
|
+
}
|
|
101
|
+
}, [showNetworkWarning, assertInternetReachable, hasShown, dispatch])
|
|
102
|
+
|
|
65
103
|
return (
|
|
66
104
|
<NetworkContext.Provider
|
|
67
105
|
value={{
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
} from '../../types/state'
|
|
14
14
|
import { generateRandomWalletName } from '../../utils/helpers'
|
|
15
15
|
import { PersistentStorage } from '../../services/storage'
|
|
16
|
+
import Config from 'react-native-config'
|
|
16
17
|
|
|
17
18
|
enum StateDispatchAction {
|
|
18
19
|
STATE_DISPATCH = 'state/stateDispatch',
|
|
@@ -60,6 +61,11 @@ enum PreferencesDispatchAction {
|
|
|
60
61
|
UPDATE_ALTERNATE_CONTACT_NAMES = 'preferences/updateAlternateContactNames',
|
|
61
62
|
AUTO_LOCK_TIME = 'preferences/autoLockTime',
|
|
62
63
|
SET_THEME = 'preferences/setTheme',
|
|
64
|
+
SET_SELECTED_MEDIATOR = 'preferences/setSelectedMediator',
|
|
65
|
+
ADD_AVAILABLE_MEDIATOR = 'preferences/addAvailableMediator',
|
|
66
|
+
RESET_MEDIATORS = 'preferences/resetMediators',
|
|
67
|
+
BANNER_MESSAGES = 'preferences/bannerMessages',
|
|
68
|
+
REMOVE_BANNER_MESSAGE = 'REMOVE_BANNER_MESSAGE',
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
enum ToursDispatchAction {
|
|
@@ -515,6 +521,76 @@ export const reducer = <S extends State>(state: S, action: ReducerAction<Dispatc
|
|
|
515
521
|
preferences,
|
|
516
522
|
}
|
|
517
523
|
}
|
|
524
|
+
case PreferencesDispatchAction.SET_SELECTED_MEDIATOR: {
|
|
525
|
+
const selectedMediator = (action?.payload ?? []).pop() ?? state.preferences.selectedMediator
|
|
526
|
+
const preferences: Preferences = {
|
|
527
|
+
...state.preferences,
|
|
528
|
+
selectedMediator,
|
|
529
|
+
}
|
|
530
|
+
PersistentStorage.storeValueForKey(LocalStorageKeys.Preferences, preferences)
|
|
531
|
+
return {
|
|
532
|
+
...state,
|
|
533
|
+
preferences,
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
case PreferencesDispatchAction.ADD_AVAILABLE_MEDIATOR: {
|
|
537
|
+
const mediatorToAdd = (action?.payload ?? []).pop() ?? ''
|
|
538
|
+
if (!state.preferences.availableMediators.includes(mediatorToAdd)) {
|
|
539
|
+
const updatedAvailableMediators = [...state.preferences.availableMediators, mediatorToAdd]
|
|
540
|
+
const preferences: Preferences = {
|
|
541
|
+
...state.preferences,
|
|
542
|
+
availableMediators: updatedAvailableMediators,
|
|
543
|
+
}
|
|
544
|
+
PersistentStorage.storeValueForKey(LocalStorageKeys.Preferences, preferences)
|
|
545
|
+
return {
|
|
546
|
+
...state,
|
|
547
|
+
preferences,
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
return state
|
|
551
|
+
}
|
|
552
|
+
case PreferencesDispatchAction.RESET_MEDIATORS: {
|
|
553
|
+
const preferences: Preferences = {
|
|
554
|
+
...state.preferences,
|
|
555
|
+
availableMediators: [Config.MEDIATOR_URL as string],
|
|
556
|
+
selectedMediator: Config.MEDIATOR_URL as string,
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
PersistentStorage.storeValueForKey(LocalStorageKeys.Preferences, preferences)
|
|
560
|
+
return {
|
|
561
|
+
...state,
|
|
562
|
+
preferences,
|
|
563
|
+
}
|
|
564
|
+
}
|
|
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
|
+
|
|
518
594
|
case OnboardingDispatchAction.ONBOARDING_VERSION: {
|
|
519
595
|
const version = (action?.payload || []).pop()
|
|
520
596
|
const onboarding = {
|
package/src/contexts/store.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import { generateRandomWalletName } from '../utils/helpers'
|
|
|
5
5
|
|
|
6
6
|
import _defaultReducer, { ReducerAction } from './reducers/store'
|
|
7
7
|
import { defaultAutoLockTime } from '../constants'
|
|
8
|
+
import Config from 'react-native-config'
|
|
8
9
|
|
|
9
10
|
type Reducer = <S extends State>(state: S, action: ReducerAction<any>) => S
|
|
10
11
|
|
|
@@ -57,6 +58,9 @@ export const defaultState: State = {
|
|
|
57
58
|
enableShareableLink: false,
|
|
58
59
|
alternateContactNames: {},
|
|
59
60
|
autoLockTime: defaultAutoLockTime, // default wallets lockout time to 5 minutes
|
|
61
|
+
availableMediators: [Config.MEDIATOR_URL ?? ''],
|
|
62
|
+
selectedMediator: Config.MEDIATOR_URL ?? '',
|
|
63
|
+
bannerMessages: [],
|
|
60
64
|
},
|
|
61
65
|
tours: {
|
|
62
66
|
seenToursPrompt: false,
|
|
@@ -3,7 +3,6 @@ import { IndyVdrPoolService } from '@credo-ts/indy-vdr/build/pool'
|
|
|
3
3
|
import { agentDependencies } from '@credo-ts/react-native'
|
|
4
4
|
import { GetCredentialDefinitionRequest, GetSchemaRequest } from '@hyperledger/indy-vdr-shared'
|
|
5
5
|
import { useCallback, useRef, useState } from 'react'
|
|
6
|
-
import { Config } from 'react-native-config'
|
|
7
6
|
import { CachesDirectoryPath } from 'react-native-fs'
|
|
8
7
|
|
|
9
8
|
import { TOKENS, useServices } from '../container-api'
|
|
@@ -51,7 +50,7 @@ const useBifoldAgentSetup = (): AgentSetupReturnType => {
|
|
|
51
50
|
)
|
|
52
51
|
|
|
53
52
|
const createNewAgent = useCallback(
|
|
54
|
-
async (walletSecret: WalletSecret): Promise<Agent> => {
|
|
53
|
+
async (walletSecret: WalletSecret, mediatorUrl: string): Promise<Agent> => {
|
|
55
54
|
const newAgent = new Agent({
|
|
56
55
|
config: {
|
|
57
56
|
label: store.preferences.walletName || 'Aries Bifold',
|
|
@@ -65,7 +64,7 @@ const useBifoldAgentSetup = (): AgentSetupReturnType => {
|
|
|
65
64
|
dependencies: agentDependencies,
|
|
66
65
|
modules: getAgentModules({
|
|
67
66
|
indyNetworks: indyLedgers,
|
|
68
|
-
mediatorInvitationUrl:
|
|
67
|
+
mediatorInvitationUrl: mediatorUrl,
|
|
69
68
|
txnCache: {
|
|
70
69
|
capacity: 1000,
|
|
71
70
|
expiryOffsetMs: 1000 * 60 * 60 * 24 * 7,
|
|
@@ -118,6 +117,7 @@ const useBifoldAgentSetup = (): AgentSetupReturnType => {
|
|
|
118
117
|
|
|
119
118
|
const initializeAgent = useCallback(
|
|
120
119
|
async (walletSecret: WalletSecret): Promise<void> => {
|
|
120
|
+
const mediatorUrl = store.preferences.selectedMediator
|
|
121
121
|
logger.info('Checking for existing agent...')
|
|
122
122
|
if (agentInstanceRef.current) {
|
|
123
123
|
const restartedAgent = await restartExistingAgent(agentInstanceRef.current, walletSecret)
|
|
@@ -130,7 +130,7 @@ const useBifoldAgentSetup = (): AgentSetupReturnType => {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
logger.info('Creating new agent...')
|
|
133
|
-
const newAgent = await createNewAgent(walletSecret)
|
|
133
|
+
const newAgent = await createNewAgent(walletSecret, mediatorUrl)
|
|
134
134
|
|
|
135
135
|
logger.info('Migrating if required...')
|
|
136
136
|
await migrateIfRequired(newAgent, walletSecret)
|
|
@@ -148,7 +148,7 @@ const useBifoldAgentSetup = (): AgentSetupReturnType => {
|
|
|
148
148
|
agentInstanceRef.current = newAgent
|
|
149
149
|
setAgent(newAgent)
|
|
150
150
|
},
|
|
151
|
-
[logger, restartExistingAgent, createNewAgent, migrateIfRequired, warmUpCache]
|
|
151
|
+
[logger, restartExistingAgent, createNewAgent, migrateIfRequired, warmUpCache, store.preferences.selectedMediator]
|
|
152
152
|
)
|
|
153
153
|
|
|
154
154
|
const shutdownAndClearAgentIfExists = useCallback(async () => {
|
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,
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"Remove": "Remove",
|
|
49
49
|
"GotIt": "Got it",
|
|
50
50
|
"Send": "Send",
|
|
51
|
+
"Reset": "Reset",
|
|
51
52
|
"ViewJSON": "View JSON Details"
|
|
52
53
|
},
|
|
53
54
|
"Date": {
|
|
@@ -675,6 +676,7 @@
|
|
|
675
676
|
"RejectThisProof?": "Reject this Proof Request?",
|
|
676
677
|
"DeclineThisProof?": "Decline this Proof Request?",
|
|
677
678
|
"MultipleCredentials": "You have multiple credentials to choose from:",
|
|
679
|
+
"AvailableCards": "Available cards",
|
|
678
680
|
"AcceptingProof": "Accepting Proof",
|
|
679
681
|
"SuccessfullyAcceptedProof": "Successfully Accepted Proof",
|
|
680
682
|
"SensitiveInformation": "This request is asking for sensitive information.",
|
|
@@ -747,7 +749,10 @@
|
|
|
747
749
|
"Developer": "Developer options",
|
|
748
750
|
"Notifications": "Notifications",
|
|
749
751
|
"AutoLockTime": "Auto lock time",
|
|
750
|
-
"Logout": "Log out"
|
|
752
|
+
"Logout": "Log out",
|
|
753
|
+
"ConfigureMediator": "Configure Mediator",
|
|
754
|
+
"ChangeMediator": "Change Mediator",
|
|
755
|
+
"ChangeMediatorDescription": "Changing the mediator will restart the app. Do you want to continue?"
|
|
751
756
|
},
|
|
752
757
|
"AutoLockTimes": {
|
|
753
758
|
"FiveMinutes": "Five Minutes",
|
|
@@ -803,6 +808,7 @@
|
|
|
803
808
|
"CredentialOffer": "Credential Offer",
|
|
804
809
|
"ProofChangeCredential": "Choose a credential",
|
|
805
810
|
"ProofRequest": "Proof Request",
|
|
811
|
+
"ChangeCard": "Change Card",
|
|
806
812
|
"ProofRequestDetails": "Proof Request Details",
|
|
807
813
|
"ProofRequestAttributeDetails": "Proof Request Attribute Details",
|
|
808
814
|
"ProofDetails": "Proof Details",
|
|
@@ -938,5 +944,8 @@
|
|
|
938
944
|
"LearnMore": "Learn what's New",
|
|
939
945
|
"UpdateNow": "Update the app",
|
|
940
946
|
"UpdateLater": "Do this later"
|
|
947
|
+
},
|
|
948
|
+
"Banner": {
|
|
949
|
+
"AlertsLength": "You have {{ alerts }} alerts"
|
|
941
950
|
}
|
|
942
951
|
}
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"Close": "Fermer",
|
|
49
49
|
"GotIt": "Got it (FR)",
|
|
50
50
|
"Send": "Envoyer",
|
|
51
|
+
"Reset": "Reset (FR)",
|
|
51
52
|
"ViewJSON": "View JSON Details (FR)"
|
|
52
53
|
|
|
53
54
|
},
|
|
@@ -675,6 +676,7 @@
|
|
|
675
676
|
"RejectThisProof?": "Rejeter cette preuve?",
|
|
676
677
|
"AcceptingProof": "Acceptation de la preuve",
|
|
677
678
|
"MultipleCredentials": "Vous avez le choix entre plusieurs attestations d'identification :",
|
|
679
|
+
"AvailableCards": "Available cards (FR)",
|
|
678
680
|
"SuccessfullyAcceptedProof": "Preuve acceptée avec succès",
|
|
679
681
|
"SensitiveInformation": "Cette requête contient des données sensibles.",
|
|
680
682
|
"RejectingProof": "Rejet de la preuve",
|
|
@@ -735,7 +737,10 @@
|
|
|
735
737
|
"ScanMyQR": "Scanner mon code QR",
|
|
736
738
|
"Developer": "Options de développeur",
|
|
737
739
|
"AutoLockTime": "Auto lock time (FR)",
|
|
738
|
-
"Logout": "Déconnexion"
|
|
740
|
+
"Logout": "Déconnexion",
|
|
741
|
+
"ConfigureMediator": "Configurer le médiateur",
|
|
742
|
+
"ChangeMediator": "Change mediator (FR)",
|
|
743
|
+
"ChangeMediatorDescription": "Changing the mediator will restart the app. Do you want to continue? (FR)"
|
|
739
744
|
},
|
|
740
745
|
"AutoLockTimes": {
|
|
741
746
|
"FiveMinutes": "Five Minutes (FR)",
|
|
@@ -805,6 +810,7 @@
|
|
|
805
810
|
"ChangePIN": "Changer NIP",
|
|
806
811
|
"CommonDecline": "Refuser",
|
|
807
812
|
"ProofRequests": "Demandes de preuve",
|
|
813
|
+
"ChangeCard": "Change Card (FR)",
|
|
808
814
|
"ProofRequestDetails": "Détails de la Demande de preuve",
|
|
809
815
|
"SendProofRequest": "Envoyer une demande d'attestation",
|
|
810
816
|
"ChooseProofRequest": "Choisissez une demande d'attestation",
|
|
@@ -921,5 +927,8 @@
|
|
|
921
927
|
"LearnMore": "Learn what's New (FR)",
|
|
922
928
|
"UpdateNow": "Update the app (FR)",
|
|
923
929
|
"UpdateLater": "Do this later (FR)"
|
|
930
|
+
},
|
|
931
|
+
"Banner": {
|
|
932
|
+
"AlertsLength": "You have {{ alerts }} alerts (FR)"
|
|
924
933
|
}
|
|
925
934
|
}
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"Remove": "Remover",
|
|
48
48
|
"GotIt": "Got it (PT-BR)",
|
|
49
49
|
"Send": "Enviar",
|
|
50
|
+
"Reset": "Reset (PT-BR)",
|
|
50
51
|
"ViewJSON": "View JSON Details (PT-BR)"
|
|
51
52
|
|
|
52
53
|
},
|
|
@@ -660,6 +661,7 @@
|
|
|
660
661
|
"DeclineThisProof?": "Recusar esta Requisição de Prova?",
|
|
661
662
|
"AcceptingProof": "Aceitando Prova",
|
|
662
663
|
"MultipleCredentials": "Você tem múltiplas credenciais para escolher:",
|
|
664
|
+
"AvailableCards": "Available cards (PT-BR)",
|
|
663
665
|
"SuccessfullyAcceptedProof": "Prova Aceita com Sucesso",
|
|
664
666
|
"SensitiveInformation": "Esta requisição está solicitando informações sensíveis.",
|
|
665
667
|
"ProofRequestNotFound": "Requisição de Prova não encontrada.",
|
|
@@ -721,7 +723,10 @@
|
|
|
721
723
|
"ScanMyQR": "Scanear meu QR code",
|
|
722
724
|
"Developer": "Opções de Desenvolvedor",
|
|
723
725
|
"AutoLockTime": "Auto lock time (PT-BR)",
|
|
724
|
-
"Logout": "Sair"
|
|
726
|
+
"Logout": "Sair",
|
|
727
|
+
"ConfigureMediator": "Configurar Mediator",
|
|
728
|
+
"ChangeMediator": "Change mediator (PT-BR)",
|
|
729
|
+
"ChangeMediatorDescription": "Changing the mediator will restart the app. Do you want to continue? (PT-BR)"
|
|
725
730
|
},
|
|
726
731
|
"AutoLockTimes": {
|
|
727
732
|
"FiveMinutes": "Five Minutes (PT-BR)",
|
|
@@ -774,6 +779,7 @@
|
|
|
774
779
|
"Notifications": "Notificações",
|
|
775
780
|
"CredentialOffer": "Oferta de Credencial",
|
|
776
781
|
"ProofRequest": "Requisição de Prova",
|
|
782
|
+
"ChangeCard": "Change Card (PT-BR)",
|
|
777
783
|
"ProofChangeCredential": "Escolha uma credencial",
|
|
778
784
|
"ProofRequestDetails": "Detalhes Da Solicitação De Comprovação",
|
|
779
785
|
"ProofRequestAttributeDetails": "Atributos de Requisição de Prova",
|
|
@@ -899,5 +905,8 @@
|
|
|
899
905
|
"LearnMore": "Learn what's New (PT-BR)",
|
|
900
906
|
"UpdateNow": "Update the app (PT-BR)",
|
|
901
907
|
"UpdateLater": "Do this later (PT-BR)"
|
|
908
|
+
},
|
|
909
|
+
"Banner": {
|
|
910
|
+
"AlertsLength": "You have {{ alerts }} alerts (PT-BR)"
|
|
902
911
|
}
|
|
903
912
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { StackScreenProps } from '@react-navigation/stack'
|
|
2
|
-
import { DeliveryStackParams, Screens } from '../../../types/navigators'
|
|
3
|
-
import ScreenLayout from '../../../layout/ScreenLayout'
|
|
4
2
|
import { FlatList, StyleSheet, TouchableOpacity, View } from 'react-native'
|
|
5
3
|
import { useTranslation } from 'react-i18next'
|
|
4
|
+
|
|
5
|
+
import { DeliveryStackParams, Screens } from '../../../types/navigators'
|
|
6
|
+
import ScreenLayout from '../../../layout/ScreenLayout'
|
|
6
7
|
import { useTheme } from '../../../contexts/theme'
|
|
7
8
|
import { useEffect, useState } from 'react'
|
|
8
9
|
import { MdocRecord, SdJwtVcRecord, W3cCredentialRecord } from '@credo-ts/core'
|
|
@@ -90,13 +91,13 @@ const OpenIDProofCredentialSelect: React.FC<Props> = ({ route, navigation }: Pro
|
|
|
90
91
|
|
|
91
92
|
const listHeader = () => {
|
|
92
93
|
return (
|
|
93
|
-
<View style={{ ...styles.pageMargin,
|
|
94
|
+
<View style={{ ...styles.pageMargin, marginTop: 40, marginBottom: 20 }}>
|
|
94
95
|
{loading ? (
|
|
95
96
|
<View style={styles.cardLoading}>
|
|
96
97
|
<RecordLoading />
|
|
97
98
|
</View>
|
|
98
99
|
) : (
|
|
99
|
-
<ThemedText>{t('ProofRequest.
|
|
100
|
+
<ThemedText variant='bold'>{t('ProofRequest.AvailableCards')}</ThemedText>
|
|
100
101
|
)}
|
|
101
102
|
</View>
|
|
102
103
|
)
|
|
@@ -3,11 +3,13 @@ import React from 'react'
|
|
|
3
3
|
import { useTranslation } from 'react-i18next'
|
|
4
4
|
|
|
5
5
|
import HeaderRightHome from '../components/buttons/HeaderHome'
|
|
6
|
+
import IconButton, { ButtonLocation } from '../components/buttons/IconButton'
|
|
6
7
|
import { useTheme } from '../contexts/theme'
|
|
7
8
|
import Connection from '../screens/Connection'
|
|
8
9
|
import CredentialOffer from '../screens/CredentialOffer'
|
|
9
10
|
import ProofRequest from '../screens/ProofRequest'
|
|
10
11
|
import { DeliveryStackParams, Screens } from '../types/navigators'
|
|
12
|
+
import { testIdWithKey } from '../utils/testable'
|
|
11
13
|
|
|
12
14
|
import { useDefaultStackOptions } from './defaultStackOptions'
|
|
13
15
|
import OpenIDProofPresentation from '../modules/openid/screens/OpenIDProofPresentation'
|
|
@@ -71,10 +73,19 @@ const DeliveryStack: React.FC = () => {
|
|
|
71
73
|
<Stack.Screen
|
|
72
74
|
name={Screens.OpenIDProofCredentialSelect}
|
|
73
75
|
component={OpenIDProofCredentialSelect}
|
|
74
|
-
options={{
|
|
75
|
-
title: t('Screens.
|
|
76
|
+
options={({ navigation }) => ({
|
|
77
|
+
title: t('Screens.ChangeCard'),
|
|
78
|
+
headerLeft: () => (
|
|
79
|
+
<IconButton
|
|
80
|
+
buttonLocation={ButtonLocation.Left}
|
|
81
|
+
accessibilityLabel={t('Global.Back')}
|
|
82
|
+
testID={testIdWithKey('BackButton')}
|
|
83
|
+
onPress={() => navigation.goBack()}
|
|
84
|
+
icon="arrow-left"
|
|
85
|
+
/>
|
|
86
|
+
),
|
|
76
87
|
...ScreenOptionsDictionary[Screens.OpenIDProofCredentialSelect],
|
|
77
|
-
}}
|
|
88
|
+
})}
|
|
78
89
|
/>
|
|
79
90
|
</Stack.Navigator>
|
|
80
91
|
)
|
|
@@ -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
|
|
@@ -19,6 +19,7 @@ import { testIdWithKey } from '../utils/testable'
|
|
|
19
19
|
import { useDefaultStackOptions } from './defaultStackOptions'
|
|
20
20
|
import { TOKENS, useServices } from '../container-api'
|
|
21
21
|
import AutoLock from '../screens/AutoLock'
|
|
22
|
+
import ConfigureMediator from '../screens/ConfigureMediator'
|
|
22
23
|
|
|
23
24
|
const SettingStack: React.FC = () => {
|
|
24
25
|
const Stack = createStackNavigator<SettingStackParams>()
|
|
@@ -64,6 +65,15 @@ const SettingStack: React.FC = () => {
|
|
|
64
65
|
...ScreenOptionsDictionary[Screens.Language],
|
|
65
66
|
}}
|
|
66
67
|
/>
|
|
68
|
+
<Stack.Screen
|
|
69
|
+
name={Screens.ConfigureMediator}
|
|
70
|
+
component={ConfigureMediator}
|
|
71
|
+
options={{
|
|
72
|
+
title: 'Configure Mediator',
|
|
73
|
+
headerBackTestID: testIdWithKey('Back'),
|
|
74
|
+
...ScreenOptionsDictionary[Screens.ConfigureMediator],
|
|
75
|
+
}}
|
|
76
|
+
/>
|
|
67
77
|
<Stack.Screen
|
|
68
78
|
name={Screens.AutoLock}
|
|
69
79
|
component={AutoLock}
|
|
@@ -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
|
}
|