Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
set the selected font value
Oleg Isonenc35610238ea6
diff --git a/apps/designer/app/designer/features/style-panel/controls/font-family/font-family-control.tsx b/apps/designer/app/designer/features/style-panel/controls/font-family/font-family-control.tsxindex cde1df9e96..2b656c0e7f 100644--- a/apps/designer/app/designer/features/style-panel/controls/font-family/font-family-control.tsx+++ b/apps/designer/app/designer/features/style-panel/controls/font-family/font-family-control.tsx@@ -33,7 +33,7 @@ const usePickerSideOffset = (export const FontFamilyControl = ({currentStyle,inheritedStyle,- //setProperty,+ setProperty,styleConfig,}: ControlProps) => {const [isOpen, setIsOpen] = useState(false);@@ -47,7 +47,7 @@ export const FontFamilyControl = ({if (value === undefined) return null;- //const setValue = setProperty(styleConfig.property);+ const setValue = setProperty(styleConfig.property);return (<Grid columns={2}>@@ -68,7 +68,7 @@ export const FontFamilyControl = ({<PopoverPortal><PopoverContent sideOffset={sideOffset} side="right" hideArrow><PopoverHeader title="Fonts" />- <FontsManager value={String(value.value)} />+ <FontsManager value={String(value.value)} onChange={setValue} /></PopoverContent></PopoverPortal></Popover>diff --git a/apps/designer/app/designer/shared/fonts-manager/fonts-manager.tsx b/apps/designer/app/designer/shared/fonts-manager/fonts-manager.tsxindex 0ea61228b2..39f2a0b9fb 100644--- a/apps/designer/app/designer/shared/fonts-manager/fonts-manager.tsx+++ b/apps/designer/app/designer/shared/fonts-manager/fonts-manager.tsx@@ -18,9 +18,10 @@ const getItems = (assets: Array<Asset | PreviewAsset>) =>type FontsManagerProps = {value: string;+ onChange: (value: string) => void;};-export const FontsManager = ({ value }: FontsManagerProps) => {+export const FontsManager = ({ value, onChange }: FontsManagerProps) => {const { assets, onSubmitAssets, onActionData } = useAssets("font");const items = getItems(assets);@@ -43,10 +44,8 @@ export const FontsManager = ({ value }: FontsManagerProps) => {name="prop"items={items}selectedItem={{ label: value }}- //itemToString={(item) => item ?? ""}onItemSelect={(value) => {- console.log("onItemSelect", value);- //onChange(id, "prop", value);+ onChange(value.label);}}renderTextField={({ inputProps: { value, ...inputProps } }) => (<TextField {...inputProps} placeholder="Search" />