From 50cea0b3352d0290f7623701a65863c176e8fb6f Mon Sep 17 00:00:00 2001 From: iibarbari <45620986+iibarbari@users.noreply.github.com> Date: Tue, 19 Nov 2024 17:55:13 +0300 Subject: [PATCH] remove unnecessary code --- .../FormTitle/FormTitle.module.css | 49 --------------- .../PasswordReset/FormTitle/index.tsx | 61 ------------------- .../src/components/PasswordReset/index.tsx | 4 +- 3 files changed, 2 insertions(+), 112 deletions(-) delete mode 100644 frontend/src/components/PasswordReset/FormTitle/FormTitle.module.css delete mode 100644 frontend/src/components/PasswordReset/FormTitle/index.tsx diff --git a/frontend/src/components/PasswordReset/FormTitle/FormTitle.module.css b/frontend/src/components/PasswordReset/FormTitle/FormTitle.module.css deleted file mode 100644 index 368b15fb..00000000 --- a/frontend/src/components/PasswordReset/FormTitle/FormTitle.module.css +++ /dev/null @@ -1,49 +0,0 @@ -@import "~/styles/media.css"; - -.form-title { - margin-inline: auto; - text-align: center; - - .action-group { - display: flex; - flex-direction: row; - flex-wrap: wrap; - gap: 1rem; - justify-content: center; - margin-top: 2.5rem; - } - - .heading { - font-size: 2rem; - font-weight: 700; - line-height: 3.5rem; - margin-bottom: 0.5rem; - transition: font-size 0.2s ease; - } - - .go-back { - color: rgba(var(--color-foreground-rgb)); - font-size: 0.875rem; - margin-block: 0.75rem 0; - margin-inline: auto; - text-align: end; - } - - .summary { - color: rgba(var(--color-blue-700-rgb)); - font-weight: 700; - margin-bottom: 0.25rem; - } - - @media (prefers-color-scheme: dark) { - .summary { - color: rgba(var(--color-blue-400-rgb)); - } - } - - @media (--min-sm) { - .heading { - font-size: 3rem; - } - } -} diff --git a/frontend/src/components/PasswordReset/FormTitle/index.tsx b/frontend/src/components/PasswordReset/FormTitle/index.tsx deleted file mode 100644 index 3834c2ba..00000000 --- a/frontend/src/components/PasswordReset/FormTitle/index.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import clsx from "clsx"; -import { PropsWithoutRef, ReactNode, JSX, CSSProperties } from "react"; -import styles from "./FormTitle.module.css"; -import { IconChevronLeft } from "@tabler/icons-react"; - -export type AuthenticationHeaderProps = Overwrite, "children">, { - actions?: ReactNode; - description: ReactNode; - maxWidth?: CSSProperties["maxWidth"]; - showGoBack?: boolean; - summary: ReactNode; - title: ReactNode; -}>; - -export default function FormTitle( - { - actions, - className, - description, - maxWidth = "fit-content", - showGoBack = true, - summary, - title, - ...props - }: AuthenticationHeaderProps) { - return ( -
-

{summary}

- -

- {title} -

- -

- {description} -

- - {actions ? ( -
- {actions} -
- ) : null} - - {showGoBack ? ( - - ) : null} -
- ); -} diff --git a/frontend/src/components/PasswordReset/index.tsx b/frontend/src/components/PasswordReset/index.tsx index baff9ef0..242c1ca2 100644 --- a/frontend/src/components/PasswordReset/index.tsx +++ b/frontend/src/components/PasswordReset/index.tsx @@ -5,12 +5,12 @@ import { useErrorBoundary } from "react-error-boundary"; import { useForm } from "react-hook-form"; import { Link, useSearch } from "wouter"; import ActivityOverlay from "~/components/ActivityOverlay"; +import FormTitle from "~/components/FormTitle"; import Layout from "~/components/Layout"; import Title from "~/components/Title"; import useUser from "~/hooks/useUser"; import { api } from "~/lib/api"; import { setErrors } from "~/lib/form"; -import FormTitle from "./FormTitle"; import styles from "./PasswordReset.module.css"; type State = { @@ -106,7 +106,7 @@ export default function PasswordReset() {