Skip to content

Commit

Permalink
remove: unused components
Browse files Browse the repository at this point in the history
  • Loading branch information
joonatank committed Apr 29, 2024
1 parent e25c776 commit bfae110
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 160 deletions.
59 changes: 0 additions & 59 deletions apps/ui/components/common/Back.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions apps/ui/components/common/Card.tsx

This file was deleted.

10 changes: 6 additions & 4 deletions apps/ui/components/common/ErrorToast.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import React from "react";
import { Notification } from "hds-react";

export const ErrorToast = ({
export function ErrorToast({
error,
onClose,
title,
}: {
error: string;
onClose?: () => void;
}): JSX.Element => {
title?: string;
}): JSX.Element {
return (
<Notification
type="error"
label={error}
label={title ?? error}
position="top-center"
autoClose
displayAutoCloseProgress={false}
Expand All @@ -20,4 +22,4 @@ export const ErrorToast = ({
{error}
</Notification>
);
};
}
24 changes: 0 additions & 24 deletions apps/ui/components/common/FullscreenSpinner.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions apps/ui/components/common/LoggingIn.tsx

This file was deleted.

6 changes: 4 additions & 2 deletions apps/ui/components/common/PageWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from "react";
import Head from "next/head";
import styled from "styled-components";
import { BannerNotificationsList } from "common/src/components";
import { BannerNotificationTarget } from "common/types/gql-types";
import Footer from "./Footer";
import { Navigation } from "./Navigation/Navigation";
import Title from "./Title";
import { InProgressReservationNotification } from "@/components/reservations/UnpaidReservationNotification";

interface Props {
Expand All @@ -28,7 +28,9 @@ function PageWrapper({
}: Props): JSX.Element {
return (
<>
<Title>Tilavarauspalvelu</Title>
<Head>
<title>Tilavarauspalvelu</title>
</Head>
<Navigation apiBaseUrl={apiBaseUrl} profileLink={profileLink} />
<BannerNotificationsList
centered
Expand Down
13 changes: 0 additions & 13 deletions apps/ui/components/common/Title.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions apps/ui/components/common/Toast.tsx

This file was deleted.

9 changes: 4 additions & 5 deletions apps/ui/components/index/ApplicationRoundCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo } from "react";
import { Container, IconArrowRight } from "hds-react";
import { Card, Container, IconArrowRight } from "hds-react";
import { useTranslation } from "next-i18next";
import { useRouter } from "next/router";
import styled from "styled-components";
Expand All @@ -12,10 +12,9 @@ import {
ApplicationRoundStatusChoice,
} from "common/types/gql-types";
import { IconButton } from "common/src/components";
import Card from "../common/Card";
import { searchUrl } from "../../modules/util";
import { MediumButton } from "../../styles/util";
import { getApplicationRoundName } from "../../modules/applicationRound";
import { searchUrl } from "@/modules/util";
import { MediumButton } from "@/styles/util";
import { getApplicationRoundName } from "@/modules/applicationRound";

interface Props {
applicationRound: ApplicationRoundNode;
Expand Down
18 changes: 5 additions & 13 deletions apps/ui/pages/reservation-unit/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ import {
TwoColumnLayout,
Wrapper,
} from "@/components/reservation-unit/ReservationUnitStyles";
import { Toast } from "@/components/common/Toast";
import QuickReservation, {
type TimeRange,
} from "@/components/reservation-unit/QuickReservation";
Expand All @@ -141,6 +140,7 @@ import {
import { MediumButton } from "@/styles/util";
import LoginFragment from "@/components/LoginFragment";
import { RELATED_RESERVATION_STATES } from "common/src/const";
import { ErrorToast } from "@/components/common/ErrorToast";

type Props = Awaited<ReturnType<typeof getServerSideProps>>["props"];
type PropsNarrowed = Exclude<Props, { notFound: boolean }>;
Expand Down Expand Up @@ -1313,19 +1313,11 @@ const ReservationUnit = ({
)}
</BottomWrapper>
{errorMsg && (
<Toast
type="error"
label={t("reservationUnit:reservationFailed")}
position="top-center"
autoClose={false}
displayAutoCloseProgress={false}
<ErrorToast
title={t("reservationUnit:reservationFailed")}
onClose={() => setErrorMsg(null)}
dismissible
closeButtonLabelText={t("common:error.closeErrorMsg")}
trapFocus
>
{errorMsg}
</Toast>
error={errorMsg}
/>
)}
</Wrapper>
);
Expand Down

0 comments on commit bfae110

Please sign in to comment.