mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Dynamic imports
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
'use client';
|
||||
|
||||
import { InfoCircledIcon } from '@radix-ui/react-icons';
|
||||
|
||||
import BlurbSection from '@/components/modules/blurb-section/blurb-section';
|
||||
import FilteredProductList from '@/components/modules/filtered-product-list/filtered-product-list';
|
||||
import Hero from '@/components/modules/hero';
|
||||
import ReusableSection from '@/components/modules/reusable-section/reusable-section';
|
||||
import Slider from '@/components/modules/slider/slider';
|
||||
import USPSection from '@/components/modules/usp-section/usp-section';
|
||||
import { InfoCircledIcon } from '@radix-ui/react-icons';
|
||||
interface getContentComponentProps {
|
||||
_type: string;
|
||||
_key: number;
|
||||
@@ -19,13 +18,25 @@ const getContentComponent = ({ _type, _key, disabled, ...rest }: getContentCompo
|
||||
|
||||
switch (_type) {
|
||||
case 'hero':
|
||||
Component = Hero;
|
||||
if (disabled !== true) {
|
||||
Component = Hero;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 'slider':
|
||||
Component = Slider;
|
||||
if (disabled !== true) {
|
||||
Component = Slider;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 'filteredProductList':
|
||||
Component = FilteredProductList;
|
||||
if (disabled !== true) {
|
||||
Component = FilteredProductList;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 'blurbSection':
|
||||
if (disabled !== true) {
|
||||
|
@@ -21,7 +21,7 @@ export default async function Footer({ locale }: FooterProps) {
|
||||
<footer className="border-t border-ui-border bg-app">
|
||||
<div className="mx-auto flex w-full flex-col">
|
||||
<div className="flex w-full items-center justify-between p-4 transition-colors duration-150 md:space-y-0 lg:px-8 lg:py-6 2xl:px-16 2xl:py-8">
|
||||
<Link className="flex flex-initial items-center font-bold md:mr-24" href="/">
|
||||
<Link href={`/${locale}`} className="flex flex-initial items-center font-bold md:mr-24">
|
||||
<Logo />
|
||||
</Link>
|
||||
<LocaleSwitcher />
|
||||
|
@@ -22,7 +22,7 @@ const Header = ({ locale }: HeaderProps) => {
|
||||
|
||||
<div className="flex items-center">
|
||||
<Link
|
||||
href={`/`}
|
||||
href={`/${locale}`}
|
||||
className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer duration-100 ease-in-out md:relative md:left-0 md:top-0 md:translate-x-0 md:translate-y-0"
|
||||
aria-label="Logo"
|
||||
>
|
||||
|
Reference in New Issue
Block a user