forked from bcgov/bc-wallet-mobile
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: mise à jour du bifold vers la version 436 (#243)
Signed-off-by: fc-santos <[email protected]>
- Loading branch information
Showing
5 changed files
with
127 additions
and
38 deletions.
There are no files selected for viewing
88 changes: 88 additions & 0 deletions
88
.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.436-cdfc82d5ec.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters