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

Commit bfae110

Browse files
committed
remove: unused components
1 parent e25c776 commit bfae110

10 files changed

Lines changed: 19 additions & 160 deletions

File tree

apps/ui/components/common/Back.tsx

Lines changed: 0 additions & 59 deletions
This file was deleted.

apps/ui/components/common/Card.tsx

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import React from "react";
22
import { Notification } from "hds-react";
33

4-
export const ErrorToast = ({
4+
export function ErrorToast({
55
error,
66
onClose,
7+
title,
78
}: {
89
error: string;
910
onClose?: () => void;
10-
}): JSX.Element => {
11+
title?: string;
12+
}): JSX.Element {
1113
return (
1214
<Notification
1315
type="error"
14-
label={error}
16+
label={title ?? error}
1517
position="top-center"
1618
autoClose
1719
displayAutoCloseProgress={false}
@@ -20,4 +22,4 @@ export const ErrorToast = ({
2022
{error}
2123
</Notification>
2224
);
23-
};
25+
}

apps/ui/components/common/FullscreenSpinner.tsx

Lines changed: 0 additions & 24 deletions
This file was deleted.

apps/ui/components/common/LoggingIn.tsx

Lines changed: 0 additions & 8 deletions
This file was deleted.

apps/ui/components/common/PageWrapper.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from "react";
2+
import Head from "next/head";
23
import styled from "styled-components";
34
import { BannerNotificationsList } from "common/src/components";
45
import { BannerNotificationTarget } from "common/types/gql-types";
56
import Footer from "./Footer";
67
import { Navigation } from "./Navigation/Navigation";
7-
import Title from "./Title";
88
import { InProgressReservationNotification } from "@/components/reservations/UnpaidReservationNotification";
99

1010
interface Props {
@@ -28,7 +28,9 @@ function PageWrapper({
2828
}: Props): JSX.Element {
2929
return (
3030
<>
31-
<Title>Tilavarauspalvelu</Title>
31+
<Head>
32+
<title>Tilavarauspalvelu</title>
33+
</Head>
3234
<Navigation apiBaseUrl={apiBaseUrl} profileLink={profileLink} />
3335
<BannerNotificationsList
3436
centered

apps/ui/components/common/Title.tsx

Lines changed: 0 additions & 13 deletions
This file was deleted.

apps/ui/components/common/Toast.tsx

Lines changed: 0 additions & 24 deletions
This file was deleted.

apps/ui/components/index/ApplicationRoundCard.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useMemo } from "react";
2-
import { Container, IconArrowRight } from "hds-react";
2+
import { Card, Container, IconArrowRight } from "hds-react";
33
import { useTranslation } from "next-i18next";
44
import { useRouter } from "next/router";
55
import styled from "styled-components";
@@ -12,10 +12,9 @@ import {
1212
ApplicationRoundStatusChoice,
1313
} from "common/types/gql-types";
1414
import { IconButton } from "common/src/components";
15-
import Card from "../common/Card";
16-
import { searchUrl } from "../../modules/util";
17-
import { MediumButton } from "../../styles/util";
18-
import { getApplicationRoundName } from "../../modules/applicationRound";
15+
import { searchUrl } from "@/modules/util";
16+
import { MediumButton } from "@/styles/util";
17+
import { getApplicationRoundName } from "@/modules/applicationRound";
1918

2019
interface Props {
2120
applicationRound: ApplicationRoundNode;

apps/ui/pages/reservation-unit/[id].tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ import {
118118
TwoColumnLayout,
119119
Wrapper,
120120
} from "@/components/reservation-unit/ReservationUnitStyles";
121-
import { Toast } from "@/components/common/Toast";
122121
import QuickReservation, {
123122
type TimeRange,
124123
} from "@/components/reservation-unit/QuickReservation";
@@ -141,6 +140,7 @@ import {
141140
import { MediumButton } from "@/styles/util";
142141
import LoginFragment from "@/components/LoginFragment";
143142
import { RELATED_RESERVATION_STATES } from "common/src/const";
143+
import { ErrorToast } from "@/components/common/ErrorToast";
144144

145145
type Props = Awaited<ReturnType<typeof getServerSideProps>>["props"];
146146
type PropsNarrowed = Exclude<Props, { notFound: boolean }>;
@@ -1313,19 +1313,11 @@ const ReservationUnit = ({
13131313
)}
13141314
</BottomWrapper>
13151315
{errorMsg && (
1316-
<Toast
1317-
type="error"
1318-
label={t("reservationUnit:reservationFailed")}
1319-
position="top-center"
1320-
autoClose={false}
1321-
displayAutoCloseProgress={false}
1316+
<ErrorToast
1317+
title={t("reservationUnit:reservationFailed")}
13221318
onClose={() => setErrorMsg(null)}
1323-
dismissible
1324-
closeButtonLabelText={t("common:error.closeErrorMsg")}
1325-
trapFocus
1326-
>
1327-
{errorMsg}
1328-
</Toast>
1319+
error={errorMsg}
1320+
/>
13291321
)}
13301322
</Wrapper>
13311323
);

0 commit comments

Comments
 (0)