feat: add header banner 3bear design template
This commit is contained in:
parent
60700ee11e
commit
c8853bac1c
|
|
@ -0,0 +1,90 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"Header": {
|
||||||
|
"config": {
|
||||||
|
"sticky": true,
|
||||||
|
"variant": "ticker"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"Banner": {
|
||||||
|
"config": {
|
||||||
|
"variant": "ticker",
|
||||||
|
"className": "h-12 bg-[#009b93] text-[#fff] gap-12",
|
||||||
|
"speed": 24,
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"Link": {
|
||||||
|
"config": {
|
||||||
|
"label": "NEU: Overnight Oats – Sallys Nussecke 😍",
|
||||||
|
"href": "/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Link": {
|
||||||
|
"config": {
|
||||||
|
"label": "Versandkostenfrei ab 45 € 💛",
|
||||||
|
"href": "/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Link": {
|
||||||
|
"config": {
|
||||||
|
"label": "Gratis Geschenk ab 60 € Warenkorbwert 🎁",
|
||||||
|
"href": "/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Nav": {
|
||||||
|
"config": {
|
||||||
|
"className": "h-12 bg-white text-[#003F31] gap-12",
|
||||||
|
"left": [
|
||||||
|
{
|
||||||
|
"Image": {
|
||||||
|
"config": {
|
||||||
|
"src": "/3bear-logo.png",
|
||||||
|
"alt": "MyShop",
|
||||||
|
"className": "h-[150px] w-[180px]",
|
||||||
|
"objectFit": "contain"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"CartMismatchBanner": {
|
||||||
|
"config": {
|
||||||
|
"show": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"FreeShippingPriceNudge": {
|
||||||
|
"config": {
|
||||||
|
"variant": "popup"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"PropsChildren": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Footer": {
|
||||||
|
"config": {
|
||||||
|
"copyrightText": "© 2025 MyShop"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
Binary file not shown.
|
|
@ -1,6 +1,10 @@
|
||||||
@keyframes bannerTicker {
|
@keyframes bannerTicker {
|
||||||
0% { transform: translateX(100%); }
|
0% {
|
||||||
100% { transform: translateX(-100%); }
|
transform: translateX(100%);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: translateX(-100%);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ticker {
|
.ticker {
|
||||||
|
|
@ -8,5 +12,6 @@
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
animation: bannerTicker linear infinite;
|
animation: bannerTicker linear infinite;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
gap: 3rem
|
||||||
}
|
}
|
||||||
|
|
@ -12,6 +12,7 @@ import Banner from "@modules/layout/templates/vt-banner"
|
||||||
import VtMegaMenu from "@modules/layout/components/vt-mega-menu"
|
import VtMegaMenu from "@modules/layout/components/vt-mega-menu"
|
||||||
import VtLink from "@modules/layout/components/vt-linkbutton"
|
import VtLink from "@modules/layout/components/vt-linkbutton"
|
||||||
import VtSideMenu from "@modules/layout/components/vt-sidemenu"
|
import VtSideMenu from "@modules/layout/components/vt-sidemenu"
|
||||||
|
import VtImage from "@modules/layout/templates/vt-image"
|
||||||
|
|
||||||
type ComponentConfig = Record<string, any>;
|
type ComponentConfig = Record<string, any>;
|
||||||
|
|
||||||
|
|
@ -32,7 +33,7 @@ export type ComponentRenderer = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Utility methods
|
// Utility methods
|
||||||
const configOnly = (Component: React.ComponentType<any>): ComponentRenderer => ({
|
const configOnly = (Component: React.ComponentType<any>): ComponentRenderer => ({
|
||||||
render: (entry) => <Component {...entry.config} />
|
render: (entry) => <Component {...entry.config} />
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -55,6 +56,7 @@ export const componentMap: Record<string, ComponentRenderer> = {
|
||||||
AccountButton: nodesContextRenderer(AccountButton),
|
AccountButton: nodesContextRenderer(AccountButton),
|
||||||
VtCartButton: nodesContextRenderer(VtCartButton),
|
VtCartButton: nodesContextRenderer(VtCartButton),
|
||||||
Link: nodesContextRenderer(VtLink),
|
Link: nodesContextRenderer(VtLink),
|
||||||
|
Image: nodesContextRenderer(VtImage),
|
||||||
CartMismatchBanner: configOnly(CartMismatchBanner),
|
CartMismatchBanner: configOnly(CartMismatchBanner),
|
||||||
FreeShippingPriceNudge: configOnly(FreeShippingPriceNudge),
|
FreeShippingPriceNudge: configOnly(FreeShippingPriceNudge),
|
||||||
PropsChildren: {
|
PropsChildren: {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import fs from "fs"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { jsonFileNames } from "./devJsonFileNames";
|
import { jsonFileNames } from "./devJsonFileNames";
|
||||||
|
|
||||||
const fileName = jsonFileNames.stePlayGround;
|
const fileName = jsonFileNames.nam3Bear;
|
||||||
|
|
||||||
export async function loadDesignConfig() {
|
export async function loadDesignConfig() {
|
||||||
const filePath = path.join(process.cwd(), "config", fileName)
|
const filePath = path.join(process.cwd(), "config", fileName)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
export const jsonFileNames = {
|
export const jsonFileNames = {
|
||||||
steMedusaStarter: "ste.medusa-starter.design.json",
|
steMedusaStarter: "ste.medusa-starter.design.json",
|
||||||
stePlayGround: "ste.playground.design.json"
|
stePlayGround: "ste.playground.design.json",
|
||||||
|
nam3Bear: "nam.3bear.design.json",
|
||||||
};
|
};
|
||||||
Loading…
Reference in New Issue