From 049f5abbe00c8cabc71a74c9a6395624a38dbc3a Mon Sep 17 00:00:00 2001 From: Colum Kelly Date: Mon, 17 Nov 2025 22:12:29 -0800 Subject: [PATCH] chore(templates): replace arbitrary values with v4 utilities --- .../ecommerce/src/app/(app)/(account)/layout.tsx | 4 +--- .../src/blocks/ArchiveBlock/Component.tsx | 2 +- .../src/blocks/CallToAction/Component.tsx | 2 +- .../ecommerce/src/blocks/Form/Component.tsx | 2 +- .../src/components/AccountNav/index.tsx | 16 ++++++++-------- .../src/components/Cart/DeleteItemButton.tsx | 2 +- .../src/components/CategoryTabs/Item.tsx | 4 ++-- .../ecommerce/src/components/Footer/index.tsx | 2 +- templates/ecommerce/src/components/Logo/Logo.tsx | 2 +- .../ecommerce/src/components/OrderItem/index.tsx | 2 +- .../src/components/OrderStatus/index.tsx | 2 +- .../src/components/ProductGridItem/index.tsx | 2 +- .../src/components/ProductItem/index.tsx | 2 +- .../ecommerce/src/components/RichText/index.tsx | 2 +- .../src/components/checkout/CheckoutPage.tsx | 2 +- templates/ecommerce/src/components/ui/button.tsx | 4 ++-- templates/ecommerce/src/components/ui/select.tsx | 6 +++--- .../ecommerce/src/heros/HighImpact/index.tsx | 2 +- .../ecommerce/src/heros/LowImpact/index.tsx | 2 +- 19 files changed, 30 insertions(+), 32 deletions(-) diff --git a/templates/ecommerce/src/app/(app)/(account)/layout.tsx b/templates/ecommerce/src/app/(app)/(account)/layout.tsx index d8f3626d73d..da147365370 100644 --- a/templates/ecommerce/src/app/(app)/(account)/layout.tsx +++ b/templates/ecommerce/src/app/(app)/(account)/layout.tsx @@ -18,9 +18,7 @@ export default async function RootLayout({ children }: { children: ReactNode })
- {user && ( - - )} + {user && }
{children}
diff --git a/templates/ecommerce/src/blocks/ArchiveBlock/Component.tsx b/templates/ecommerce/src/blocks/ArchiveBlock/Component.tsx index 8bc254ed9fa..4eafdf6c37d 100644 --- a/templates/ecommerce/src/blocks/ArchiveBlock/Component.tsx +++ b/templates/ecommerce/src/blocks/ArchiveBlock/Component.tsx @@ -57,7 +57,7 @@ export const ArchiveBlock: React.FC<
{introContent && (
- +
)} diff --git a/templates/ecommerce/src/blocks/CallToAction/Component.tsx b/templates/ecommerce/src/blocks/CallToAction/Component.tsx index 5b0a5620d85..e27fc1016f2 100644 --- a/templates/ecommerce/src/blocks/CallToAction/Component.tsx +++ b/templates/ecommerce/src/blocks/CallToAction/Component.tsx @@ -13,7 +13,7 @@ export const CallToActionBlock: React.FC< return (
-
+
{richText && }
diff --git a/templates/ecommerce/src/blocks/Form/Component.tsx b/templates/ecommerce/src/blocks/Form/Component.tsx index e1aa95dc1e3..df4e8df54a6 100644 --- a/templates/ecommerce/src/blocks/Form/Component.tsx +++ b/templates/ecommerce/src/blocks/Form/Component.tsx @@ -126,7 +126,7 @@ export const FormBlock: React.FC< ) return ( -
+
{enableIntro && introContent && !hasSubmitted && ( )} diff --git a/templates/ecommerce/src/components/AccountNav/index.tsx b/templates/ecommerce/src/components/AccountNav/index.tsx index 1aa6cd31466..a6f19f7da75 100644 --- a/templates/ecommerce/src/components/AccountNav/index.tsx +++ b/templates/ecommerce/src/components/AccountNav/index.tsx @@ -19,8 +19,8 @@ export const AccountNav: React.FC = ({ className }) => { ) diff --git a/templates/ecommerce/src/components/CategoryTabs/Item.tsx b/templates/ecommerce/src/components/CategoryTabs/Item.tsx index ddc519d44aa..eefe49845a2 100644 --- a/templates/ecommerce/src/components/CategoryTabs/Item.tsx +++ b/templates/ecommerce/src/components/CategoryTabs/Item.tsx @@ -19,9 +19,9 @@ export function Item({ href, title }: Props) {
  • -
    +

    Designed in Michigan

    diff --git a/templates/ecommerce/src/components/Logo/Logo.tsx b/templates/ecommerce/src/components/Logo/Logo.tsx index b62b95aaf4e..a4a6ebbba1a 100644 --- a/templates/ecommerce/src/components/Logo/Logo.tsx +++ b/templates/ecommerce/src/components/Logo/Logo.tsx @@ -5,7 +5,7 @@ export const Logo = () => { /* eslint-disable @next/next/no-img-element */ Payload Logo ) diff --git a/templates/ecommerce/src/components/OrderItem/index.tsx b/templates/ecommerce/src/components/OrderItem/index.tsx index cadc37eb45a..3c0f43be4ec 100644 --- a/templates/ecommerce/src/components/OrderItem/index.tsx +++ b/templates/ecommerce/src/components/OrderItem/index.tsx @@ -15,7 +15,7 @@ export const OrderItem: React.FC = ({ order }) => { return (

    -

    {`#${order.id}`}

    +

    {`#${order.id}`}

    diff --git a/templates/ecommerce/src/components/OrderStatus/index.tsx b/templates/ecommerce/src/components/OrderStatus/index.tsx index cca56223186..ed8a0df5385 100644 --- a/templates/ecommerce/src/components/OrderStatus/index.tsx +++ b/templates/ecommerce/src/components/OrderStatus/index.tsx @@ -10,7 +10,7 @@ export const OrderStatus: React.FC = ({ status, className }) => { return (

    = ({ product }) => { /> ) : null} -
    +
    {title}
    {typeof price === 'number' && ( diff --git a/templates/ecommerce/src/components/ProductItem/index.tsx b/templates/ecommerce/src/components/ProductItem/index.tsx index efe3a085f3e..cdd2e847d50 100644 --- a/templates/ecommerce/src/components/ProductItem/index.tsx +++ b/templates/ecommerce/src/components/ProductItem/index.tsx @@ -73,7 +73,7 @@ export const ProductItem: React.FC = ({ {title}

    {variant && ( -

    +

    {variant.options ?.map((option) => { if (typeof option === 'object') return option.label diff --git a/templates/ecommerce/src/components/RichText/index.tsx b/templates/ecommerce/src/components/RichText/index.tsx index 6839ad6ff9f..2ec29a58535 100644 --- a/templates/ecommerce/src/components/RichText/index.tsx +++ b/templates/ecommerce/src/components/RichText/index.tsx @@ -30,7 +30,7 @@ const jsxConverters: JSXConvertersFunction = ({ defaultConverters }) className="col-start-1 col-span-3" imgClassName="m-0" {...node.fields} - captionClassName="mx-auto max-w-[48rem]" + captionClassName="mx-auto max-w-3xl" enableGutter={false} disableInnerContainer={true} /> diff --git a/templates/ecommerce/src/components/checkout/CheckoutPage.tsx b/templates/ecommerce/src/components/checkout/CheckoutPage.tsx index 04d539a5bdf..c618938d910 100644 --- a/templates/ecommerce/src/components/checkout/CheckoutPage.tsx +++ b/templates/ecommerce/src/components/checkout/CheckoutPage.tsx @@ -406,7 +406,7 @@ export const CheckoutPage: React.FC = () => {

    {title}

    {variant && typeof variant === 'object' && ( -

    +

    {variant.options ?.map((option) => { if (typeof option === 'object') return option.label diff --git a/templates/ecommerce/src/components/ui/button.tsx b/templates/ecommerce/src/components/ui/button.tsx index 02356f746ed..2af71248e84 100644 --- a/templates/ecommerce/src/components/ui/button.tsx +++ b/templates/ecommerce/src/components/ui/button.tsx @@ -16,9 +16,9 @@ const buttonVariants = cva( 'border border-input bg-card shadow-xs hover:bg-accent hover:bg-primary-foreground', secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80', ghost: - 'text-primary/50 hover:text-primary/100 [&.active]:text-primary/100 py-2 px-4 uppercase font-mono tracking-[0.1em] text-xs', + 'text-primary/50 hover:text-primary [&.active]:text-primary py-2 px-4 uppercase font-mono tracking-widest text-xs', link: 'text-primary underline-offset-4 hover:underline', - nav: 'text-primary/50 hover:text-primary/100 [&.active]:text-primary/100 p-0 pt-2 pb-6 uppercase font-mono tracking-[0.1em] text-xs', + nav: 'text-primary/50 hover:text-primary [&.active]:text-primary p-0 pt-2 pb-6 uppercase font-mono tracking-widest text-xs', }, size: { clear: '', diff --git a/templates/ecommerce/src/components/ui/select.tsx b/templates/ecommerce/src/components/ui/select.tsx index db05583b367..079bee97968 100644 --- a/templates/ecommerce/src/components/ui/select.tsx +++ b/templates/ecommerce/src/components/ui/select.tsx @@ -27,7 +27,7 @@ function SelectTrigger({ {children} @@ -93,7 +93,7 @@ function SelectItem({ = ({ links, media, richText data-theme="dark" >

    -
    +
    {richText && } {Array.isArray(links) && links.length > 0 && (
      diff --git a/templates/ecommerce/src/heros/LowImpact/index.tsx b/templates/ecommerce/src/heros/LowImpact/index.tsx index 3685c9e665d..2ea4e713e31 100644 --- a/templates/ecommerce/src/heros/LowImpact/index.tsx +++ b/templates/ecommerce/src/heros/LowImpact/index.tsx @@ -17,7 +17,7 @@ type LowImpactHeroType = export const LowImpactHero: React.FC = ({ children, richText }) => { return (
      -
      +
      {children || (richText && )}