Skip to content

Commit

Permalink
update promo
Browse files Browse the repository at this point in the history
  • Loading branch information
briantstephan committed Nov 20, 2024
1 parent 31ea0b2 commit ddb05e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/components/editor/FontSizeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export const FontSizeSelector = (): Field => {
tailwindConfig,
option.value
);
console.log(option.value, customFontSize);
const fontSizePx = customFontSize
? customFontSize.toString()
: option.px;
Expand Down
24 changes: 7 additions & 17 deletions src/components/puck/Promo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import {
EntityField,
YextEntityField,
YextEntityFieldSelector,
NumberOrDefault,
NumberFieldWithDefaultOption,
FontSizeSelector,
} from "../../index.js";
import { Body } from "./atoms/body.js";
import { CTA, CTAProps } from "./atoms/cta.js";
Expand All @@ -23,13 +22,13 @@ export interface PromoProps {
orientation: "left" | "right";
title: {
text: YextEntityField<string>;
fontSize: NumberOrDefault;
fontSize: HeadingProps["fontSize"];
color: HeadingProps["color"];
transform: HeadingProps["transform"];
};
description: {
text: YextEntityField<string>;
fontSize: NumberOrDefault;
fontSize: HeadingProps["fontSize"];
color: HeadingProps["color"];
transform: HeadingProps["transform"];
};
Expand All @@ -42,7 +41,7 @@ export interface PromoProps {
cta: {
entityField: YextEntityField<CTAProps>;
variant: CTAProps["variant"];
fontSize: NumberOrDefault;
fontSize: HeadingProps["fontSize"];
};
}

Expand All @@ -65,10 +64,7 @@ const promoFields: Fields<PromoProps> = {
types: ["type.string"],
},
}),
fontSize: NumberFieldWithDefaultOption({
label: "Font Size",
defaultCustomValue: 48,
}),
fontSize: FontSizeSelector(),
color: {
label: "Font Color",
type: "select",
Expand Down Expand Up @@ -104,10 +100,7 @@ const promoFields: Fields<PromoProps> = {
types: ["type.string"],
},
}),
fontSize: NumberFieldWithDefaultOption({
label: "Font Size",
defaultCustomValue: 12,
}),
fontSize: FontSizeSelector(),
color: {
label: "Font Color",
type: "select",
Expand Down Expand Up @@ -194,10 +187,7 @@ const promoFields: Fields<PromoProps> = {
{ label: "Link", value: "link" },
],
},
fontSize: NumberFieldWithDefaultOption({
label: "Font Size",
defaultCustomValue: 12,
}),
fontSize: FontSizeSelector(),
},
},
};
Expand Down

0 comments on commit ddb05e1

Please sign in to comment.