From a50ff15ca1386206c65e561c288e2a27dc695c70 Mon Sep 17 00:00:00 2001 From: Michael Queyrichon Date: Mon, 3 Mar 2025 12:15:27 +0100 Subject: [PATCH 1/7] Add a tab menu for settings --- frontend/language/src/nb.json | 3 ++ .../ux-editor/src/components/Tabs.module.css | 8 ++++ .../ux-editor/src/components/Tabs.tsx | 42 +++++++++++++++++++ .../FormDesignerNavigation.tsx | 4 ++ 4 files changed, 57 insertions(+) create mode 100644 frontend/packages/ux-editor/src/components/Tabs.module.css create mode 100644 frontend/packages/ux-editor/src/components/Tabs.tsx diff --git a/frontend/language/src/nb.json b/frontend/language/src/nb.json index 3ee368acdb4..093f3e81353 100644 --- a/frontend/language/src/nb.json +++ b/frontend/language/src/nb.json @@ -1913,6 +1913,9 @@ "ux_editor.search_text_resources_close": "Lukk tekstsøk", "ux_editor.search_text_resources_label": "Velg eksisterende tekst basert på ID", "ux_editor.search_text_resources_none": "Ingen", + "ux_editor.settings.data_model_tab": "Datamodell", + "ux_editor.settings.navigation_tab": "Navigasjon", + "ux_editor.settings.other_settings": "Andre innstillinger", "ux_editor.show_icon": "Skal ikonet vises?", "ux_editor.subdomains_label": "Subdomener (kommaseparert)", "ux_editor.subdomains_placeholder": "domene1, domene2, domene3", diff --git a/frontend/packages/ux-editor/src/components/Tabs.module.css b/frontend/packages/ux-editor/src/components/Tabs.module.css new file mode 100644 index 00000000000..d063f11a9b8 --- /dev/null +++ b/frontend/packages/ux-editor/src/components/Tabs.module.css @@ -0,0 +1,8 @@ +.heading { + margin-bottom: var(--fds-spacing-7); +} + +.icon { + font-size: var(--fds-sizing-6); + margin-right: var(--fds-spacing-1); +} diff --git a/frontend/packages/ux-editor/src/components/Tabs.tsx b/frontend/packages/ux-editor/src/components/Tabs.tsx new file mode 100644 index 00000000000..b94a3856abf --- /dev/null +++ b/frontend/packages/ux-editor/src/components/Tabs.tsx @@ -0,0 +1,42 @@ +import type { ReactElement } from 'react'; +import React from 'react'; +import { StudioHeading, StudioTabs } from '@studio/components'; +import { useTranslation } from 'react-i18next'; +import classes from './Tabs.module.css'; +import { CompassIcon, DatabaseIcon } from '@studio/icons'; + +const SettingTabs = [ + { + icon: CompassIcon, + title: 'ux_editor.settings.navigation_tab', + }, + { + icon: DatabaseIcon, + title: 'ux_editor.settings.data_model_tab', + }, +]; + +export const Tabs = (): ReactElement => { + const { t } = useTranslation(); + + return ( + <> + + {t('ux_editor.settings.other_settings')} + + + + {SettingTabs.map((tab) => { + const TabIcon = tab.icon; + return ( + + + {t(tab.title)} + + ); + })} + + + + ); +}; diff --git a/frontend/packages/ux-editor/src/containers/FormDesignNavigation/FormDesignerNavigation.tsx b/frontend/packages/ux-editor/src/containers/FormDesignNavigation/FormDesignerNavigation.tsx index 31498bf4b0f..d4d1e9b3a31 100644 --- a/frontend/packages/ux-editor/src/containers/FormDesignNavigation/FormDesignerNavigation.tsx +++ b/frontend/packages/ux-editor/src/containers/FormDesignNavigation/FormDesignerNavigation.tsx @@ -4,6 +4,7 @@ import classes from './FormDesignerNavigation.module.css'; import { useTranslation } from 'react-i18next'; import { useStudioEnvironmentParams } from 'app-shared/hooks/useStudioEnvironmentParams'; import { useAppConfigQuery } from 'app-development/hooks/queries'; +import { Tabs } from '../../components/Tabs'; export const FormDesignerNavigation = () => { const { t } = useTranslation(); @@ -15,6 +16,9 @@ export const FormDesignerNavigation = () => {
{appConfigData?.serviceName}
+
+ +