From e6b4fe69c7ebf20f44dac6ffd8ffd6ad7ea1d324 Mon Sep 17 00:00:00 2001 From: Dmitri Date: Tue, 31 Mar 2026 10:26:13 +0400 Subject: [PATCH] fixed font selection issue --- .../Constructor/ElementEditorPanel.tsx | 5 ++-- .../CarouselSettingsSection.tsx | 2 +- .../CarouselSettingsSectionCompact.tsx | 2 +- .../DescriptionSettingsSection.tsx | 4 +-- .../DescriptionSettingsSectionCompact.tsx | 4 +-- .../GallerySettingsSection.tsx | 12 ++++---- .../GallerySettingsSectionCompact.tsx | 16 +++++----- .../NavigationSettingsSection.tsx | 18 ++++++++++++ .../NavigationSettingsSectionCompact.tsx | 21 ++++++++++++++ .../TooltipSettingsSection.tsx | 4 +-- .../TooltipSettingsSectionCompact.tsx | 4 +-- .../src/components/ElementSettings/types.ts | 7 +++-- .../ElementSettings/useElementSettingsForm.ts | 12 +++++--- .../UiElements/elements/CarouselElement.tsx | 11 ++++++- .../elements/DescriptionElement.tsx | 22 ++++++++++++-- .../UiElements/elements/GalleryElement.tsx | 29 +++++++++++++++++-- .../UiElements/elements/NavigationElement.tsx | 13 +++++++-- .../UiElements/elements/TooltipElement.tsx | 26 +++++++++++++++-- frontend/src/lib/elementDefaults.ts | 4 +-- .../src/pages/element-type-defaults/[id].tsx | 3 +- .../pages/project-element-defaults/[id].tsx | 3 +- frontend/src/types/constructor.ts | 3 +- 22 files changed, 175 insertions(+), 50 deletions(-) diff --git a/frontend/src/components/Constructor/ElementEditorPanel.tsx b/frontend/src/components/Constructor/ElementEditorPanel.tsx index bb1957d..29d039d 100644 --- a/frontend/src/components/Constructor/ElementEditorPanel.tsx +++ b/frontend/src/components/Constructor/ElementEditorPanel.tsx @@ -366,6 +366,7 @@ export function ElementEditorPanel({ } navType={selectedElement.navType} navLabel={selectedElement.navLabel || ''} + navLabelFontFamily={selectedElement.navLabelFontFamily || ''} navDisabled={selectedElement.navDisabled || false} iconUrl={selectedElement.iconUrl || ''} targetPageSlug={selectedElement.targetPageSlug || ''} @@ -506,8 +507,8 @@ export function ElementEditorPanel({ galleryTitleFontFamily={ selectedElement.galleryTitleFontFamily || '' } - galleryCardFontFamily={ - selectedElement.galleryCardFontFamily || '' + galleryTextFontFamily={ + selectedElement.galleryTextFontFamily || '' } galleryCards={selectedElement.galleryCards || []} imageAssetOptions={imageAssetOptions} diff --git a/frontend/src/components/ElementSettings/CarouselSettingsSection.tsx b/frontend/src/components/ElementSettings/CarouselSettingsSection.tsx index ed4db79..5807cbf 100644 --- a/frontend/src/components/ElementSettings/CarouselSettingsSection.tsx +++ b/frontend/src/components/ElementSettings/CarouselSettingsSection.tsx @@ -98,7 +98,7 @@ const CarouselSettingsSection: React.FC = ({ > {FONT_OPTIONS.map((font) => ( - ))} diff --git a/frontend/src/components/ElementSettings/CarouselSettingsSectionCompact.tsx b/frontend/src/components/ElementSettings/CarouselSettingsSectionCompact.tsx index d45c8dd..063f66d 100644 --- a/frontend/src/components/ElementSettings/CarouselSettingsSectionCompact.tsx +++ b/frontend/src/components/ElementSettings/CarouselSettingsSectionCompact.tsx @@ -97,7 +97,7 @@ const CarouselSettingsSectionCompact: React.FC< > {FONT_OPTIONS.map((font) => ( - ))} diff --git a/frontend/src/components/ElementSettings/DescriptionSettingsSection.tsx b/frontend/src/components/ElementSettings/DescriptionSettingsSection.tsx index 490533b..86f03ec 100644 --- a/frontend/src/components/ElementSettings/DescriptionSettingsSection.tsx +++ b/frontend/src/components/ElementSettings/DescriptionSettingsSection.tsx @@ -94,7 +94,7 @@ const DescriptionSettingsSection: React.FC = ({ > {FONT_OPTIONS.map((font) => ( - ))} @@ -109,7 +109,7 @@ const DescriptionSettingsSection: React.FC = ({ > {FONT_OPTIONS.map((font) => ( - ))} diff --git a/frontend/src/components/ElementSettings/DescriptionSettingsSectionCompact.tsx b/frontend/src/components/ElementSettings/DescriptionSettingsSectionCompact.tsx index 91e10ba..6ca912d 100644 --- a/frontend/src/components/ElementSettings/DescriptionSettingsSectionCompact.tsx +++ b/frontend/src/components/ElementSettings/DescriptionSettingsSectionCompact.tsx @@ -129,7 +129,7 @@ const DescriptionSettingsSectionCompact: React.FC< > {FONT_OPTIONS.map((font) => ( - ))} @@ -149,7 +149,7 @@ const DescriptionSettingsSectionCompact: React.FC< > {FONT_OPTIONS.map((font) => ( - ))} diff --git a/frontend/src/components/ElementSettings/GallerySettingsSection.tsx b/frontend/src/components/ElementSettings/GallerySettingsSection.tsx index c070504..e3cce15 100644 --- a/frontend/src/components/ElementSettings/GallerySettingsSection.tsx +++ b/frontend/src/components/ElementSettings/GallerySettingsSection.tsx @@ -16,7 +16,7 @@ import { FONT_OPTIONS } from '../../lib/fonts'; const GallerySettingsSection: React.FC = ({ galleryCards, galleryTitleFontFamily, - galleryCardFontFamily, + galleryTextFontFamily, onAddCard, onRemoveCard, onUpdateCard, @@ -40,22 +40,22 @@ const GallerySettingsSection: React.FC = ({ > {FONT_OPTIONS.map((font) => ( - ))} - + - onUpdateHeader({ galleryCardFontFamily: event.target.value }) + onUpdateHeader({ galleryTextFontFamily: event.target.value }) } > {FONT_OPTIONS.map((font) => ( - ))} diff --git a/frontend/src/components/ElementSettings/NavigationSettingsSection.tsx b/frontend/src/components/ElementSettings/NavigationSettingsSection.tsx index 8e753a1..900296f 100644 --- a/frontend/src/components/ElementSettings/NavigationSettingsSection.tsx +++ b/frontend/src/components/ElementSettings/NavigationSettingsSection.tsx @@ -7,10 +7,12 @@ import React from 'react'; import FormField from '../FormField'; import type { NavigationSettingsSectionProps } from './types'; +import { FONT_OPTIONS } from '../../lib/fonts'; const NavigationSettingsSection: React.FC = ({ iconUrl, navLabel, + navLabelFontFamily, navType, navDisabled, targetPageId, @@ -64,6 +66,22 @@ const NavigationSettingsSection: React.FC = ({ /> + + + + onChange('navLabelFontFamily', event.target.value)} + > + + {FONT_OPTIONS.map((font) => ( + + ))} + + +