Skip to content

Commit

Permalink
chore: mise à jour du bifold vers la version 374 (#167)
Browse files Browse the repository at this point in the history
Signed-off-by: fc-santos <filipesantos@live.ca>
  • Loading branch information
fc-santos authored Nov 29, 2024
1 parent 20b57fa commit ebfc31d
Show file tree
Hide file tree
Showing 10 changed files with 228 additions and 265 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
diff --git a/App/components/listItems/NotificationListItem.tsx b/App/components/listItems/NotificationListItem.tsx
index 1c8a86091e207b58a620be00db905b4ba7d06539..b3b630f911d116a0f6ce441c0aae3abe770f2075 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..638c3c8301fe441a8ec07ed74b97cef0235cf8db 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,23 +51,46 @@ 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])
41 changes: 22 additions & 19 deletions app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
initLanguages,
ContainerProvider,
MainContainer,
ActivityProvider,
} from '@hyperledger/aries-bifold-core'
import { OpenIDCredentialRecordProvider } from '@hyperledger/aries-bifold-core/App/modules/openid/context/OpenIDCredentialRecordProvider'
import { useNavigation } from '@react-navigation/native'
Expand Down Expand Up @@ -78,25 +79,27 @@ const App = () => {
<AnimatedComponentsProvider value={animatedComponents}>
<AuthProvider>
<NetworkProvider>
<StatusBar
barStyle="light-content"
hidden={false}
backgroundColor={theme.ColorPallet.brand.primary}
translucent={false}
/>
<NetInfo />
<ErrorModal />
<TourProvider
homeTourSteps={homeTourSteps}
credentialsTourSteps={credentialsTourSteps}
credentialOfferTourSteps={credentialOfferTourSteps}
proofRequestTourSteps={proofRequestTourSteps}
overlayColor={'black'}
overlayOpacity={0.7}
>
<RootStack />
</TourProvider>
<Toast topOffset={toastTopOffset} bottomOffset={toastBottomOffset} config={ToastConfig} />
<ActivityProvider>
<StatusBar
barStyle="light-content"
hidden={false}
backgroundColor={theme.ColorPallet.brand.primary}
translucent={false}
/>
<NetInfo />
<ErrorModal />
<TourProvider
homeTourSteps={homeTourSteps}
credentialsTourSteps={credentialsTourSteps}
credentialOfferTourSteps={credentialOfferTourSteps}
proofRequestTourSteps={proofRequestTourSteps}
overlayColor={'black'}
overlayOpacity={0.7}
>
<RootStack />
</TourProvider>
<Toast topOffset={toastTopOffset} bottomOffset={toastBottomOffset} config={ToastConfig} />
</ActivityProvider>
</NetworkProvider>
</AuthProvider>
</AnimatedComponentsProvider>
Expand Down
2 changes: 1 addition & 1 deletion app/container-imp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class AppContainer implements Container {
// Example: Replacing button in core with custom button
this._container.registerInstance(TOKENS.UTIL_LEDGERS, allLedgers)
this._container.registerInstance(TOKENS.SCREEN_ONBOARDING_PAGES, pages)
this._container.registerInstance(TOKENS.OBJECT_ONBOARDING_CONFIG, defaultScreenOptionsDict)
this._container.registerInstance(TOKENS.OBJECT_SCREEN_CONFIG, defaultScreenOptionsDict)
this._container.registerInstance(TOKENS.SCREEN_TERMS, { screen: TermsStack, version: TermsVersion })
this._container.registerInstance(TOKENS.COMPONENT_PIN_CREATE_HEADER, PINCreateHeader)
this._container.registerInstance(TOKENS.SCREEN_USE_BIOMETRY, UseBiometry)
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.5)
- React-logger (0.72.5):
- glog
- "react-native-attestation (1.0.0-alpha.366+2397235e)":
- "react-native-attestation (1.0.0-alpha.374+9bf85b1b)":
- RCT-Folly (= 2021.07.22.00)
- React-Core
- react-native-config (1.5.0):
Expand Down Expand Up @@ -784,7 +784,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: ff70a72027dea5cc7d71cfcc6fad7f599f63987a
React-jsinspector: aef73cbd43b70675f572214d10fa438c89bf11ba
React-logger: 2e4aee3e11b3ec4fa6cfd8004610bbb3b8d6cca4
react-native-attestation: 8089ba31bd4570abacc16a9ffc82418cd6664750
react-native-attestation: f3a82053ed88e6069f999e951a0658843cf12d49
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": "patch:@hyperledger/aries-bifold-core@npm%3A1.0.0-alpha.366#~/.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.366-8301c15b83.patch",
"@hyperledger/aries-bifold-remote-logs": "1.0.0-alpha.366",
"@hyperledger/aries-bifold-verifier": "1.0.0-alpha.366",
"@hyperledger/aries-oca": "1.0.0-alpha.366",
"@hyperledger/aries-react-native-attestation": "1.0.0-alpha.366",
"@hyperledger/aries-bifold-core": "patch:@hyperledger/aries-bifold-core@npm%3A1.0.0-alpha.374#~/.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.374-1fd00e0b16.patch",
"@hyperledger/aries-bifold-remote-logs": "1.0.0-alpha.374",
"@hyperledger/aries-bifold-verifier": "1.0.0-alpha.374",
"@hyperledger/aries-oca": "1.0.0-alpha.374",
"@hyperledger/aries-react-native-attestation": "1.0.0-alpha.374",
"@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
3 changes: 2 additions & 1 deletion app/src/hooks/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { useCredentialByState, useProofByState, useBasicMessages, useAgent } from '@credo-ts/react-hooks'
import { BifoldAgent, useStore } from '@hyperledger/aries-bifold-core'
import { useOpenID } from '@hyperledger/aries-bifold-core/App/modules/openid/hooks/openid'
import { OpenId4VPRequestRecord } from '@hyperledger/aries-bifold-core/App/modules/openid/types'
import {
BasicMessageMetadata,
CredentialMetadata,
Expand Down Expand Up @@ -138,7 +139,7 @@ export const useNotifications = ({ openIDUri, isHome = true }: NotificationsInpu
)
})

const openIDCreds: Array<SdJwtVcRecord | W3cCredentialRecord> = []
const openIDCreds: Array<SdJwtVcRecord | W3cCredentialRecord | OpenId4VPRequestRecord> = []
if (openIDCredReceived) {
openIDCreds.push(openIDCredReceived)
}
Expand Down
Loading

0 comments on commit ebfc31d

Please sign in to comment.