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 }) => ( + + + );