Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: mise à jour du bifold vers la version 438 (#253) #254

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
diff --git a/App/components/listItems/NotificationListItem.tsx b/App/components/listItems/NotificationListItem.tsx
index ce791235318e3b773a7f97580f9e205ad9995ded..1bc8109123f4e793dd994dccaa84e3cf7845dc01 100644
--- a/App/components/listItems/NotificationListItem.tsx
+++ b/App/components/listItems/NotificationListItem.tsx
@@ -49,6 +49,8 @@ export interface NotificationListItemProps {
notificationType: NotificationType
notification: BasicMessageRecord | CredentialExchangeRecord | ProofExchangeRecord | CustomNotificationRecord
customNotification?: CustomNotification
+ openSwipeableId?: string | null,
+ onOpenSwipeable?: (id: string | null) => void
}

type DisplayDetails = {
@@ -83,6 +85,8 @@ const NotificationListItem: React.FC<NotificationListItemProps> = ({
notificationType,
notification,
customNotification,
+ openSwipeableId,
+ onOpenSwipeable,
}) => {
const navigation = useNavigation<StackNavigationProp<HomeStackParams>>()
const [store, dispatch] = useStore()
diff --git a/App/screens/Home.tsx b/App/screens/Home.tsx
index ad946ed3ee1af79bbdc90fa70e30eefd6782128c..cad23deeaecba2faebdffe1f1f297f70f408482c 100644
--- a/App/screens/Home.tsx
+++ b/App/screens/Home.tsx
@@ -40,6 +40,8 @@ const Home: React.FC<HomeProps> = () => {
const [showTourPopup, setShowTourPopup] = useState(false)
const screenIsFocused = useIsFocused()

+ const [notificationItemId, setNotificationItemId] = useState<string | null>(null)
+
const styles = StyleSheet.create({
flatlist: {
marginBottom: 35,
@@ -49,26 +51,48 @@ const Home: React.FC<HomeProps> = () => {
const DisplayListItemType = useCallback((item: any): React.ReactNode => {
let component: React.ReactNode
if (item.type === 'BasicMessageRecord') {
- component = <NotificationListItem notificationType={NotificationType.BasicMessage} notification={item} />
+ component = (
+ <NotificationListItem
+ openSwipeableId={notificationItemId}
+ onOpenSwipeable={setNotificationItemId}
+ notificationType={NotificationType.BasicMessage}
+ notification={item} />
+ )
} else if (item.type === 'CredentialRecord') {
let notificationType = NotificationType.CredentialOffer
if (item.revocationNotification) {
notificationType = NotificationType.Revocation
}
- component = <NotificationListItem notificationType={notificationType} notification={item} />
+ component = (
+ <NotificationListItem
+ openSwipeableId={notificationItemId}
+ onOpenSwipeable={setNotificationItemId}
+ notificationType={notificationType}
+ notification={item}
+ />
+ )
} else if (item.type === 'CustomNotification' && customNotification) {
component = (
<NotificationListItem
+ openSwipeableId={notificationItemId}
+ onOpenSwipeable={setNotificationItemId}
notificationType={NotificationType.Custom}
notification={item}
customNotification={customNotification}
/>
)
} else {
- component = <NotificationListItem notificationType={NotificationType.ProofRequest} notification={item} />
+ component = (
+ <NotificationListItem
+ openSwipeableId={notificationItemId}
+ onOpenSwipeable={setNotificationItemId}
+ notificationType={NotificationType.ProofRequest}
+ notification={item}
+ />
+ )
}
return component
- }, [customNotification, NotificationListItem])
+ }, [customNotification, NotificationListItem, notificationItemId, setNotificationItemId])

useEffect(() => {
const shouldShowTour = enableToursConfig && store.tours.enableTours && !store.tours.seenHomeTour
2 changes: 1 addition & 1 deletion app/container-imp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class AppContainer implements Container {
})

const resolver = new RemoteOCABundleResolver(Config.OCA_URL ?? '', {
brandingOverlayType: BrandingOverlayType.Branding10,
brandingOverlayType: BrandingOverlayType.Branding11,
})

this._container.registerInstance(TOKENS.NOTIFICATIONS, {
Expand Down
4 changes: 2 additions & 2 deletions app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ PODS:
- React-jsinspector (0.72.17)
- React-logger (0.72.17):
- glog
- "react-native-attestation (1.0.0-alpha.436+c65cbd86)":
- "react-native-attestation (1.0.0-alpha.438+f9009bd8)":
- RCT-Folly (= 2021.07.22.00)
- React-Core
- react-native-config (1.5.0):
Expand Down Expand Up @@ -783,7 +783,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: 8dc585381e476c3ff2e9468f444c90c4d1d5b874
React-jsinspector: 853b8631b908636bb09ef77cb217376c38a0c8ff
React-logger: 9ca44bb5703bf2355f3c2d2e5e67bfe98ca2dc34
react-native-attestation: 568ad5ea03765e2b07c5623ed05701242608093c
react-native-attestation: f40f2bc9cc8a04444343b01ceb1acfca29305f5a
react-native-config: 5330c8258265c1e5fdb8c009d2cabd6badd96727
react-native-encrypted-storage: db300a3f2f0aba1e818417c1c0a6be549038deb7
react-native-get-random-values: a6ea6a8a65dc93e96e24a11105b1a9c8cfe1d72a
Expand Down
10 changes: 5 additions & 5 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
"@formatjs/intl-relativetimeformat": "9.3.1",
"@hyperledger/anoncreds-react-native": "0.2.4",
"@hyperledger/aries-askar-react-native": "0.2.3",
"@hyperledger/aries-bifold-core": "1.0.0-alpha.436",
"@hyperledger/aries-bifold-remote-logs": "1.0.0-alpha.436",
"@hyperledger/aries-bifold-verifier": "1.0.0-alpha.436",
"@hyperledger/aries-oca": "1.0.0-alpha.436",
"@hyperledger/aries-react-native-attestation": "1.0.0-alpha.436",
"@hyperledger/aries-bifold-core": "1.0.0-alpha.438",
"@hyperledger/aries-bifold-remote-logs": "1.0.0-alpha.438",
"@hyperledger/aries-bifold-verifier": "1.0.0-alpha.438",
"@hyperledger/aries-oca": "1.0.0-alpha.438",
"@hyperledger/aries-react-native-attestation": "1.0.0-alpha.438",
"@hyperledger/indy-vdr-react-native": "0.2.2",
"@hyperledger/indy-vdr-shared": "0.2.2",
"@react-native-async-storage/async-storage": "1.15.11",
Expand Down
4 changes: 1 addition & 3 deletions app/src/hooks/useHistoryDetailPageStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ const useHistoryDetailPageStyles = () => {
container: {
flex: 1,
backgroundColor: ColorPallet.brand.primaryBackground,
padding: 20,
},
contentContainer: {
flex: 1,
paddingHorizontal: 20,
padding: 16,
backgroundColor: ColorPallet.brand.primaryBackground,
},
headerStyle: {
Expand Down
10 changes: 2 additions & 8 deletions app/src/screens/activities/BiometricChangeDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const BiometricChangeDetails: React.FC<BiometricChangeDetailsProp> = ({ route, n
<ScrollView contentContainerStyle={[styles.contentContainer, styles.headerStyle]}>
<HeaderText title={t('History.CardDescription.BiometricUpdated', { operation })} />
<View style={{ marginTop: 20 }} />
<Text style={[TextTheme.normal, styles.subTitle]}>
<Text style={styles.date}>
{t('Date.ModifiedOn')} {modifiedDate}
</Text>
</ScrollView>
Expand All @@ -47,13 +47,7 @@ const BiometricChangeDetails: React.FC<BiometricChangeDetailsProp> = ({ route, n
accessibilityLabel={t('History.Button.DeleteHistory')}
accessibilityRole="button"
>
<MaterialCommunityIcon
name={'trash-can-outline'}
size={iconSize}
style={styles.trashIcon}
accessibilityLabel={t('History.Icon.Delete')}
accessibilityRole="image"
/>
<MaterialCommunityIcon name={'trash-can-outline'} size={iconSize} style={styles.trashIcon} />
<Text style={[TextTheme.normal, styles.deleteText]}>{t('History.Button.DeleteHistory')}</Text>
</TouchableOpacity>
</SafeAreaView>
Expand Down
8 changes: 5 additions & 3 deletions app/src/screens/activities/CardHistoryDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import { Attribute, CredentialOverlay } from '@hyperledger/aries-oca/build/legac
import { StackScreenProps } from '@react-navigation/stack'
import { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { SafeAreaView, View, Text, TouchableOpacity, ActivityIndicator } from 'react-native'
import { View, Text, TouchableOpacity, ActivityIndicator } from 'react-native'
import { SafeAreaView } from 'react-native-safe-area-context'
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'

import HeaderText from '../../components/HeaderText'
Expand Down Expand Up @@ -111,9 +112,10 @@ const CardHistorydDetails: React.FC<CardHistorydDetailsProp> = ({ route, navigat
}

return (
<SafeAreaView style={styles.container}>
<View style={styles.contentContainer}>
<SafeAreaView style={styles.container} edges={['left', 'right', 'bottom']}>
<View style={[styles.contentContainer, { paddingTop: 0, flex: 1 }]}>
<Record
hideFieldValues
fields={overlay.presentationFields || []}
header={() => (
<View style={styles.headerStyle}>
Expand Down
17 changes: 6 additions & 11 deletions app/src/screens/activities/ContactHistoryDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { formatTime } from '@hyperledger/aries-bifold-core/App/utils/helpers'
import { StackScreenProps } from '@react-navigation/stack'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { SafeAreaView, View, Text, TouchableOpacity } from 'react-native'
import { View, Text, TouchableOpacity } from 'react-native'
import { ScrollView } from 'react-native-gesture-handler'
import { SafeAreaView } from 'react-native-safe-area-context'
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'

import HeaderText from '../../components/HeaderText'
Expand All @@ -32,8 +33,8 @@ const ContactHistoryDetails: React.FC<ContactHistoryDetailsProp> = ({ route, nav
const iconSize = 24

return (
<SafeAreaView style={styles.container}>
<ScrollView contentContainerStyle={[styles.contentContainer, styles.headerStyle]}>
<SafeAreaView style={styles.container} edges={['left', 'right', 'bottom']}>
<ScrollView contentContainerStyle={[styles.contentContainer]} showsVerticalScrollIndicator={false}>
<HeaderText
title={t('History.CardDescription.ContactUpdated', {
contactName: itemContent.correspondenceName ? startCaseUnicode(itemContent.correspondenceName) : '',
Expand All @@ -42,7 +43,7 @@ const ContactHistoryDetails: React.FC<ContactHistoryDetailsProp> = ({ route, nav
/>

<View style={{ marginTop: 20 }} />
<Text style={[TextTheme.normal, styles.subTitle]}>
<Text style={styles.date}>
{t('History.Date.changedOn', { operation: operation })} {modifiedDate}
</Text>
</ScrollView>
Expand All @@ -55,13 +56,7 @@ const ContactHistoryDetails: React.FC<ContactHistoryDetailsProp> = ({ route, nav
accessibilityRole="button"
accessibilityLabel={t('History.Button.DeleteHistory')}
>
<MaterialCommunityIcon
name={'trash-can-outline'}
size={iconSize}
style={styles.trashIcon}
accessibilityRole="image"
accessibilityLabel={t('History.Icon.Delete')}
/>
<MaterialCommunityIcon name={'trash-can-outline'} size={iconSize} style={styles.trashIcon} />
<Text style={[TextTheme.normal, styles.deleteText]}>{t('History.Button.DeleteHistory')}</Text>
</TouchableOpacity>
</SafeAreaView>
Expand Down
15 changes: 5 additions & 10 deletions app/src/screens/activities/PinChangeDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { formatTime } from '@hyperledger/aries-bifold-core/App/utils/helpers'
import { StackScreenProps } from '@react-navigation/stack'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { SafeAreaView, View, Text, TouchableOpacity } from 'react-native'
import { View, Text, TouchableOpacity } from 'react-native'
import { ScrollView } from 'react-native-gesture-handler'
import { SafeAreaView } from 'react-native-safe-area-context'
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'

import HeaderText from '../../components/HeaderText'
Expand All @@ -30,8 +31,8 @@ const PinChangeDetails: React.FC<PinChangeDetailsProp> = ({ route, navigation })
const iconSize = 24

return (
<SafeAreaView style={styles.container}>
<ScrollView contentContainerStyle={[styles.contentContainer, styles.headerStyle]}>
<SafeAreaView style={styles.container} edges={['left', 'right', 'bottom']}>
<ScrollView contentContainerStyle={[styles.contentContainer]} showsVerticalScrollIndicator={false}>
<HeaderText title={t('History.CardDescription.WalletPinUpdated')} />
<View style={{ marginTop: 20 }} />
<Text style={styles.date}>
Expand All @@ -47,13 +48,7 @@ const PinChangeDetails: React.FC<PinChangeDetailsProp> = ({ route, navigation })
accessibilityRole="button"
accessibilityLabel={t('History.Button.DeleteHistory')}
>
<MaterialCommunityIcon
name={'trash-can-outline'}
size={iconSize}
style={styles.trashIcon}
accessibilityRole="image"
accessibilityLabel={t('History.Icon.Delete')}
/>
<MaterialCommunityIcon name={'trash-can-outline'} size={iconSize} style={styles.trashIcon} />
<Text style={[TextTheme.normal, styles.deleteText]}>{t('History.Button.DeleteHistory')}</Text>
</TouchableOpacity>
</SafeAreaView>
Expand Down
15 changes: 5 additions & 10 deletions app/src/screens/activities/ProofHistoryDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { GroupedSharedProofDataItem } from '@hyperledger/aries-bifold-verifier'
import { StackScreenProps } from '@react-navigation/stack'
import { useCallback, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { SafeAreaView, View, Text, TouchableOpacity, ScrollView, ActivityIndicator } from 'react-native'
import { View, Text, TouchableOpacity, ScrollView, ActivityIndicator } from 'react-native'
import { SafeAreaView } from 'react-native-safe-area-context'
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'

import HeaderText from '../../components/HeaderText'
Expand Down Expand Up @@ -60,8 +61,8 @@ const ProofHistoryDetails: React.FC<ProofHistoryDetailsProp> = ({ route, navigat
}

return (
<SafeAreaView style={styles.container}>
<ScrollView contentContainerStyle={[styles.contentContainer, styles.headerStyle]}>
<SafeAreaView style={styles.container} edges={['left', 'right', 'bottom']}>
<ScrollView contentContainerStyle={[styles.contentContainer]}>
<HeaderText title={t('History.CardDescription.Proof', { operation })} />
<View style={{ marginTop: 20 }} />
<Text style={styles.subTitle}>
Expand All @@ -84,13 +85,7 @@ const ProofHistoryDetails: React.FC<ProofHistoryDetailsProp> = ({ route, navigat
accessibilityRole="button"
accessibilityLabel={t('History.Button.DeleteHistory')}
>
<MaterialCommunityIcon
name={'trash-can-outline'}
size={iconSize}
style={styles.trashIcon}
accessibilityRole="image"
accessibilityLabel={t('History.Icon.Delete')}
/>
<MaterialCommunityIcon name={'trash-can-outline'} size={iconSize} style={styles.trashIcon} />
<Text style={[TextTheme.normal, styles.deleteText]}>{t('History.Button.DeleteHistory')}</Text>
</TouchableOpacity>
</SafeAreaView>
Expand Down
24 changes: 22 additions & 2 deletions app/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '@hyperledger/aries-bifold-core'
import { IInlineInputMessage } from '@hyperledger/aries-bifold-core/App/theme'
import React from 'react'
import { StyleSheet } from 'react-native'
import { StyleSheet, ViewStyle } from 'react-native'

import EmptyIcon from './assets/img/icons/empty_icon.svg'
import Logo from './assets/img/logo-with-text.svg'
Expand Down Expand Up @@ -382,7 +382,8 @@ export const ListItems = StyleSheet.create({
backgroundColor: ColorPallet.brand.secondaryBackground,
},
recordBorder: {
borderBottomColor: ColorPallet.brand.primaryBackground,
borderBottomWidth: 1,
borderBottomColor: ColorPallet.grayscale.lightGrey,
},
recordLink: {
color: ColorPallet.brand.link,
Expand Down Expand Up @@ -835,6 +836,23 @@ export const ShadowTheme: IShadowTheme = {
},
}

const CredentialCardShadowTheme = {
shadowColor: ColorPallet.notification.infoText,
shadowOffset: {
width: 0,
height: 1,
},
shadowOpacity: 0.24,
shadowRadius: 4,
elevation: 2,
} satisfies ViewStyle

const SelectedCredTheme = {
borderWidth: 5,
borderRadius: 15,
borderColor: ColorPallet.semantic.focus,
} satisfies ViewStyle

export const defaultTheme: ITheme = {
ColorPallet,
TextTheme,
Expand All @@ -856,4 +874,6 @@ export const defaultTheme: ITheme = {
PINInputTheme,
Assets,
InputInlineMessage,
CredentialCardShadowTheme,
SelectedCredTheme,
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@credo-ts/react-hooks": "patch:@credo-ts/react-hooks@npm%3A0.6.0#./.yarn/patches/@credo-ts-react-hooks-npm-0.6.0-3c59ce13d2.patch",
"@hyperledger/indy-vdr-shared@npm:0.2.2": "patch:@hyperledger/indy-vdr-shared@npm%3A0.2.2#~/.yarn/patches/@hyperledger-indy-vdr-shared-npm-0.2.2-b989282fc6.patch",
"@hyperledger/indy-vdr-react-native": "patch:@hyperledger/indy-vdr-react-native@npm%3A0.2.2#~/.yarn/patches/@hyperledger-indy-vdr-react-native-npm-0.2.2-627d424b96.patch",
"@hyperledger/aries-bifold-core@npm:^1.0.0-alpha.436+c65cbd86": "patch:@hyperledger/aries-bifold-core@npm%3A1.0.0-alpha.436#~/.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.436-cdfc82d5ec.patch"
"@hyperledger/aries-bifold-core@npm:^1.0.0-alpha.436+c65cbd86": "patch:@hyperledger/aries-bifold-core@npm%3A1.0.0-alpha.436#~/.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.436-cdfc82d5ec.patch",
"@hyperledger/aries-bifold-core@npm:^1.0.0-alpha.438+f9009bd8": "patch:@hyperledger/aries-bifold-core@npm%3A1.0.0-alpha.438#~/.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.438-31ea1fddec.patch"
}
}
Loading
Loading