import {Suspense} from 'react'; import {Await, NavLink} from 'react-router'; import type {FooterQuery, HeaderQuery} from 'storefrontapi.generated'; interface FooterProps { footer: Promise; header: HeaderQuery; publicStoreDomain: string; } export function Footer({ footer: footerPromise, header, publicStoreDomain, }: FooterProps) { return ( {(footer) => (
{footer?.menu && header.shop.primaryDomain?.url && ( )}
)}
); } function FooterMenu({ menu, primaryDomainUrl, publicStoreDomain, }: { menu: FooterQuery['menu']; primaryDomainUrl: FooterProps['header']['shop']['primaryDomain']['url']; publicStoreDomain: string; }) { return ( ); } const FALLBACK_FOOTER_MENU = { id: 'gid://shopify/Menu/199655620664', items: [ { id: 'gid://shopify/MenuItem/461633060920', resourceId: 'gid://shopify/ShopPolicy/23358046264', tags: [], title: 'Privacy Policy', type: 'SHOP_POLICY', url: '/policies/privacy-policy', items: [], }, { id: 'gid://shopify/MenuItem/461633093688', resourceId: 'gid://shopify/ShopPolicy/23358013496', tags: [], title: 'Refund Policy', type: 'SHOP_POLICY', url: '/policies/refund-policy', items: [], }, { id: 'gid://shopify/MenuItem/461633126456', resourceId: 'gid://shopify/ShopPolicy/23358111800', tags: [], title: 'Shipping Policy', type: 'SHOP_POLICY', url: '/policies/shipping-policy', items: [], }, { id: 'gid://shopify/MenuItem/461633159224', resourceId: 'gid://shopify/ShopPolicy/23358079032', tags: [], title: 'Terms of Service', type: 'SHOP_POLICY', url: '/policies/terms-of-service', items: [], }, ], }; function activeLinkStyle({ isActive, isPending, }: { isActive: boolean; isPending: boolean; }) { return { fontWeight: isActive ? 'bold' : undefined, color: isPending ? 'grey' : 'white', }; }