From 5e34fd2ccf38df8565f9e1ba0918c7306cddc0f9 Mon Sep 17 00:00:00 2001 From: Lukas Kalbertodt Date: Mon, 11 Dec 2023 13:52:02 +0100 Subject: [PATCH] Hide information on "add child" page behind tooltips Most of that information is really not that important. So in order to not overload the user, we hide it. --- frontend/src/routes/manage/Realm/AddChild.tsx | 80 ++++++++++--------- 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/frontend/src/routes/manage/Realm/AddChild.tsx b/frontend/src/routes/manage/Realm/AddChild.tsx index bef22ce82..a62a94940 100644 --- a/frontend/src/routes/manage/Realm/AddChild.tsx +++ b/frontend/src/routes/manage/Realm/AddChild.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode, useId, useState } from "react"; +import React, { useId, useState } from "react"; import { Trans, useTranslation } from "react-i18next"; import { graphql, useMutation } from "react-relay"; @@ -21,13 +21,13 @@ import { AddChildMutation$data } from "./__generated__/AddChildMutation.graphql" import { Spinner } from "../../../ui/Spinner"; import { Nav } from "../../../layout/Navigation"; import { makeRoute } from "../../../rauta"; -import { Card } from "../../../ui/Card"; import { pathToQuery, ILLEGAL_CHARS, RealmEditLinks, RESERVED_CHARS } from "../../Realm"; import { Breadcrumbs } from "../../../ui/Breadcrumbs"; import { PageTitle } from "../../../layout/header/ui"; import { realmBreadcrumbs } from "../../../util/realm"; import { COLORS } from "../../../color"; -import { screenWidthAtMost } from "@opencast/appkit"; +import { WithTooltip } from "@opencast/appkit"; +import { LuInfo } from "react-icons/lu"; export const PATH = "/~manage/realm/add-child"; @@ -163,8 +163,11 @@ const AddChild: React.FC = ({ parent }) => { input: { height: 42, flexGrow: 1 }, }} > - - +
+
= ({ parent }) => { />
{boxError(errors.name?.message)} - - - - {{ illegalChars: ILLEGAL_CHARS }} - {{ reservedChars: RESERVED_CHARS }} - } - > - +
+ +
+
+ } /> + = ({ parent }) => { {...register("pathSegment", validations.path)} /> {boxError(errors.pathSegment?.message)} -
+
@@ -207,28 +222,21 @@ const AddChild: React.FC = ({ parent }) => { ); }; -type InputWithInfoProps = { +type InfoTooltipProps = { info: JSX.Element | string; - children: ReactNode; }; -const InputWithInfo: React.FC = ({ info, children }) => ( -
-
{children}
- {info} -
+const InfoTooltip: React.FC = ({ info }) => ( + + + );