Skip to content

Commit

Permalink
fix: incorrect bg colour on cancelled page info card
Browse files Browse the repository at this point in the history
  • Loading branch information
joonatank committed Mar 7, 2025
1 parent 3794e05 commit 7eb20e7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion apps/ui/components/reservation/EditStep0.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export function EditStep0({
<>
<StyledReservationInfoCard
reservation={reservation}
type="confirmed"
type="pending"
disableImage
/>
{/* TODO on mobile in the design this is after the calendar but before action buttons */}
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/components/reservation/EditStep1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export function EditStep1({
<>
<StyledReservationInfoCard
reservation={modifiedReservation}
type="confirmed"
type="pending"
/>
<StyledForm
onSubmit={(e) => {
Expand Down
4 changes: 2 additions & 2 deletions apps/ui/components/reservation/ReservationCancellation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const infoCss = css`
}
`;

const StyledInfoCard = styled(ReservationInfoCard)`
const StyledReservationInfoCard = styled(ReservationInfoCard)`
${infoCss}
`;

Expand Down Expand Up @@ -105,7 +105,7 @@ export function ReservationCancellation(props: CancellationProps): JSX.Element {
{reservation.recurringReservation ? (
<ApplicationInfoCard reservation={reservation} />
) : (
<StyledInfoCard reservation={reservation} type="confirmed" />
<StyledReservationInfoCard reservation={reservation} type="complete" />
)}
<CancellationForm
onNext={onSubmit}
Expand Down
12 changes: 7 additions & 5 deletions apps/ui/components/reservation/ReservationInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import {
getTranslationSafe,
} from "common/src/common/util";

type Type = "pending" | "confirmed" | "complete";

const Wrapper = styled.div<{ $type: Type }>`
/* stylelint-disable custom-property-pattern */
--bg-color-complete: var(--color-silver-light);
--bg-color-pending: var(--color-gold-light);
background-color: var(
--color-${({ $type }) => ($type === "complete" ? "silver" : "gold")}-light
${({ $type }) =>
$type === "complete" ? "--bg-color-complete" : "--bg-color-pending"}
);
`;

Expand Down Expand Up @@ -61,6 +61,8 @@ const Subheading = styled.p`
margin: 0;
`;

type Type = "pending" | "complete";

type Props = {
reservation: ReservationInfoCardFragment;
type: Type;
Expand Down Expand Up @@ -142,7 +144,7 @@ export function ReservationInfoCard({
{name}
</StyledLink>
</H4>
{(type === "confirmed" || type === "complete") && (
{type === "complete" && (
<Subheading>
{t("reservations:reservationNumber")}:{" "}
<span data-testid="reservation__reservation-info-card__reservationNumber">
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/pages/reservations/[id]/confirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function Confirmation({ apiBaseUrl, reservation }: PropsNarrowed) {
<>
<Breadcrumb routes={routes} />
<ReservationPageWrapper $nRows={4}>
<ReservationInfoCard reservation={reservation} type="confirmed" />
<ReservationInfoCard reservation={reservation} type="pending" />
<ReservationConfirmation
apiBaseUrl={apiBaseUrl}
reservation={reservation}
Expand Down

0 comments on commit 7eb20e7

Please sign in to comment.