Compare commits

...

2 Commits

7 changed files with 319 additions and 157 deletions

View File

@ -156,7 +156,7 @@
{ {
"Button": { "Button": {
"config": { "config": {
"icon": "user", "icon": "User",
"className": " flex items-center gap-1 shadow-none w-[50px]" "className": " flex items-center gap-1 shadow-none w-[50px]"
} }
} }
@ -164,7 +164,7 @@
{ {
"Button": { "Button": {
"config": { "config": {
"icon": "heart", "icon": "Heart",
"className": " flex items-center gap-1 shadow-none w-[50px]" "className": " flex items-center gap-1 shadow-none w-[50px]"
} }
} }
@ -204,7 +204,228 @@
{ {
"Footer": { "Footer": {
"config": { "config": {
"copyrightText": "© 2025 MyShop" "copyrightText": "© 2025 MyShop",
"children": [
{
"Image": {
"config": {
"src": "/VibentecIT-logo.svg",
"alt": "MyShop",
"className": "h-[128px] w-[324px] ml-[3rem]",
"objectFit": "contain"
}
}
},
{
"Section": {
"config": {
"className": "flex items-start px-[3rem] justify-between"
},
"children": [
{
"Section": {
"config": {
"className": "flex flex-col"
},
"children": [
{
"Link": {
"config": {
"label": "Der Wegbereiter für innovative IT-Lösungen",
"href": "/",
"className": "text-[24px] leading-[125%] text-[#11314E] flex mr-8 gap-1 hover:underline font-bold w-[336px] pl-[2rem] mb-[22px]"
}
}
},
{
"Link": {
"config": {
"label": "Tauchen Sie ein in eine Welt modernster Technologien, zuverlässiger Support und proaktiver Innovation gemeinsam gestalten wir die digitale Zukunft Ihres Unternehmens.",
"href": "/",
"className": "text-[13px] leading-[160%] text-[#11314E] flex items-center mr-8 gap-1 w-[336px] pl-[2rem] hover:no-underline"
}
}
},
{
"Button": {
"config": {
"label": "Kontaktieren Sie Uns",
"labelClassName": "order-[1]",
"iconClassName": "order-[2]",
"icon": "ChevronRight",
"className": "mt-[24px] flex items-center w-fit hover:bg-black gap-1 shadow-none p-[1rem] bg-[#18181B] text-white ml-[2rem]"
}
}
}
]
}
},
{
"Section": {
"config": {
"className": "flex mt-[2rem]"
},
"children": [
{
"Section": {
"config": {
"className": "flex flex-col"
},
"children": [
{
"Link": {
"config": {
"label": "Unternehmen",
"href": "/",
"className": "text-[24px] leading-[125%] text-[#11314E] flex mr-8 gap-1 hover:underline font-bold w-[200px] pl-[2rem] mb-[16px]"
}
}
},
{
"Link": {
"config": {
"label": "Über Uns",
"href": "/",
"className": "text-[13px] leading-[160%] text-[#11314E] flex items-center mr-8 gap-1 w-[200px] pl-[2rem] hover:no-underline"
}
}
},
{
"Link": {
"config": {
"label": "Placeholder",
"href": "/",
"className": "text-[13px] leading-[160%] text-[#11314E] flex items-center mr-8 gap-1 w-[200px] pl-[2rem] hover:no-underline"
}
}
},
{
"Link": {
"config": {
"label": "Placeholder",
"href": "/",
"className": "text-[13px] leading-[160%] text-[#11314E] flex items-center mr-8 gap-1 w-[200px] pl-[2rem] hover:no-underline"
}
}
}
]
}
},
{
"Section": {
"config": {
"className": "flex flex-col gap-[16px]"
},
"children": [
{
"Link": {
"config": {
"label": "Social Media",
"href": "/",
"className": "text-[24px] leading-[125%] text-[#11314E] flex mr-8 gap-1 hover:underline font-bold w-[200px] pl-[2rem] mt-[-15px] mb-[-16px]"
}
}
},
{
"Button": {
"config": {
"label": "Über Uns",
"icon": "Twitter",
"className": "text-[13px] leading-[160%] text-[#11314E] flex justify-start font-semibold mr-8 gap-1 shadow-none w-[200px] pl-[2rem] hover:bg-transparent"
}
}
},
{
"Button": {
"config": {
"label": "Über Uns",
"icon": "Twitter",
"className": "text-[13px] leading-[160%] text-[#11314E] flex justify-start font-semibold mr-8 gap-1 shadow-none w-[200px] pl-[2rem] hover:bg-transparent"
}
}
},
{
"Button": {
"config": {
"label": "Über Uns",
"icon": "Twitter",
"className": "text-[13px] leading-[160%] text-[#11314E] flex justify-start font-semibold mr-8 gap-1 shadow-none w-[200px] pl-[2rem] hover:bg-transparent"
}
}
}
]
}
},
{
"Section": {
"config": {
"className": "flex flex-col"
},
"children": [
{
"Link": {
"config": {
"label": "Addresse",
"href": "/",
"className": "text-[24px] leading-[125%] text-[#11314E] flex mr-8 gap-1 hover:underline font-bold w-[200px] pl-[2rem] mb-[16px]"
}
}
},
{
"Link": {
"config": {
"label": "Über Uns",
"href": "/",
"className": "text-[13px] leading-[160%] text-[#11314E] flex items-center mr-8 gap-1 w-[200px] pl-[2rem] hover:no-underline"
}
}
},
{
"Link": {
"config": {
"label": "Social Media",
"href": "/",
"className": "text-[13px] leading-[160%] text-[#11314E] flex items-center mr-8 gap-1 w-[200px] pl-[2rem] hover:no-underline"
}
}
},
{
"Link": {
"config": {
"label": "Über Uns",
"href": "/",
"className": "text-[13px] leading-[160%] text-[#11314E] flex items-center mr-8 gap-1 w-[200px] pl-[2rem] hover:no-underline"
}
}
}
]
}
}
]
}
},
{
"Section": {
"config": {
"className": "flex flex-col mt-[5rem]"
},
"children": [
{
"Link": {
"config": {
"label": "Tauchen Sie ein in eine Welt modernster Technologien, zuverlässiger Support und proaktiver Innovation gemeinsam gestalten wir die digitale Zukunft Ihres Unternehmens.",
"href": "/",
"className": "text-[13px] leading-[160%] text-[#11314E] flex items-center mr-8 gap-1 w-[336px] pl-[2rem] hover:no-underline"
}
}
}
]
}
}
]
}
}
]
} }
} }
} }

View File

@ -0,0 +1,19 @@
export { default as Back } from "./back"
export { default as Bancontact } from "./bancontact"
export { default as ChevronDown } from "./chevron-down"
export { default as Eye } from "./eye"
export { default as EyeOff } from "./eye-off"
export { default as FastDelivery } from "./fast-delivery"
export { default as Ideal } from "./ideal"
export { default as MapPin } from "./map-pin"
export { default as Medusa } from "./medusa"
export { default as Nextjs } from "./nextjs"
export { default as Package } from "./package"
export { default as PayPal } from "./paypal"
export { default as PlaceholderImage } from "./placeholder-image"
export { default as Refresh } from "./refresh"
export { default as Spinner } from "./spinner"
export { default as Trash } from "./trash"
export { default as User } from "./user"
export { default as X } from "./x"
export { default as Twitter } from "./twitter"

View File

@ -0,0 +1,27 @@
import React from "react"
import { IconProps } from "types/icon"
const Twitter: React.FC<IconProps> = ({
size = "20",
color = "currentColor",
...attributes
}) => {
return (
<svg
width={size}
height={size}
viewBox="0 0 15 12"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...attributes}
>
<path
d="M12.8069 2.87388C12.8069 3.01339 12.8069 3.125 12.8069 3.26451C12.8069 7.14286 9.8772 11.5792 4.49215 11.5792C2.81805 11.5792 1.28345 11.1049 -3.52859e-05 10.2679C0.223179 10.2958 0.446393 10.3237 0.697509 10.3237C2.0647 10.3237 3.32028 9.84933 4.32474 9.06808C3.04126 9.04018 1.95309 8.20312 1.59037 7.03125C1.78568 7.05915 1.95309 7.08705 2.1484 7.08705C2.39952 7.08705 2.67854 7.03125 2.90175 6.97545C1.56246 6.69643 0.558 5.52455 0.558 4.10156V4.07366C0.948625 4.29687 1.42296 4.40848 1.89729 4.43638C1.08813 3.90625 0.585902 3.01339 0.585902 2.00893C0.585902 1.45089 0.725411 0.94866 0.976527 0.530133C2.42742 2.28795 4.60376 3.45982 7.03122 3.59933C6.97541 3.37612 6.94751 3.1529 6.94751 2.92969C6.94751 1.31138 8.25889 -6.37025e-07 9.8772 -6.37025e-07C10.7143 -6.37025e-07 11.4676 0.334821 12.0256 0.920758C12.6674 0.781249 13.3091 0.530133 13.8672 0.195312C13.6439 0.892857 13.1975 1.45089 12.5837 1.81362C13.1696 1.75781 13.7555 1.5904 14.2578 1.36719C13.8672 1.95312 13.3649 2.45536 12.8069 2.87388Z"
fill={color}
/>
</svg>
)
}
export default Twitter

View File

@ -1,5 +1,6 @@
import { Button, IconButton } from "@medusajs/ui" import { Button, IconButton } from "@medusajs/ui"
import { MagnifyingGlass, User, ShoppingBag, Heart } from "@medusajs/icons" import * as MedusaIcons from "@medusajs/icons"
import * as CustomIcons from "@modules/common/icons"
import { import {
LayoutComponentDefinition, LayoutComponentDefinition,
LayoutContext, LayoutContext,
@ -13,21 +14,20 @@ export default function VtButton({
context: LayoutContext context: LayoutContext
}) { }) {
const props = nodes.config || {} const props = nodes.config || {}
const iconName = props.icon as string | undefined
const icons = { const IconComponent = iconName
search: MagnifyingGlass, ? (MedusaIcons as Record<string, any>)[iconName] ??
user: User, (CustomIcons as Record<string, any>)[iconName]
cart: ShoppingBag, : undefined
heart: Heart
}
const Icon = props.icon && icons[props.icon as keyof typeof icons]
return ( return (
<> <>
{props?.icon && ( {props?.icon && (
<IconButton className={props?.className ?? ""}> <IconButton className={props?.className ?? ""}>
<Icon /> {IconComponent && (
<IconComponent className={props?.iconClassName ?? ""} />
)}
{props?.label && ( {props?.label && (
<span className="mr-2 text-[#11314E]">{props.label}</span> <span className={props?.labelClassName ?? ""}>{props.label}</span>
)} )}
</IconButton> </IconButton>
)} )}

View File

@ -3,157 +3,28 @@ import { listCollections } from "@lib/data/collections"
import { Text, clx } from "@medusajs/ui" import { Text, clx } from "@medusajs/ui"
import LocalizedClientLink from "@modules/common/components/localized-client-link" import LocalizedClientLink from "@modules/common/components/localized-client-link"
import MedusaCTA from "@modules/layout/components/medusa-cta" import MedusaCTA from "@modules/layout/components/medusa-cta"
import { LayoutComponentDefinition, LayoutContext } from "vibentec/component-map"; import { DynamicLayoutRenderer } from "@vibentec/renderer"
import {
LayoutComponentDefinition,
LayoutContext,
} from "vibentec/component-map"
export default async function VtFooter({ nodes, context }: { nodes?: LayoutComponentDefinition; context: LayoutContext }) { export default async function VtFooter({
nodes,
context,
}: {
nodes?: LayoutComponentDefinition
context: LayoutContext
}) {
const { collections } = await listCollections({ const { collections } = await listCollections({
fields: "*products", fields: "*products",
}) })
const productCategories = await listCategories() const productCategories = await listCategories()
const props = nodes?.config ?? {} const props = nodes?.config ?? {}
const copyrightText = props.copyrightText ?? "";
return ( return (
<footer className="border-t border-ui-border-base w-full"> <footer className="relative mx-auto border-b duration-200 bg-white border-ui-border-base border-t-2">
<div className="content-container flex flex-col w-full"> {props.children && <DynamicLayoutRenderer nodes={props.children} context={context} />}
<div className="flex flex-col gap-y-6 xsmall:flex-row items-start justify-between py-40">
<div>
<LocalizedClientLink
href="/"
className="txt-compact-xlarge-plus text-ui-fg-subtle hover:text-ui-fg-base uppercase"
>
Medusa Store
</LocalizedClientLink>
</div>
<div className="text-small-regular gap-10 md:gap-x-16 grid grid-cols-2 sm:grid-cols-3">
{productCategories && productCategories?.length > 0 && (
<div className="flex flex-col gap-y-2">
<span className="txt-small-plus txt-ui-fg-base">
Categories
</span>
<ul
className="grid grid-cols-1 gap-2"
data-testid="footer-categories"
>
{productCategories?.slice(0, 6).map((c) => {
if (c.parent_category) {
return
}
const children =
c.category_children?.map((child) => ({
name: child.name,
handle: child.handle,
id: child.id,
})) || null
return (
<li
className="flex flex-col gap-2 text-ui-fg-subtle txt-small"
key={c.id}
>
<LocalizedClientLink
className={clx(
"hover:text-ui-fg-base",
children && "txt-small-plus"
)}
href={`/categories/${c.handle}`}
data-testid="category-link"
>
{c.name}
</LocalizedClientLink>
{children && (
<ul className="grid grid-cols-1 ml-3 gap-2">
{children &&
children.map((child) => (
<li key={child.id}>
<LocalizedClientLink
className="hover:text-ui-fg-base"
href={`/categories/${child.handle}`}
data-testid="category-link"
>
{child.name}
</LocalizedClientLink>
</li>
))}
</ul>
)}
</li>
)
})}
</ul>
</div>
)}
{collections && collections.length > 0 && (
<div className="flex flex-col gap-y-2">
<span className="txt-small-plus txt-ui-fg-base">
Collections
</span>
<ul
className={clx(
"grid grid-cols-1 gap-2 text-ui-fg-subtle txt-small",
{
"grid-cols-2": (collections?.length || 0) > 3,
}
)}
>
{collections?.slice(0, 6).map((c) => (
<li key={c.id}>
<LocalizedClientLink
className="hover:text-ui-fg-base"
href={`/collections/${c.handle}`}
>
{c.title}
</LocalizedClientLink>
</li>
))}
</ul>
</div>
)}
<div className="flex flex-col gap-y-2">
<span className="txt-small-plus txt-ui-fg-base">Medusa</span>
<ul className="grid grid-cols-1 gap-y-2 text-ui-fg-subtle txt-small">
<li>
<a
href="https://github.com/medusajs"
target="_blank"
rel="noreferrer"
className="hover:text-ui-fg-base"
>
GitHub
</a>
</li>
<li>
<a
href="https://docs.medusajs.com"
target="_blank"
rel="noreferrer"
className="hover:text-ui-fg-base"
>
Documentation
</a>
</li>
<li>
<a
href="https://github.com/medusajs/nextjs-starter-medusa"
target="_blank"
rel="noreferrer"
className="hover:text-ui-fg-base"
>
Source code
</a>
</li>
</ul>
</div>
</div>
</div>
<div className="flex w-full mb-16 justify-between text-ui-fg-muted">
<Text className="txt-compact-small">
{copyrightText || `© ${new Date().getFullYear()} Medusa Store. All rights reserved.`}
</Text>
<MedusaCTA />
</div>
</div>
</footer> </footer>
) )
} }

View File

@ -0,0 +1,22 @@
import {
LayoutComponentDefinition,
LayoutContext,
} from "@vibentec/component-map"
import { DynamicLayoutRenderer } from "@vibentec/renderer"
export default function VtSection({
nodes,
context,
}: {
nodes: LayoutComponentDefinition
context: LayoutContext
}) {
const props = nodes.config || {}
return (
<section className={props.className}>
{nodes.children && (
<DynamicLayoutRenderer nodes={nodes.children} context={context} />
)}
</section>
)
}

View File

@ -16,6 +16,7 @@ import VtImage from "@modules/layout/templates/vt-image"
import VtDropdown from "@modules/layout/templates/vt-dropdown" import VtDropdown from "@modules/layout/templates/vt-dropdown"
import VtButton from "@modules/layout/templates/vt-button" import VtButton from "@modules/layout/templates/vt-button"
import VtSearchInput from "@modules/layout/templates/vt-search-input" import VtSearchInput from "@modules/layout/templates/vt-search-input"
import VtSection from "@modules/layout/templates/vt-section"
type ComponentConfig = Record<string, any>; type ComponentConfig = Record<string, any>;
@ -58,6 +59,7 @@ export const componentMap: Record<string, ComponentRenderer> = {
HomeButton: nodesContextRenderer(HomeButton), HomeButton: nodesContextRenderer(HomeButton),
AccountButton: nodesContextRenderer(AccountButton), AccountButton: nodesContextRenderer(AccountButton),
Button: nodesContextRenderer(VtButton), Button: nodesContextRenderer(VtButton),
Section: nodesContextRenderer(VtSection),
SearchInput: nodesContextRenderer(VtSearchInput), SearchInput: nodesContextRenderer(VtSearchInput),
VtCartButton: nodesContextRenderer(VtCartButton), VtCartButton: nodesContextRenderer(VtCartButton),
Link: nodesContextRenderer(VtLink), Link: nodesContextRenderer(VtLink),