Skip to content

Commit

Permalink
(BSR) : remove Spacer
Browse files Browse the repository at this point in the history
  • Loading branch information
nmajorfrances-pass committed Dec 27, 2024
1 parent 1ff7dcb commit dfa060f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ exports[`<BookingConfirmation /> should render correctly 1`] = `
style={
[
{
"gap": 16,
"paddingBottom": 40,
},
]
Expand Down Expand Up @@ -213,16 +214,6 @@ exports[`<BookingConfirmation /> should render correctly 1`] = `
</Text>
</View>
</View>
<View
numberOfSpaces={4}
style={
[
{
"height": 16,
},
]
}
/>
<View
accessibilityLabel="Partager l’offre"
accessibilityState={
Expand Down Expand Up @@ -313,16 +304,6 @@ exports[`<BookingConfirmation /> should render correctly 1`] = `
</Text>
</View>
</View>
<View
numberOfSpaces={4}
style={
[
{
"height": 16,
},
]
}
/>
<View
accessibilityLabel="Retourner à l’accueil"
accessibilityState={
Expand Down
13 changes: 9 additions & 4 deletions src/features/bookOffer/components/BookDateChoice.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { useMemo } from 'react'
import { View } from 'react-native'
import styled from 'styled-components/native'

import { OfferStockResponse } from 'api/gen'
import { Calendar } from 'features/bookOffer/components/Calendar/Calendar'
Expand All @@ -7,7 +9,7 @@ import { useBookingContext } from 'features/bookOffer/context/useBookingContext'
import { getDistinctPricesFromAllStock } from 'features/bookOffer/helpers/bookingHelpers/bookingHelpers'
import { formatToCompleteFrenchDate } from 'libs/parsers/formatDates'
import { TouchableOpacity } from 'ui/components/TouchableOpacity'
import { Spacer, Typo, TypoDS } from 'ui/theme'
import { Spacer, Typo, TypoDS, getSpacing } from 'ui/theme'
import { getHeadingAttrs } from 'ui/theme/typographyAttrs/getHeadingAttrs'

interface Props {
Expand All @@ -31,8 +33,7 @@ export const BookDateChoice = ({ stocks, userRemainingCredit }: Props) => {
const buttonTitle = bookingState.date ? formatToCompleteFrenchDate(bookingState.date) : ''

return (
<React.Fragment>
<Spacer.Column numberOfSpaces={6} />
<StyledView>
<TypoDS.Title3 {...getHeadingAttrs(3)} testID="DateStep">
Date
</TypoDS.Title3>
Expand All @@ -50,6 +51,10 @@ export const BookDateChoice = ({ stocks, userRemainingCredit }: Props) => {
<Typo.ButtonText>{buttonTitle}</Typo.ButtonText>
</TouchableOpacity>
)}
</React.Fragment>
</StyledView>
)
}

const StyledView = styled(View)({
marginTop: getSpacing(6),
})
3 changes: 1 addition & 2 deletions src/features/bookOffer/pages/BookingConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ export function BookingConfirmation() {
<Spacer.Flex />
<ButtonContainer>
<ButtonPrimary key={1} wording="Voir ma réservation" onPress={displayBookingDetails} />
<Spacer.Column numberOfSpaces={4} />
<ButtonSecondary wording="Partager l’offre" onPress={pressShareOffer} />
<Spacer.Column numberOfSpaces={4} />
<InternalTouchableLink
key={2}
as={ButtonTertiaryPrimary}
Expand Down Expand Up @@ -122,4 +120,5 @@ const StyledBody = styled(Typo.Body)({

const ButtonContainer = styled.View({
paddingBottom: getSpacing(10),
gap: getSpacing(4),
})
6 changes: 3 additions & 3 deletions src/features/bookings/components/OnGoingBookingItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,13 @@ export const OnGoingBookingItem = ({ booking, eligibleBookingsForArchive }: Prop
{stock.offer.withdrawalType === WithdrawalTypeEnum.on_site ? (
<WithdrawContainer testID="on-site-withdrawal-container">
<OfferEvent />
<Spacer.Row numberOfSpaces={1} />
<OnSiteWithdrawalCaption numberOfLines={2}>
{withdrawLabel}
</OnSiteWithdrawalCaption>
</WithdrawContainer>
) : (
<WithdrawContainer testID="withdraw-container">
<Clock />
<Spacer.Row numberOfSpaces={1} />
<WithdrawCaption numberOfLines={2}>{withdrawLabel}</WithdrawCaption>
</WithdrawContainer>
)}
Expand All @@ -98,7 +96,6 @@ export const OnGoingBookingItem = ({ booking, eligibleBookingsForArchive }: Prop
{canDisplayExpirationMessage ? (
<ExpirationBookingContainer testID="expiration-booking-container">
<Clock />
<Spacer.Row numberOfSpaces={1} />
<ExpirationBookingLabel>{correctExpirationMessages}</ExpirationBookingLabel>
</ExpirationBookingContainer>
) : null}
Expand Down Expand Up @@ -147,11 +144,13 @@ const DateLabel = styled(Typo.Body)(({ theme }) => ({
}))

const WithdrawCaption = styled(Typo.Caption)({
marginTop: getSpacing(1),
marginRight: getSpacing(4),
})

const OnSiteWithdrawalCaption = styled(WithdrawCaption)(({ theme }) => ({
color: theme.colors.primary,
marginTop: getSpacing(1),
}))

const Clock = styled(DefaultClock).attrs(({ theme }) => ({
Expand All @@ -172,6 +171,7 @@ const ExpirationBookingContainer = styled.View(({ theme }) => ({
}))

const ExpirationBookingLabel = styled(Typo.CaptionPrimary)({
marginTop: getSpacing(1),
marginRight: getSpacing(4),
})

Expand Down

0 comments on commit dfa060f

Please sign in to comment.