diff --git a/src/containers/ArticlePage/components/ContentLink.tsx b/src/containers/ArticlePage/components/ContentLink.tsx index e37fea256b..0d4a1549cb 100644 --- a/src/containers/ArticlePage/components/ContentLink.tsx +++ b/src/containers/ArticlePage/components/ContentLink.tsx @@ -7,25 +7,10 @@ */ import { useEffect, useMemo, useState } from "react"; - import { useTranslation } from "react-i18next"; -import styled from "@emotion/styled"; -import { ButtonV2 } from "@ndla/button"; -import { spacing } from "@ndla/core"; -import { FieldErrorMessage, InputV3, Label } from "@ndla/forms"; -import { FormControl } from "../../../components/FormField"; - -const StyledContent = styled.div` - display: flex; - flex-direction: column; - width: 100%; - gap: ${spacing.small}; -`; - -const StyledSaveButton = styled(ButtonV2)` - align-self: flex-end; - width: auto; -`; +import { Button, FieldErrorMessage, FieldInput, FieldLabel, FieldRoot } from "@ndla/primitives"; +import { styled } from "@ndla/styled-system/jsx"; +import { FormActionsContainer, FormContent } from "../../../components/FormikForm"; interface Props { onAddLink: (title: string, url: string) => void; @@ -33,6 +18,12 @@ interface Props { initialUrl?: string; } +const StyledFormContent = styled(FormContent, { + base: { + width: "100%", + }, +}); + const URL_PATTERN = /^((http:|https:)\/\/)/; const ContentLink = ({ onAddLink, initialTitle = "", initialUrl = "" }: Props) => { @@ -62,35 +53,33 @@ const ContentLink = ({ onAddLink, initialTitle = "", initialUrl = "" }: Props) = }; return ( - - - - + + {t("form.name.title")} + {t("form.relatedContent.link.missingTitle")} + setTitle(e.target.value)} /> - {t("form.relatedContent.link.missingTitle")} - - - - + + {t("form.name.url")} + {t("form.relatedContent.link.missingUrl")} + setUrl(e.target.value)} /> - {t("form.relatedContent.link.missingUrl")} - - {t("save")} - + + + + + ); };