diff --git a/app/layout.tsx b/app/layout.tsx index df9f297..5c72b80 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,5 +1,3 @@ -'use client'; - import React from 'react'; import './globals.css'; import { Geist, Geist_Mono } from 'next/font/google'; diff --git a/components/logo.tsx b/components/logo.tsx new file mode 100644 index 0000000..d019b3f --- /dev/null +++ b/components/logo.tsx @@ -0,0 +1,49 @@ +import React from 'react'; +import Link from 'next/link'; + +interface LogoProps { + /** Logo image URL. Falls back to the store name as a wordmark when absent. */ + src?: string | null; + /** Wordmark text, and the image's alt text. */ + storeName?: string; + /** Where the logo links to. Pass null to render it unwrapped. */ + href?: string | null; + /** Sizing for the image — height only, so the aspect ratio is preserved. */ + imageClassName?: string; + /** Sizing and weight for the wordmark fallback. */ + textClassName?: string; +} + +const Logo: React.FC = ({ + src, + storeName = 'Shop', + href = '/', + imageClassName = 'h-6', + textClassName = 'text-xl', +}) => { + const mark = src ? ( + {storeName} + ) : ( + + {storeName} + + ); + + if (href === null) { + return {mark}; + } + + return ( + + {mark} + + ); +}; + +export default Logo; diff --git a/components/shopify/footer.tsx b/components/shopify/footer.tsx index 284d0e6..523554f 100644 --- a/components/shopify/footer.tsx +++ b/components/shopify/footer.tsx @@ -4,6 +4,7 @@ import { RiTiktokLine, RiFacebookFill, } from '@remixicon/react'; +import Logo from '@/components/logo'; export interface FooterLink { label: string; @@ -12,6 +13,7 @@ export interface FooterLink { interface FooterProps { storeName?: string; + logoUrl?: string; copyright?: string; links?: FooterLink[]; instagramUrl?: string; @@ -21,6 +23,7 @@ interface FooterProps { const Footer: React.FC = ({ storeName = 'Shop', + logoUrl, copyright, links = [ { label: 'Terms of Service', url: '/policies/terms-of-service' }, @@ -46,6 +49,13 @@ const Footer: React.FC = ({ assistant launcher. Links and socials sit on separate rows so the icons aren't crammed onto the end of the link list. */}
+ +