@bifold/core 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/App.js +1 -2
- package/lib/commonjs/App.js.map +1 -1
- package/lib/commonjs/assets/oca-bundles.json +4 -4
- package/lib/commonjs/components/inputs/PINInput.js +4 -2
- package/lib/commonjs/components/inputs/PINInput.js.map +1 -1
- package/lib/commonjs/components/misc/CredentialCard11.js +34 -13
- package/lib/commonjs/components/misc/CredentialCard11.js.map +1 -1
- package/lib/commonjs/components/modals/DeveloperModal.js +2 -8
- package/lib/commonjs/components/modals/DeveloperModal.js.map +1 -1
- package/lib/commonjs/components/views/Banner.js +162 -0
- package/lib/commonjs/components/views/Banner.js.map +1 -0
- package/lib/commonjs/components/views/HeaderWithBanner.js +17 -0
- package/lib/commonjs/components/views/HeaderWithBanner.js.map +1 -0
- package/lib/commonjs/components/views/KeyboardView.js +21 -8
- package/lib/commonjs/components/views/KeyboardView.js.map +1 -1
- package/lib/commonjs/container-api.js +1 -0
- package/lib/commonjs/container-api.js.map +1 -1
- package/lib/commonjs/container-impl.js +2 -0
- package/lib/commonjs/container-impl.js.map +1 -1
- package/lib/commonjs/contexts/network.js +36 -0
- package/lib/commonjs/contexts/network.js.map +1 -1
- package/lib/commonjs/contexts/reducers/store.js +30 -14
- package/lib/commonjs/contexts/reducers/store.js.map +1 -1
- package/lib/commonjs/contexts/store.js +3 -3
- package/lib/commonjs/contexts/store.js.map +1 -1
- package/lib/commonjs/index.js +0 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/localization/en/en.json +3 -0
- package/lib/commonjs/localization/fr/fr.json +3 -1
- package/lib/commonjs/localization/pt-br/pt-br.json +3 -1
- package/lib/commonjs/modules/history/ui/HistorySettings.js.map +1 -1
- package/lib/commonjs/modules/openid/screens/OpenIDProofChangeCredential.js +1 -1
- package/lib/commonjs/modules/openid/screens/OpenIDProofChangeCredential.js.map +1 -1
- package/lib/commonjs/navigators/ContactStack.js +0 -16
- package/lib/commonjs/navigators/ContactStack.js.map +1 -1
- package/lib/commonjs/navigators/DeliveryStack.js +0 -16
- package/lib/commonjs/navigators/DeliveryStack.js.map +1 -1
- package/lib/commonjs/navigators/MainStack.js.map +1 -1
- package/lib/commonjs/navigators/NotificationStack.js +0 -16
- package/lib/commonjs/navigators/NotificationStack.js.map +1 -1
- package/lib/commonjs/navigators/OnboardingScreens.js.map +1 -1
- package/lib/commonjs/navigators/defaultStackOptions.js +2 -0
- package/lib/commonjs/navigators/defaultStackOptions.js.map +1 -1
- package/lib/commonjs/screens/Chat.js +11 -1
- package/lib/commonjs/screens/Chat.js.map +1 -1
- package/lib/commonjs/screens/CredentialDetails.js.map +1 -1
- package/lib/commonjs/screens/PINChange.js +9 -6
- package/lib/commonjs/screens/PINChange.js.map +1 -1
- package/lib/commonjs/screens/PINEnter.js +10 -8
- package/lib/commonjs/screens/PINEnter.js.map +1 -1
- package/lib/commonjs/screens/PINVerify.js +13 -11
- package/lib/commonjs/screens/PINVerify.js.map +1 -1
- package/lib/commonjs/screens/Terms.js +1 -19
- package/lib/commonjs/screens/Terms.js.map +1 -1
- package/lib/commonjs/screens/ToggleBiometry.js +2 -1
- package/lib/commonjs/screens/ToggleBiometry.js.map +1 -1
- package/lib/commonjs/services/logger.js +32 -8
- package/lib/commonjs/services/logger.js.map +1 -1
- package/lib/commonjs/types/state.js +4 -0
- package/lib/module/App.js +1 -2
- package/lib/module/App.js.map +1 -1
- package/lib/module/assets/oca-bundles.json +4 -4
- package/lib/module/components/inputs/PINInput.js +4 -2
- package/lib/module/components/inputs/PINInput.js.map +1 -1
- package/lib/module/components/misc/CredentialCard11.js +34 -13
- package/lib/module/components/misc/CredentialCard11.js.map +1 -1
- package/lib/module/components/modals/DeveloperModal.js +2 -8
- package/lib/module/components/modals/DeveloperModal.js.map +1 -1
- package/lib/module/components/views/Banner.js +152 -0
- package/lib/module/components/views/Banner.js.map +1 -0
- package/lib/module/components/views/HeaderWithBanner.js +10 -0
- package/lib/module/components/views/HeaderWithBanner.js.map +1 -0
- package/lib/module/components/views/KeyboardView.js +22 -9
- package/lib/module/components/views/KeyboardView.js.map +1 -1
- package/lib/module/container-api.js +1 -0
- package/lib/module/container-api.js.map +1 -1
- package/lib/module/container-impl.js +2 -0
- package/lib/module/container-impl.js.map +1 -1
- package/lib/module/contexts/network.js +37 -1
- package/lib/module/contexts/network.js.map +1 -1
- package/lib/module/contexts/reducers/store.js +30 -14
- package/lib/module/contexts/reducers/store.js.map +1 -1
- package/lib/module/contexts/store.js +3 -3
- package/lib/module/contexts/store.js.map +1 -1
- package/lib/module/index.js +1 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/localization/en/en.json +3 -0
- package/lib/module/localization/fr/fr.json +3 -1
- package/lib/module/localization/pt-br/pt-br.json +3 -1
- package/lib/module/modules/history/ui/HistorySettings.js.map +1 -1
- package/lib/module/modules/openid/screens/OpenIDProofChangeCredential.js +1 -1
- package/lib/module/modules/openid/screens/OpenIDProofChangeCredential.js.map +1 -1
- package/lib/module/navigators/ContactStack.js +0 -16
- package/lib/module/navigators/ContactStack.js.map +1 -1
- package/lib/module/navigators/DeliveryStack.js +0 -16
- package/lib/module/navigators/DeliveryStack.js.map +1 -1
- package/lib/module/navigators/MainStack.js.map +1 -1
- package/lib/module/navigators/NotificationStack.js +0 -16
- package/lib/module/navigators/NotificationStack.js.map +1 -1
- package/lib/module/navigators/OnboardingScreens.js.map +1 -1
- package/lib/module/navigators/defaultStackOptions.js +2 -0
- package/lib/module/navigators/defaultStackOptions.js.map +1 -1
- package/lib/module/screens/Chat.js +11 -1
- package/lib/module/screens/Chat.js.map +1 -1
- package/lib/module/screens/CredentialDetails.js.map +1 -1
- package/lib/module/screens/PINChange.js +9 -6
- package/lib/module/screens/PINChange.js.map +1 -1
- package/lib/module/screens/PINEnter.js +10 -8
- package/lib/module/screens/PINEnter.js.map +1 -1
- package/lib/module/screens/PINVerify.js +13 -11
- package/lib/module/screens/PINVerify.js.map +1 -1
- package/lib/module/screens/Terms.js +1 -19
- package/lib/module/screens/Terms.js.map +1 -1
- package/lib/module/screens/ToggleBiometry.js +2 -1
- package/lib/module/screens/ToggleBiometry.js.map +1 -1
- package/lib/module/services/logger.js +32 -8
- package/lib/module/services/logger.js.map +1 -1
- package/lib/module/types/state.js +1 -1
- package/lib/typescript/src/App.d.ts.map +1 -1
- package/lib/typescript/src/components/chat/ChatActions.d.ts.map +1 -1
- package/lib/typescript/src/components/chat/ChatBubble.d.ts.map +1 -1
- package/lib/typescript/src/components/chat/MessageInput.d.ts.map +1 -1
- package/lib/typescript/src/components/inputs/PINInput.d.ts +1 -0
- package/lib/typescript/src/components/inputs/PINInput.d.ts.map +1 -1
- package/lib/typescript/src/components/listItems/ContactCredentialListItem.d.ts.map +1 -1
- package/lib/typescript/src/components/misc/CredentialCard11.d.ts.map +1 -1
- package/lib/typescript/src/components/misc/CredentialCard11ActionFooter.d.ts.map +1 -1
- package/lib/typescript/src/components/misc/PINHeader.d.ts.map +1 -1
- package/lib/typescript/src/components/modals/DeveloperModal.d.ts.map +1 -1
- package/lib/typescript/src/components/tour/TourOverlay.d.ts.map +1 -1
- package/lib/typescript/src/components/views/Banner.d.ts +16 -0
- package/lib/typescript/src/components/views/Banner.d.ts.map +1 -0
- package/lib/typescript/src/components/views/HeaderWithBanner.d.ts +5 -0
- package/lib/typescript/src/components/views/HeaderWithBanner.d.ts.map +1 -0
- package/lib/typescript/src/components/views/KeyboardView.d.ts +1 -0
- package/lib/typescript/src/components/views/KeyboardView.d.ts.map +1 -1
- package/lib/typescript/src/container-api.d.ts +3 -0
- package/lib/typescript/src/container-api.d.ts.map +1 -1
- package/lib/typescript/src/container-impl.d.ts +1 -0
- package/lib/typescript/src/container-impl.d.ts.map +1 -1
- package/lib/typescript/src/contexts/navigation.d.ts.map +1 -1
- package/lib/typescript/src/contexts/network.d.ts.map +1 -1
- package/lib/typescript/src/contexts/reducers/store.d.ts +6 -4
- package/lib/typescript/src/contexts/reducers/store.d.ts.map +1 -1
- package/lib/typescript/src/contexts/store.d.ts.map +1 -1
- package/lib/typescript/src/contexts/theme.d.ts.map +1 -1
- package/lib/typescript/src/hooks/chat-messages.d.ts.map +1 -1
- package/lib/typescript/src/hooks/connections.d.ts.map +1 -1
- package/lib/typescript/src/hooks/credential-card-styles.d.ts +2 -2
- package/lib/typescript/src/hooks/credential-card-styles.d.ts.map +1 -1
- package/lib/typescript/src/hooks/credentials.d.ts.map +1 -1
- package/lib/typescript/src/hooks/developer-mode.d.ts.map +1 -1
- package/lib/typescript/src/hooks/notifications.d.ts.map +1 -1
- package/lib/typescript/src/hooks/oob.d.ts.map +1 -1
- package/lib/typescript/src/hooks/proof-request-templates.d.ts.map +1 -1
- package/lib/typescript/src/hooks/proofs.d.ts.map +1 -1
- package/lib/typescript/src/hooks/screen-capture.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useOnboardingState.d.ts.map +1 -1
- package/lib/typescript/src/hooks/usePINValidation.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/localization/index.d.ts.map +1 -1
- package/lib/typescript/src/modules/history/ui/HistorySettings.d.ts +2 -3
- package/lib/typescript/src/modules/history/ui/HistorySettings.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/hooks/openid.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/offerResolve.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/resolverProof.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/utils/utils.d.ts.map +1 -1
- package/lib/typescript/src/navigators/ContactStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/DeliveryStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/MainStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/NotificationStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/OnboardingScreens.d.ts +10 -10
- package/lib/typescript/src/navigators/OnboardingScreens.d.ts.map +1 -1
- package/lib/typescript/src/navigators/defaultStackOptions.d.ts.map +1 -1
- package/lib/typescript/src/onboarding.d.ts.map +1 -1
- package/lib/typescript/src/screens/Chat.d.ts.map +1 -1
- package/lib/typescript/src/screens/ConfigureMediator.d.ts.map +1 -1
- package/lib/typescript/src/screens/CredentialDetails.d.ts +2 -2
- package/lib/typescript/src/screens/CredentialDetails.d.ts.map +1 -1
- package/lib/typescript/src/screens/JSONDetails.d.ts.map +1 -1
- package/lib/typescript/src/screens/OnboardingPages.d.ts.map +1 -1
- package/lib/typescript/src/screens/PINChange.d.ts +2 -3
- package/lib/typescript/src/screens/PINChange.d.ts.map +1 -1
- package/lib/typescript/src/screens/PINEnter.d.ts.map +1 -1
- package/lib/typescript/src/screens/PINVerify.d.ts.map +1 -1
- package/lib/typescript/src/screens/Terms.d.ts.map +1 -1
- package/lib/typescript/src/screens/ToggleBiometry.d.ts.map +1 -1
- package/lib/typescript/src/services/keychain.d.ts.map +1 -1
- package/lib/typescript/src/services/storage.d.ts.map +1 -1
- package/lib/typescript/src/types/navigators.d.ts +1 -0
- package/lib/typescript/src/types/navigators.d.ts.map +1 -1
- package/lib/typescript/src/types/state.d.ts +2 -1
- package/lib/typescript/src/types/state.d.ts.map +1 -1
- package/lib/typescript/src/utils/PINValidation.d.ts.map +1 -1
- package/lib/typescript/src/utils/agent.d.ts.map +1 -1
- package/lib/typescript/src/utils/anonCredsProofRequestMapper.d.ts.map +1 -1
- package/lib/typescript/src/utils/contacts.d.ts.map +1 -1
- package/lib/typescript/src/utils/credential.d.ts.map +1 -1
- package/lib/typescript/src/utils/crypto.d.ts.map +1 -1
- package/lib/typescript/src/utils/fileCache.d.ts.map +1 -1
- package/lib/typescript/src/utils/helpers.d.ts +1 -3
- package/lib/typescript/src/utils/helpers.d.ts.map +1 -1
- package/lib/typescript/src/utils/luminance.d.ts.map +1 -1
- package/lib/typescript/src/utils/mediatorhelpers.d.ts.map +1 -1
- package/lib/typescript/src/utils/migration.d.ts.map +1 -1
- package/lib/typescript/src/utils/network.d.ts.map +1 -1
- package/lib/typescript/src/utils/oca.d.ts.map +1 -1
- package/lib/typescript/src/utils/parsers.d.ts.map +1 -1
- package/lib/typescript/src/utils/proofBundle.d.ts.map +1 -1
- package/lib/typescript/src/utils/testable.d.ts.map +1 -1
- package/package.json +147 -148
- package/src/App.tsx +0 -2
- package/src/assets/oca-bundles.json +4 -4
- package/src/components/buttons/Button.tsx +24 -24
- package/src/components/inputs/PINInput.tsx +3 -1
- package/src/components/misc/CredentialCard11.tsx +40 -16
- package/src/components/modals/DeveloperModal.tsx +1 -2
- package/src/components/views/Banner.tsx +174 -0
- package/src/components/views/HeaderWithBanner.tsx +17 -0
- package/src/components/views/KeyboardView.tsx +23 -9
- package/src/container-api.ts +2 -0
- package/src/container-impl.ts +2 -0
- package/src/contexts/network.tsx +39 -1
- package/src/contexts/reducers/store.ts +30 -13
- package/src/contexts/store.tsx +1 -1
- package/src/index.ts +0 -2
- package/src/localization/en/en.json +3 -0
- package/src/localization/fr/fr.json +3 -1
- package/src/localization/pt-br/pt-br.json +3 -1
- package/src/modules/history/ui/HistorySettings.tsx +2 -3
- package/src/modules/openid/screens/OpenIDProofChangeCredential.tsx +1 -1
- package/src/navigators/ContactStack.tsx +0 -15
- package/src/navigators/DeliveryStack.tsx +0 -18
- package/src/navigators/MainStack.tsx +6 -3
- package/src/navigators/NotificationStack.tsx +0 -18
- package/src/navigators/OnboardingScreens.ts +10 -10
- package/src/navigators/defaultStackOptions.tsx +2 -0
- package/src/screens/Chat.tsx +29 -19
- package/src/screens/CredentialDetails.tsx +5 -2
- package/src/screens/PINChange.tsx +7 -5
- package/src/screens/PINEnter.tsx +6 -7
- package/src/screens/PINVerify.tsx +34 -32
- package/src/screens/Terms.tsx +3 -13
- package/src/screens/ToggleBiometry.tsx +1 -0
- package/src/services/logger.ts +8 -8
- package/src/types/navigators.ts +1 -0
- package/src/types/state.ts +3 -1
- package/lib/commonjs/components/network/NetInfo.js +0 -43
- package/lib/commonjs/components/network/NetInfo.js.map +0 -1
- package/lib/commonjs/hooks/onboarding.js +0 -23
- package/lib/commonjs/hooks/onboarding.js.map +0 -1
- package/lib/module/components/network/NetInfo.js +0 -36
- package/lib/module/components/network/NetInfo.js.map +0 -1
- package/lib/module/hooks/onboarding.js +0 -16
- package/lib/module/hooks/onboarding.js.map +0 -1
- package/lib/typescript/src/components/network/NetInfo.d.ts +0 -3
- package/lib/typescript/src/components/network/NetInfo.d.ts.map +0 -1
- package/lib/typescript/src/hooks/onboarding.d.ts +0 -2
- package/lib/typescript/src/hooks/onboarding.d.ts.map +0 -1
- package/src/components/network/NetInfo.tsx +0 -36
- package/src/hooks/onboarding.ts +0 -16
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { useTranslation } from 'react-i18next'
|
|
3
|
+
import { StyleSheet, TouchableOpacity, View } from 'react-native'
|
|
4
|
+
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
5
|
+
import { DispatchAction } from '../../contexts/reducers/store'
|
|
6
|
+
import { useStore } from '../../contexts/store'
|
|
7
|
+
import { useTheme } from '../../contexts/theme'
|
|
8
|
+
import { testIdWithKey } from '../../utils/testable'
|
|
9
|
+
import { ThemedText } from '../texts/ThemedText'
|
|
10
|
+
|
|
11
|
+
export interface BannerMessage {
|
|
12
|
+
id: string
|
|
13
|
+
title: string
|
|
14
|
+
type: 'error' | 'warning' | 'info' | 'success'
|
|
15
|
+
variant: 'summary' | 'detail'
|
|
16
|
+
dismissible?: boolean
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface BannerSectionProps extends BannerMessage {
|
|
20
|
+
expanded?: boolean
|
|
21
|
+
onDismiss?: () => void
|
|
22
|
+
onToggle?: () => void
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Banner: React.FC = () => {
|
|
26
|
+
const [store, dispatch] = useStore()
|
|
27
|
+
const [expanded, setExpanded] = useState(false)
|
|
28
|
+
const bannerMessages = store.preferences.bannerMessages
|
|
29
|
+
const { t } = useTranslation()
|
|
30
|
+
const alertMessage: BannerMessage = {
|
|
31
|
+
id: 'alertMessage',
|
|
32
|
+
title: t('Banner.AlertsLength', { alerts: bannerMessages.length }),
|
|
33
|
+
type: 'error',
|
|
34
|
+
variant: 'summary',
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const dismissBanner = (key: string) => {
|
|
38
|
+
dispatch({
|
|
39
|
+
type: DispatchAction.REMOVE_BANNER_MESSAGE,
|
|
40
|
+
payload: [key],
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
if (!bannerMessages || bannerMessages.length == 0) {
|
|
44
|
+
return null
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (bannerMessages.length === 1) {
|
|
48
|
+
const message = bannerMessages[0]
|
|
49
|
+
return (
|
|
50
|
+
<BannerSection
|
|
51
|
+
id={message.id}
|
|
52
|
+
key={message.id}
|
|
53
|
+
title={message.title}
|
|
54
|
+
type={message.type}
|
|
55
|
+
variant="detail"
|
|
56
|
+
onDismiss={() => dismissBanner(message.id)}
|
|
57
|
+
dismissible={message.dismissible}
|
|
58
|
+
/>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<View>
|
|
64
|
+
<BannerSection
|
|
65
|
+
id={alertMessage.id}
|
|
66
|
+
title={t('Banner.AlertsLength', { alerts: bannerMessages.length })}
|
|
67
|
+
type={alertMessage.type}
|
|
68
|
+
variant={alertMessage.variant}
|
|
69
|
+
expanded={expanded}
|
|
70
|
+
onToggle={() => setExpanded(!expanded)}
|
|
71
|
+
dismissible={alertMessage.dismissible}
|
|
72
|
+
/>
|
|
73
|
+
{expanded &&
|
|
74
|
+
bannerMessages.map((message) => (
|
|
75
|
+
<BannerSection
|
|
76
|
+
id={message.id}
|
|
77
|
+
key={message.id}
|
|
78
|
+
title={message.title}
|
|
79
|
+
type={message.type}
|
|
80
|
+
variant="detail"
|
|
81
|
+
onDismiss={() => dismissBanner(message.id)}
|
|
82
|
+
dismissible={message.dismissible}
|
|
83
|
+
/>
|
|
84
|
+
))}
|
|
85
|
+
</View>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const BannerSection: React.FC<BannerSectionProps> = ({
|
|
90
|
+
title,
|
|
91
|
+
type,
|
|
92
|
+
onDismiss,
|
|
93
|
+
dismissible = true,
|
|
94
|
+
variant,
|
|
95
|
+
expanded,
|
|
96
|
+
onToggle,
|
|
97
|
+
}) => {
|
|
98
|
+
const { Spacing, ColorPallet } = useTheme()
|
|
99
|
+
const styles = StyleSheet.create({
|
|
100
|
+
container: {
|
|
101
|
+
backgroundColor: ColorPallet.brand.primary,
|
|
102
|
+
flexDirection: 'row',
|
|
103
|
+
alignItems: 'center',
|
|
104
|
+
padding: Spacing.md,
|
|
105
|
+
},
|
|
106
|
+
icon: {
|
|
107
|
+
marginRight: Spacing.md,
|
|
108
|
+
},
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
const iconName = (type: string): string => {
|
|
112
|
+
switch (type) {
|
|
113
|
+
case 'error':
|
|
114
|
+
return 'alert-circle'
|
|
115
|
+
case 'warning':
|
|
116
|
+
return 'alert'
|
|
117
|
+
case 'info':
|
|
118
|
+
return 'information'
|
|
119
|
+
case 'success':
|
|
120
|
+
return 'check-circle'
|
|
121
|
+
default:
|
|
122
|
+
return 'information'
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const bannerColor = (type: string): string => {
|
|
127
|
+
switch (type) {
|
|
128
|
+
case 'error':
|
|
129
|
+
return '#CE3E39'
|
|
130
|
+
case 'warning':
|
|
131
|
+
return '#F8BB47'
|
|
132
|
+
case 'info':
|
|
133
|
+
return '#2E5DD7'
|
|
134
|
+
case 'success':
|
|
135
|
+
return '#42814A'
|
|
136
|
+
default:
|
|
137
|
+
return '#2E5DD7'
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// If more details are needed we might need to push the banner down to accommodate the extra information
|
|
142
|
+
return (
|
|
143
|
+
<TouchableOpacity
|
|
144
|
+
style={{ ...styles.container, backgroundColor: bannerColor(type) }}
|
|
145
|
+
testID={testIdWithKey(`button-${type}`)}
|
|
146
|
+
onPress={() => {
|
|
147
|
+
if (variant === 'summary' && onToggle) {
|
|
148
|
+
onToggle()
|
|
149
|
+
} else if (dismissible && onDismiss) {
|
|
150
|
+
onDismiss()
|
|
151
|
+
}
|
|
152
|
+
}}
|
|
153
|
+
>
|
|
154
|
+
<Icon
|
|
155
|
+
name={iconName(type)}
|
|
156
|
+
size={24}
|
|
157
|
+
color={type === 'warning' ? ColorPallet.brand.secondaryBackground : ColorPallet.grayscale.white}
|
|
158
|
+
style={styles.icon}
|
|
159
|
+
testID={testIdWithKey(`icon-${type}`)}
|
|
160
|
+
/>
|
|
161
|
+
<ThemedText
|
|
162
|
+
variant={'bold'}
|
|
163
|
+
style={{
|
|
164
|
+
color: type === 'warning' ? ColorPallet.brand.secondaryBackground : ColorPallet.grayscale.white,
|
|
165
|
+
flex: 1,
|
|
166
|
+
}}
|
|
167
|
+
testID={testIdWithKey(`text-${type}`)}
|
|
168
|
+
>
|
|
169
|
+
{title}
|
|
170
|
+
</ThemedText>
|
|
171
|
+
{variant === 'summary' && <Icon name={expanded ? 'chevron-up' : 'chevron-down'} size={24} color="white" />}
|
|
172
|
+
</TouchableOpacity>
|
|
173
|
+
)
|
|
174
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View } from 'react-native'
|
|
3
|
+
import { StackHeaderProps, Header } from '@react-navigation/stack'
|
|
4
|
+
import { useServices, TOKENS } from '../../container-api'
|
|
5
|
+
|
|
6
|
+
const HeaderWithBanner: React.FC<StackHeaderProps> = (props) => {
|
|
7
|
+
const [NotificationBanner] = useServices([TOKENS.COMPONENT_NOTIFICATION_BANNER])
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<View>
|
|
11
|
+
<Header {...props} />
|
|
12
|
+
<NotificationBanner />
|
|
13
|
+
</View>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default HeaderWithBanner
|
|
@@ -1,25 +1,39 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { KeyboardAvoidingView,
|
|
2
|
+
import { KeyboardAvoidingView, ScrollView } from 'react-native'
|
|
3
3
|
import { SafeAreaView } from 'react-native-safe-area-context'
|
|
4
4
|
import { useTheme } from '../../contexts/theme'
|
|
5
|
+
import { useHeaderHeight } from '@react-navigation/elements'
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
+
const useSafeHeaderHeight = (): number => {
|
|
8
|
+
try {
|
|
9
|
+
return useHeaderHeight()
|
|
10
|
+
} catch {
|
|
11
|
+
return 100
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const KeyboardView: React.FC<{ children: React.ReactNode; keyboardAvoiding?: boolean }> = ({
|
|
16
|
+
children,
|
|
17
|
+
keyboardAvoiding = true,
|
|
18
|
+
}) => {
|
|
7
19
|
const { ColorPallet } = useTheme()
|
|
20
|
+
const headerHeight = useSafeHeaderHeight()
|
|
8
21
|
return (
|
|
9
22
|
<SafeAreaView
|
|
10
23
|
style={{ flex: 1, backgroundColor: ColorPallet.brand.primaryBackground }}
|
|
11
24
|
edges={['bottom', 'left', 'right']}
|
|
12
25
|
>
|
|
13
|
-
|
|
14
|
-
style={{ flex: 1 }}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
26
|
+
{keyboardAvoiding ? (
|
|
27
|
+
<KeyboardAvoidingView style={{ flex: 1 }} keyboardVerticalOffset={headerHeight} behavior="padding">
|
|
28
|
+
<ScrollView contentContainerStyle={{ flexGrow: 1 }} keyboardShouldPersistTaps={'handled'}>
|
|
29
|
+
{children}
|
|
30
|
+
</ScrollView>
|
|
31
|
+
</KeyboardAvoidingView>
|
|
32
|
+
) : (
|
|
19
33
|
<ScrollView contentContainerStyle={{ flexGrow: 1 }} keyboardShouldPersistTaps={'handled'}>
|
|
20
34
|
{children}
|
|
21
35
|
</ScrollView>
|
|
22
|
-
|
|
36
|
+
)}
|
|
23
37
|
</SafeAreaView>
|
|
24
38
|
)
|
|
25
39
|
}
|
package/src/container-api.ts
CHANGED
|
@@ -77,6 +77,7 @@ export const HOOK_TOKENS = {
|
|
|
77
77
|
|
|
78
78
|
export const COMPONENT_TOKENS = {
|
|
79
79
|
COMPONENT_HOME_HEADER: 'component.home.header',
|
|
80
|
+
COMPONENT_NOTIFICATION_BANNER: 'component.notification.banner',
|
|
80
81
|
COMPONENT_HOME_NOTIFICATIONS_EMPTY_LIST: 'component.home.notifications-empty-list',
|
|
81
82
|
COMPONENT_HOME_FOOTER: 'component.home.footer',
|
|
82
83
|
COMPONENT_CRED_EMPTY_LIST: 'component.cred.empty-list',
|
|
@@ -215,6 +216,7 @@ export type TokenMapping = {
|
|
|
215
216
|
[TOKENS.COMPONENT_CRED_LIST_OPTIONS]: React.FC
|
|
216
217
|
[TOKENS.COMPONENT_CRED_LIST_FOOTER]: React.FC<CredentialListFooterProps>
|
|
217
218
|
[TOKENS.COMPONENT_HOME_HEADER]: React.FC
|
|
219
|
+
[TOKENS.COMPONENT_NOTIFICATION_BANNER]: React.FC
|
|
218
220
|
[TOKENS.COMPONENT_HOME_NOTIFICATIONS_EMPTY_LIST]: React.FC
|
|
219
221
|
[TOKENS.COMPONENT_HOME_FOOTER]: React.FC
|
|
220
222
|
[TOKENS.COMPONENT_CRED_EMPTY_LIST]: React.FC
|
package/src/container-impl.ts
CHANGED
|
@@ -15,6 +15,7 @@ import NoNewUpdates from './components/misc/NoNewUpdates'
|
|
|
15
15
|
import PINHeader from './components/misc/PINHeader'
|
|
16
16
|
import Record from './components/record/Record'
|
|
17
17
|
import HomeFooterView from './components/views/HomeFooterView'
|
|
18
|
+
import { Banner } from './components/views/Banner'
|
|
18
19
|
import HomeHeaderView from './components/views/HomeHeaderView'
|
|
19
20
|
import defaultIndyLedgers from './configs/ledgers/indy'
|
|
20
21
|
import { LocalStorageKeys, PINRules } from './constants'
|
|
@@ -153,6 +154,7 @@ export class MainContainer implements Container {
|
|
|
153
154
|
this._container.registerInstance(TOKENS.COMPONENT_CRED_LIST_OPTIONS, () => null)
|
|
154
155
|
this._container.registerInstance(TOKENS.COMPONENT_CRED_LIST_FOOTER, () => null)
|
|
155
156
|
this._container.registerInstance(TOKENS.COMPONENT_HOME_HEADER, HomeHeaderView)
|
|
157
|
+
this._container.registerInstance(TOKENS.COMPONENT_NOTIFICATION_BANNER, Banner)
|
|
156
158
|
this._container.registerInstance(TOKENS.COMPONENT_HOME_NOTIFICATIONS_EMPTY_LIST, NoNewUpdates)
|
|
157
159
|
this._container.registerInstance(TOKENS.COMPONENT_HOME_FOOTER, HomeFooterView)
|
|
158
160
|
this._container.registerInstance(TOKENS.COMPONENT_CRED_EMPTY_LIST, EmptyList)
|
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={{
|
|
@@ -28,7 +28,6 @@ enum OnboardingDispatchAction {
|
|
|
28
28
|
DID_NAME_WALLET = 'onboarding/didNameWallet',
|
|
29
29
|
DID_COMPLETE_ONBOARDING = 'onboarding/didCompleteOnboarding',
|
|
30
30
|
ONBOARDING_VERSION = 'onboarding/onboardingVersion',
|
|
31
|
-
SET_POST_AUTH_SCREENS = 'onboarding/postAuthScreens',
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
enum MigrationDispatchAction {
|
|
@@ -64,6 +63,8 @@ enum PreferencesDispatchAction {
|
|
|
64
63
|
SET_SELECTED_MEDIATOR = 'preferences/setSelectedMediator',
|
|
65
64
|
ADD_AVAILABLE_MEDIATOR = 'preferences/addAvailableMediator',
|
|
66
65
|
RESET_MEDIATORS = 'preferences/resetMediators',
|
|
66
|
+
BANNER_MESSAGES = 'preferences/bannerMessages',
|
|
67
|
+
REMOVE_BANNER_MESSAGE = 'REMOVE_BANNER_MESSAGE',
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
enum ToursDispatchAction {
|
|
@@ -561,6 +562,34 @@ export const reducer = <S extends State>(state: S, action: ReducerAction<Dispatc
|
|
|
561
562
|
}
|
|
562
563
|
}
|
|
563
564
|
|
|
565
|
+
case PreferencesDispatchAction.BANNER_MESSAGES: {
|
|
566
|
+
const bannerMessageToAdd = action?.payload ?? []
|
|
567
|
+
const newBannerMessages = [...state.preferences.bannerMessages, ...bannerMessageToAdd]
|
|
568
|
+
const preferences: Preferences = {
|
|
569
|
+
...state.preferences,
|
|
570
|
+
bannerMessages: newBannerMessages,
|
|
571
|
+
}
|
|
572
|
+
PersistentStorage.storeValueForKey(LocalStorageKeys.Preferences, preferences)
|
|
573
|
+
return {
|
|
574
|
+
...state,
|
|
575
|
+
preferences,
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
case PreferencesDispatchAction.REMOVE_BANNER_MESSAGE: {
|
|
580
|
+
const keysToRemove = action?.payload ?? []
|
|
581
|
+
const newBannerMessages = state.preferences.bannerMessages.filter((msg) => !keysToRemove.includes(msg.id))
|
|
582
|
+
const preferences: Preferences = {
|
|
583
|
+
...state.preferences,
|
|
584
|
+
bannerMessages: newBannerMessages,
|
|
585
|
+
}
|
|
586
|
+
PersistentStorage.storeValueForKey(LocalStorageKeys.Preferences, preferences)
|
|
587
|
+
return {
|
|
588
|
+
...state,
|
|
589
|
+
preferences,
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
564
593
|
case OnboardingDispatchAction.ONBOARDING_VERSION: {
|
|
565
594
|
const version = (action?.payload || []).pop()
|
|
566
595
|
const onboarding = {
|
|
@@ -678,18 +707,6 @@ export const reducer = <S extends State>(state: S, action: ReducerAction<Dispatc
|
|
|
678
707
|
|
|
679
708
|
return newState
|
|
680
709
|
}
|
|
681
|
-
case OnboardingDispatchAction.SET_POST_AUTH_SCREENS: {
|
|
682
|
-
const value = (action?.payload || []).pop()
|
|
683
|
-
const onboarding = {
|
|
684
|
-
...state.onboarding,
|
|
685
|
-
postAuthScreens: value,
|
|
686
|
-
}
|
|
687
|
-
const newState = {
|
|
688
|
-
...state,
|
|
689
|
-
onboarding,
|
|
690
|
-
}
|
|
691
|
-
return newState
|
|
692
|
-
}
|
|
693
710
|
case MigrationDispatchAction.DID_MIGRATE_TO_ASKAR: {
|
|
694
711
|
const migration: MigrationState = {
|
|
695
712
|
...state.migration,
|
package/src/contexts/store.tsx
CHANGED
|
@@ -25,7 +25,6 @@ export const defaultState: State = {
|
|
|
25
25
|
didNameWallet: false,
|
|
26
26
|
onboardingVersion: 0,
|
|
27
27
|
didCompleteOnboarding: false,
|
|
28
|
-
postAuthScreens: [],
|
|
29
28
|
},
|
|
30
29
|
authentication: {
|
|
31
30
|
didAuthenticate: false,
|
|
@@ -60,6 +59,7 @@ export const defaultState: State = {
|
|
|
60
59
|
autoLockTime: defaultAutoLockTime, // default wallets lockout time to 5 minutes
|
|
61
60
|
availableMediators: [Config.MEDIATOR_URL ?? ''],
|
|
62
61
|
selectedMediator: Config.MEDIATOR_URL ?? '',
|
|
62
|
+
bannerMessages: [],
|
|
63
63
|
},
|
|
64
64
|
tours: {
|
|
65
65
|
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,
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"Send": "Envoyer",
|
|
51
51
|
"Reset": "Reset (FR)",
|
|
52
52
|
"ViewJSON": "View JSON Details (FR)"
|
|
53
|
-
|
|
54
53
|
},
|
|
55
54
|
"Date": {
|
|
56
55
|
"ShortFormat": "D MMM",
|
|
@@ -927,5 +926,8 @@
|
|
|
927
926
|
"LearnMore": "Learn what's New (FR)",
|
|
928
927
|
"UpdateNow": "Update the app (FR)",
|
|
929
928
|
"UpdateLater": "Do this later (FR)"
|
|
929
|
+
},
|
|
930
|
+
"Banner": {
|
|
931
|
+
"AlertsLength": "You have {{ alerts }} alerts (FR)"
|
|
930
932
|
}
|
|
931
933
|
}
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"Send": "Enviar",
|
|
50
50
|
"Reset": "Reset (PT-BR)",
|
|
51
51
|
"ViewJSON": "View JSON Details (PT-BR)"
|
|
52
|
-
|
|
53
52
|
},
|
|
54
53
|
"Date": {
|
|
55
54
|
"ShortFormat": "D MMM",
|
|
@@ -905,5 +904,8 @@
|
|
|
905
904
|
"LearnMore": "Learn what's New (PT-BR)",
|
|
906
905
|
"UpdateNow": "Update the app (PT-BR)",
|
|
907
906
|
"UpdateLater": "Do this later (PT-BR)"
|
|
907
|
+
},
|
|
908
|
+
"Banner": {
|
|
909
|
+
"AlertsLength": "You have {{ alerts }} alerts (PT-BR)"
|
|
908
910
|
}
|
|
909
911
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useAgent } from '@credo-ts/react-hooks'
|
|
2
|
-
import { ParamListBase } from '@react-navigation/core'
|
|
3
2
|
import { StackScreenProps } from '@react-navigation/stack'
|
|
4
3
|
import React, { useCallback, useEffect, useState } from 'react'
|
|
5
4
|
import { useTranslation } from 'react-i18next'
|
|
@@ -11,14 +10,14 @@ import KeyboardView from '../../../components/views/KeyboardView'
|
|
|
11
10
|
import { TOKENS, useServices } from '../../../container-api'
|
|
12
11
|
import { useAnimatedComponents } from '../../../contexts/animated-components'
|
|
13
12
|
import { useTheme } from '../../../contexts/theme'
|
|
14
|
-
import { Screens } from '../../../types/navigators'
|
|
13
|
+
import { Screens, SettingStackParams } from '../../../types/navigators'
|
|
15
14
|
import { testIdWithKey } from '../../../utils/testable'
|
|
16
15
|
import { HistoryBlockSelection, IHistoryManager } from '../types'
|
|
17
16
|
|
|
18
17
|
import SingleSelectBlock from './components/SingleSelectBlock'
|
|
19
18
|
import { ThemedText } from '../../../components/texts/ThemedText'
|
|
20
19
|
|
|
21
|
-
interface HistorySettingsProps extends StackScreenProps<
|
|
20
|
+
interface HistorySettingsProps extends StackScreenProps<SettingStackParams, Screens.HistorySettings> {}
|
|
22
21
|
|
|
23
22
|
const HistorySettings: React.FC<HistorySettingsProps> = () => {
|
|
24
23
|
const [continueEnabled] = useState(true)
|
|
@@ -97,7 +97,7 @@ const OpenIDProofCredentialSelect: React.FC<Props> = ({ route, navigation }: Pro
|
|
|
97
97
|
<RecordLoading />
|
|
98
98
|
</View>
|
|
99
99
|
) : (
|
|
100
|
-
<ThemedText variant='bold'>{t('ProofRequest.AvailableCards')}</ThemedText>
|
|
100
|
+
<ThemedText variant={'bold'}>{t('ProofRequest.AvailableCards')}</ThemedText>
|
|
101
101
|
)}
|
|
102
102
|
</View>
|
|
103
103
|
)
|
|
@@ -7,10 +7,8 @@ import { useTheme } from '../contexts/theme'
|
|
|
7
7
|
import Chat from '../screens/Chat'
|
|
8
8
|
import ContactDetails from '../screens/ContactDetails'
|
|
9
9
|
import CredentialDetails from '../screens/CredentialDetails'
|
|
10
|
-
import CredentialOffer from '../screens/CredentialOffer'
|
|
11
10
|
import ListContacts from '../screens/ListContacts'
|
|
12
11
|
import ProofDetails from '../screens/ProofDetails'
|
|
13
|
-
import ProofRequest from '../screens/ProofRequest'
|
|
14
12
|
import RenameContact from '../screens/RenameContact'
|
|
15
13
|
import JSONDetails from '../screens/JSONDetails'
|
|
16
14
|
import WhatAreContacts from '../screens/WhatAreContacts'
|
|
@@ -77,11 +75,6 @@ const ContactStack: React.FC = () => {
|
|
|
77
75
|
component={CredentialDetails}
|
|
78
76
|
options={{ title: t('Screens.CredentialDetails'), ...ScreenOptionsDictionary[Screens.CredentialDetails] }}
|
|
79
77
|
/>
|
|
80
|
-
<Stack.Screen
|
|
81
|
-
name={Screens.CredentialOffer}
|
|
82
|
-
component={CredentialOffer}
|
|
83
|
-
options={{ title: t('Screens.CredentialOffer'), ...ScreenOptionsDictionary[Screens.CredentialOffer] }}
|
|
84
|
-
/>
|
|
85
78
|
<Stack.Screen
|
|
86
79
|
name={Screens.ProofDetails}
|
|
87
80
|
component={ProofDetails}
|
|
@@ -91,14 +84,6 @@ const ContactStack: React.FC = () => {
|
|
|
91
84
|
...ScreenOptionsDictionary[Screens.ProofDetails],
|
|
92
85
|
})}
|
|
93
86
|
/>
|
|
94
|
-
<Stack.Screen
|
|
95
|
-
name={Screens.ProofRequest}
|
|
96
|
-
component={ProofRequest}
|
|
97
|
-
options={{
|
|
98
|
-
title: t('Screens.ProofRequest'),
|
|
99
|
-
...ScreenOptionsDictionary[Screens.ProofRequest],
|
|
100
|
-
}}
|
|
101
|
-
/>
|
|
102
87
|
</Stack.Navigator>
|
|
103
88
|
)
|
|
104
89
|
}
|
|
@@ -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
|
|
@@ -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
|
|
@@ -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}
|