Update src/components/sections/footer/FooterBase.tsx
This commit is contained in:
@@ -1,108 +1,89 @@
|
||||
"use client";
|
||||
'use client';
|
||||
|
||||
// import Image from "next/image";
|
||||
import ButtonTextUnderline from "@/components/button/ButtonTextUnderline";
|
||||
import FooterColumns from "@/components/shared/FooterColumns";
|
||||
import { cls } from "@/lib/utils";
|
||||
import type { FooterColumn } from "@/components/shared/FooterColumns";
|
||||
import React from 'react';
|
||||
|
||||
interface FooterBaseProps {
|
||||
// logoSrc?: string;
|
||||
logoText?: string;
|
||||
// logoWidth?: number;
|
||||
// logoHeight?: number;
|
||||
columns: FooterColumn[];
|
||||
copyrightText?: string;
|
||||
onPrivacyClick?: () => void;
|
||||
ariaLabel?: string;
|
||||
className?: string;
|
||||
containerClassName?: string;
|
||||
// logoClassName?: string;
|
||||
logoTextClassName?: string;
|
||||
columnsClassName?: string;
|
||||
columnClassName?: string;
|
||||
columnTitleClassName?: string;
|
||||
columnItemClassName?: string;
|
||||
copyrightContainerClassName?: string;
|
||||
copyrightTextClassName?: string;
|
||||
privacyButtonClassName?: string;
|
||||
interface FooterLink {
|
||||
label: string;
|
||||
href: string;
|
||||
}
|
||||
|
||||
const FooterBase = ({
|
||||
// logoSrc = "/brand/logowhite.svg",
|
||||
logoText = "Webild",
|
||||
// logoWidth = 120,
|
||||
// logoHeight = 40,
|
||||
columns,
|
||||
copyrightText = `© 2025 | Webild`,
|
||||
onPrivacyClick,
|
||||
ariaLabel = "Site footer",
|
||||
className = "",
|
||||
containerClassName = "",
|
||||
// logoClassName = "",
|
||||
logoTextClassName = "",
|
||||
columnsClassName = "",
|
||||
columnClassName = "",
|
||||
columnTitleClassName = "",
|
||||
columnItemClassName = "",
|
||||
copyrightContainerClassName = "",
|
||||
copyrightTextClassName = "",
|
||||
privacyButtonClassName = "",
|
||||
}: FooterBaseProps) => {
|
||||
return (
|
||||
<footer
|
||||
role="contentinfo"
|
||||
aria-label={ariaLabel}
|
||||
className={cls("relative overflow-hidden w-full primary-button text-primary-cta-text py-15 mt-20", className)}
|
||||
>
|
||||
<div
|
||||
className={cls("relative w-content-width mx-auto z-10", containerClassName)}
|
||||
>
|
||||
<div className="flex flex-col md:flex-row gap-10 md:gap-0 justify-between items-start mb-10">
|
||||
{/* {logoSrc ? (
|
||||
<div className="flex-shrink-0">
|
||||
<Image
|
||||
src={logoSrc}
|
||||
alt="Logo"
|
||||
width={logoWidth}
|
||||
height={logoHeight}
|
||||
className={cls("object-contain", logoClassName)}
|
||||
unoptimized={logoSrc.startsWith('http') || logoSrc.startsWith('//')}
|
||||
aria-hidden={true}
|
||||
/>
|
||||
</div>
|
||||
) : ( */}
|
||||
<h2 className={cls("text-4xl font-medium text-primary-cta-text", logoTextClassName)}>
|
||||
{logoText}
|
||||
</h2>
|
||||
{/* )} */}
|
||||
interface FooterColumn {
|
||||
title: string;
|
||||
items: FooterLink[];
|
||||
}
|
||||
|
||||
<FooterColumns
|
||||
columns={columns}
|
||||
className={columnsClassName}
|
||||
columnClassName={columnClassName}
|
||||
columnTitleClassName={cls("text-primary-cta-text/50", columnTitleClassName)}
|
||||
columnItemClassName={cls("text-primary-cta-text", columnItemClassName)}
|
||||
/>
|
||||
interface FooterBaseProps {
|
||||
logoText: string;
|
||||
copyrightText: string;
|
||||
columns: FooterColumn[];
|
||||
}
|
||||
|
||||
export default function FooterBase({
|
||||
logoText,
|
||||
copyrightText,
|
||||
columns
|
||||
}: FooterBaseProps) {
|
||||
return (
|
||||
<footer className="bg-slate-900 text-slate-100 py-12 px-4 sm:px-6 lg:px-8">
|
||||
<div className="max-w-7xl mx-auto">
|
||||
{/* Top Section */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-4 gap-8 mb-8">
|
||||
{/* Logo Section */}
|
||||
<div className="flex flex-col justify-start">
|
||||
<h2 className="text-2xl font-bold text-white mb-2">{logoText}</h2>
|
||||
<p className="text-slate-400 text-sm">
|
||||
Building amazing communities together
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Footer Columns */}
|
||||
{columns.map((column, index) => (
|
||||
<div key={index}>
|
||||
<h3 className="text-lg font-semibold text-white mb-4">
|
||||
{column.title}
|
||||
</h3>
|
||||
<ul className="space-y-2">
|
||||
{column.items.map((item, itemIndex) => (
|
||||
<li key={itemIndex}>
|
||||
<a
|
||||
href={item.href}
|
||||
className="text-slate-400 hover:text-white transition-colors duration-200 text-sm"
|
||||
>
|
||||
{item.label}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={cls("w-full flex items-center justify-between pt-9 border-t border-primary-cta-text/20", copyrightContainerClassName)}
|
||||
>
|
||||
<span className={cls("text-primary-cta-text/50 text-sm", copyrightTextClassName)}>
|
||||
{/* Divider */}
|
||||
<div className="border-t border-slate-700 my-8"></div>
|
||||
|
||||
{/* Bottom Section */}
|
||||
<div className="flex flex-col sm:flex-row justify-between items-center">
|
||||
<p className="text-slate-400 text-sm mb-4 sm:mb-0">
|
||||
{copyrightText}
|
||||
</span>
|
||||
<ButtonTextUnderline
|
||||
text="Privacy Policy"
|
||||
onClick={onPrivacyClick}
|
||||
className={cls("text-primary-cta-text/50", privacyButtonClassName)}
|
||||
/>
|
||||
</p>
|
||||
<div className="flex gap-6">
|
||||
<a
|
||||
href="#"
|
||||
className="text-slate-400 hover:text-white transition-colors duration-200"
|
||||
aria-label="Privacy Policy"
|
||||
>
|
||||
<span className="text-sm">Privacy Policy</span>
|
||||
</a>
|
||||
<a
|
||||
href="#"
|
||||
className="text-slate-400 hover:text-white transition-colors duration-200"
|
||||
aria-label="Terms of Service"
|
||||
>
|
||||
<span className="text-sm">Terms of Service</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
};
|
||||
|
||||
FooterBase.displayName = "FooterBase";
|
||||
|
||||
export default FooterBase;
|
||||
}
|
||||
Reference in New Issue
Block a user