Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 7c4f79e

Browse files
committed
fix: reservation card column overscaling on desktop
1 parent 7fde3c2 commit 7c4f79e

3 files changed

Lines changed: 10 additions & 29 deletions

File tree

apps/ui/components/reservation/ReservationCancellation.tsx

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,8 @@ type FormValues = {
8484

8585
const StyledInfoCard = styled(ReservationInfoCard)`
8686
@media (min-width: ${breakpoints.m}) {
87-
grid-row: 1 / span 2;
88-
grid-column: -1;
89-
}
90-
`;
91-
92-
const Wrapper = styled(Flex)`
93-
@media (min-width: ${breakpoints.m}) {
94-
grid-row: 2 / -1;
95-
grid-column: 1 / span 2;
96-
}
97-
`;
98-
99-
const TitleSection = styled.div`
100-
@media (min-width: ${breakpoints.m}) {
101-
grid-column: 1 / span 2;
87+
grid-row: 1 / -1;
88+
grid-column: 2;
10289
}
10390
`;
10491

@@ -176,12 +163,12 @@ export function ReservationCancellation(props: Props): JSX.Element {
176163

177164
return (
178165
<ReservationPageWrapper>
179-
<TitleSection>
166+
<div>
180167
<H1 $noMargin>{title}</H1>
181168
<p>{ingress}</p>
182-
</TitleSection>
169+
</div>
183170
<StyledInfoCard reservation={reservation} type="confirmed" />
184-
<Wrapper>
171+
<Flex>
185172
{!isSuccess ? (
186173
<>
187174
<p style={{ margin: 0 }}>{t("reservations:cancelInfoBody")}</p>
@@ -229,7 +216,7 @@ export function ReservationCancellation(props: Props): JSX.Element {
229216
<ReturnLinkList apiBaseUrl={apiBaseUrl} />
230217
</>
231218
)}
232-
</Wrapper>
219+
</Flex>
233220
</ReservationPageWrapper>
234221
);
235222
}

apps/ui/components/reservations/styles.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import styled from "styled-components";
22
import { breakpoints } from "common/src/common/style";
33
import { H1 } from "common/src/common/typography";
44

5+
const CARD_COLUMN_SIZE = 390;
6+
57
export const ReservationPageWrapper = styled.div<{ $nRows?: number }>`
68
display: grid;
79
grid-template-columns: 1fr;
@@ -12,7 +14,7 @@ export const ReservationPageWrapper = styled.div<{ $nRows?: number }>`
1214
padding: 0;
1315
1416
@media (min-width: ${breakpoints.m}) {
15-
grid-template-columns: 2fr 1fr;
17+
grid-template-columns: 1fr ${CARD_COLUMN_SIZE}px;
1618
}
1719
`;
1820

apps/ui/pages/reservations/[id]/confirmation.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ import { breakpoints } from "common";
3333
import { InlineStyledLink } from "@/styles/util";
3434
import { BackLinkList } from "@/components/reservation/CancelledLinkSet";
3535

36-
const StyledInfoCard = styled(ReservationInfoCard)`
37-
@media (min-width: ${breakpoints.m}) {
38-
grid-row: 1 / span 2;
39-
grid-column: -1;
40-
}
41-
`;
42-
4336
function Confirmation({ apiBaseUrl, reservation }: PropsNarrowed) {
4437
const { t } = useTranslation();
4538
const routes = [
@@ -63,7 +56,7 @@ function Confirmation({ apiBaseUrl, reservation }: PropsNarrowed) {
6356
<>
6457
<BreadcrumbWrapper route={routes} />
6558
<ReservationPageWrapper $nRows={4}>
66-
<StyledInfoCard reservation={reservation} type="confirmed" />
59+
<ReservationInfoCard reservation={reservation} type="confirmed" />
6760
<ReservationConfirmation
6861
apiBaseUrl={apiBaseUrl}
6962
reservation={reservation}
@@ -76,7 +69,6 @@ function Confirmation({ apiBaseUrl, reservation }: PropsNarrowed) {
7669
const Wrapper = styled(Flex)`
7770
@media (min-width: ${breakpoints.m}) {
7871
grid-row: 1 / -1;
79-
grid-column: span 2;
8072
}
8173
`;
8274

0 commit comments

Comments
 (0)