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 383 et fixes (#172)
Signed-off-by: fc-santos <[email protected]>
- Loading branch information
Showing
8 changed files
with
130 additions
and
38 deletions.
There are no files selected for viewing
87 changes: 87 additions & 0 deletions
87
.yarn/patches/@hyperledger-aries-bifold-core-npm-1.0.0-alpha.383-3a53f1a5ec.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,87 @@ | ||
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..c6e493347c07bf806ba0615ae4d8be519b401129 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,47 @@ 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
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