Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect bg colour on cancelled page info card #1625

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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