diff --git a/frontend/src/App.scss b/frontend/src/App.scss index 2f92b7972..29be4065d 100644 --- a/frontend/src/App.scss +++ b/frontend/src/App.scss @@ -39,12 +39,12 @@ .react-select__single-value, .react-select__input { - color: black; + color: $text-color; } .react-select__multi-value { background-color: $muted-gray; - color: $text-color; + color: $dark-text; } } @@ -65,7 +65,7 @@ div.react-select__menu { .LoginPrompt { height: 70vh; - width: 960px; + max-width: 960px; margin-left: auto; margin-right: auto; display: flex; diff --git a/frontend/src/Login.tsx b/frontend/src/Login.tsx index d6c5f89e8..bc8d8116d 100644 --- a/frontend/src/Login.tsx +++ b/frontend/src/Login.tsx @@ -3,7 +3,7 @@ import cx from "classnames"; import { type FC, useState } from "react"; import { Button, Col, Form, Row } from "react-bootstrap"; import { useForm } from "react-hook-form"; -import { Link, useLocation, useNavigate } from "react-router-dom"; +import { Link, Navigate, useLocation } from "react-router-dom"; import { ROUTE_FORGOT_PASSWORD, ROUTE_REGISTER } from "src/constants/route"; import { getCredentialsSetting, getPlatformURL } from "src/utils/createClient"; import * as yup from "yup"; @@ -25,7 +25,6 @@ const Messages: Record = { const Login: FC = () => { const [loading, setLoading] = useState(false); const location = useLocation(); - const navigate = useNavigate(); const [loginError, setLoginError] = useState(""); const msg = new URLSearchParams(location.search).get("msg"); const redirect = new URLSearchParams(location.search).get("redirect"); @@ -38,7 +37,7 @@ const Login: FC = () => { resolver: yupResolver(schema), }); - if (isAuthenticated) navigate("/"); + if (isAuthenticated) return ; const onSubmit = async (formData: LoginFormData) => { setLoading(true); diff --git a/frontend/src/components/amendableEditCard/AmendableImageChangeRow.tsx b/frontend/src/components/amendableEditCard/AmendableImageChangeRow.tsx index c6a1aa971..94b975b7f 100644 --- a/frontend/src/components/amendableEditCard/AmendableImageChangeRow.tsx +++ b/frontend/src/components/amendableEditCard/AmendableImageChangeRow.tsx @@ -2,7 +2,7 @@ import { faUndo, faXmark } from "@fortawesome/free-solid-svg-icons"; import cx from "classnames"; import type { FC } from "react"; import { Button, Col, Row } from "react-bootstrap"; -import { Icon } from "src/components/fragments"; +import { DeletedImage, Icon } from "src/components/fragments"; import ImageComponent from "src/components/image"; import { useAmendment } from "./AmendmentContext"; @@ -65,7 +65,7 @@ const AmendableImageChangeRow: FC = ({ })} > {image === null ? ( - Deleted + ) : (
= ({ })} > {image === null ? ( - Deleted + ) : (
{ {}, true, ); - const deleted = container.querySelector("img[alt='Deleted']"); + const deleted = container.querySelector(".DeletedImage"); expect(deleted).toBeInTheDocument(); + expect(within(deleted as HTMLElement).getByText("Deleted")); }); }); diff --git a/frontend/src/components/fragments/DeletedImage.tsx b/frontend/src/components/fragments/DeletedImage.tsx new file mode 100644 index 000000000..c0ba5406e --- /dev/null +++ b/frontend/src/components/fragments/DeletedImage.tsx @@ -0,0 +1,14 @@ +import { faXmark } from "@fortawesome/free-solid-svg-icons"; +import type { FC } from "react"; +import Icon from "./Icon"; + +const CLASSNAME = "DeletedImage"; + +const DeletedImage: FC = () => ( +
+ + Deleted +
+); + +export default DeletedImage; diff --git a/frontend/src/components/fragments/index.ts b/frontend/src/components/fragments/index.ts index 44e3ae376..b0f4f3973 100644 --- a/frontend/src/components/fragments/index.ts +++ b/frontend/src/components/fragments/index.ts @@ -1,3 +1,4 @@ +export { default as DeletedImage } from "./DeletedImage"; export { default as ErrorMessage } from "./ErrorMessage"; export { FavoriteStar } from "./Favorite"; export { default as GenderIcon } from "./GenderIcon"; diff --git a/frontend/src/components/fragments/styles.scss b/frontend/src/components/fragments/styles.scss index 6b85486b5..01accbea2 100644 --- a/frontend/src/components/fragments/styles.scss +++ b/frontend/src/components/fragments/styles.scss @@ -145,3 +145,24 @@ } } } + +.DeletedImage { + align-items: center; + background-color: $secondary; + border-radius: 4px; + color: var(--bs-gray-400); + display: flex; + flex-direction: column; + height: 150px; + justify-content: center; + margin: 5px; + padding: 0 1.25rem; + + .fa-icon { + font-size: 1.75rem; + } + + span { + font-size: 0.85rem; + } +} diff --git a/frontend/src/components/imageChangeRow/ImageChangeRow.tsx b/frontend/src/components/imageChangeRow/ImageChangeRow.tsx index 9d5990024..e8f206b69 100644 --- a/frontend/src/components/imageChangeRow/ImageChangeRow.tsx +++ b/frontend/src/components/imageChangeRow/ImageChangeRow.tsx @@ -1,5 +1,6 @@ import type { FC } from "react"; import { Col, Row } from "react-bootstrap"; +import { DeletedImage } from "src/components/fragments"; import ImageComponent from "src/components/image"; type Image = { @@ -28,7 +29,7 @@ const Images: FC<{ {(images ?? []).map((image, i) => image === null ? ( // biome-ignore lint/suspicious/noArrayIndexKey: Image is deleted, no other key - Deleted + ) : (