From 23ba658be90086e3ab69cf8d3dd47170a6239e44 Mon Sep 17 00:00:00 2001 From: Valerio Como Date: Mon, 16 Dec 2024 17:11:42 +0000 Subject: [PATCH] chore: hide warning icon --- src/app/components/Editor.tsx | 12 ++++++------ src/app/components/Head.tsx | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/components/Editor.tsx b/src/app/components/Editor.tsx index 02e183b0..dec45b7b 100644 --- a/src/app/components/Editor.tsx +++ b/src/app/components/Editor.tsx @@ -123,8 +123,6 @@ export default function Editor() { localStorage.setItem(PUBLIC_CODE_EDITOR_WARNINGS, JSON.stringify(warnings)) }, [warnings]) - - const getNestedValue = (obj: PublicCodeWithDeprecatedFields, path: string) => { return path.split('.').reduce((acc, key) => (acc as never)?.[key], obj); } @@ -241,6 +239,7 @@ export default function Editor() { reset({ ...defaultValues }); checkPubliccodeYmlVersion(getValues() as PublicCode); setPublicCodeImported(false); + setWarnings([]) }; const setFormDataAfterImport = async ( @@ -306,10 +305,11 @@ export default function Editor() {
-
- setWarningModalVisibility(true)} />  - {t("editor.warnings")} -
+ {!!warnings.length && +
+ setWarningModalVisibility(true)} />  +
+ }
diff --git a/src/app/components/Head.tsx b/src/app/components/Head.tsx index f4478fea..bf400268 100644 --- a/src/app/components/Head.tsx +++ b/src/app/components/Head.tsx @@ -2,8 +2,8 @@ import { documentationUrl, } from "../contents/constants"; -import { useTranslation } from "react-i18next"; import { Dropdown, DropdownMenu, DropdownToggle, Icon, LinkList, LinkListItem } from "design-react-kit"; +import { useTranslation } from "react-i18next"; import { formatLanguageLabel, getSupportedLanguages } from "../../i18n"; export const Head = (): JSX.Element => {