From 8e5ed156c1e130dd7d58576bd6ba601cfe260888 Mon Sep 17 00:00:00 2001
From: Nolwen <144016890+nmajorfrances-pass@users.noreply.github.com>
Date: Tue, 4 Mar 2025 11:43:43 +0100
Subject: [PATCH] (PC-34793) feat(BookingPage): disposal forbidden banner
---
.../components/BookingDetailsContent.tsx | 60 ++++++++++++-------
.../BookingDetails.native.test.tsx | 10 ++++
2 files changed, 47 insertions(+), 23 deletions(-)
diff --git a/src/features/bookings/components/BookingDetailsContent.tsx b/src/features/bookings/components/BookingDetailsContent.tsx
index 46aa057d3be..4814122b6c7 100644
--- a/src/features/bookings/components/BookingDetailsContent.tsx
+++ b/src/features/bookings/components/BookingDetailsContent.tsx
@@ -1,4 +1,6 @@
import React from 'react'
+import { ScrollView } from 'react-native'
+import styled from 'styled-components/native'
import { BookingOfferResponseAddress, BookingReponse, BookingVenueResponse } from 'api/gen'
import { TicketCutout } from 'features/bookings/components/TicketCutout'
@@ -7,6 +9,7 @@ import { BookingProperties } from 'features/bookings/types'
import { VenueBlockAddress, VenueBlockVenue } from 'features/offer/components/OfferVenueBlock/type'
import { VenueBlockWithItinerary } from 'features/offer/components/OfferVenueBlock/VenueBlockWithItinerary'
import { formatFullAddress } from 'shared/address/addressFormatter'
+import { ErrorBanner } from 'ui/components/banners/ErrorBanner'
import { InfoBanner } from 'ui/components/banners/InfoBanner'
import { IdCard } from 'ui/svg/icons/IdCard'
import { getSpacing, TypoDS } from 'ui/theme'
@@ -30,30 +33,36 @@ export const BookingDetailsContent = ({
!!offerFullAddress && (properties.isEvent || (properties.isPhysical && !properties.isDigital))
const { hourLabel, dayLabel } = getBookingLabels(booking, properties)
+
return (
-
- }
- title={offer.name}
- infoBanner={
-
- }>
- qrcode
-
+
+
+ }
+ title={offer.name}
+ infoBanner={
+
+ }>
+ qrcode
+
+
+
+
+
)
}
@@ -66,3 +75,8 @@ function getVenueBlockAddress(
): VenueBlockAddress | undefined {
return address ?? undefined
}
+
+const ErrorBannerContainer = styled.View({
+ marginHorizontal: getSpacing(6),
+ marginTop: getSpacing(8),
+})
diff --git a/src/features/bookings/pages/BookingDetails/BookingDetails.native.test.tsx b/src/features/bookings/pages/BookingDetails/BookingDetails.native.test.tsx
index f8242751ba7..d3265943643 100644
--- a/src/features/bookings/pages/BookingDetails/BookingDetails.native.test.tsx
+++ b/src/features/bookings/pages/BookingDetails/BookingDetails.native.test.tsx
@@ -741,6 +741,16 @@ describe('BookingDetails', () => {
openItinerary.mockRestore()
getBookingProperties.mockRestore()
})
+
+ it('should display banner warning about disposal', async () => {
+ renderBookingDetails(ongoingBookings)
+
+ await screen.findByText(ongoingBookings.stock.offer.name)
+
+ expect(
+ screen.getByText('Tu n’as pas le droit de céder ou de revendre ton billet.')
+ ).toBeOnTheScreen()
+ })
})
})