Footer
The storefront footer: store info, links, contacts, apps, the copyright line and payment icons, from the store's data.
import { Footer } from '@salla.sa/twilight-theme-engine/components/layout';In plain words
The footer closes every page: the store name and description, social links, trust badges and the tax number, the merchant's footer menu, contact details, app download links, then the copyright line and the payment method icons. MasterLayout adds it to every page.
To change only the copyright line, you do not need a footer of your own: register a handler for the copyright hook slot, as the example does. See the footer on real pages in Built-in pages.
Signature
const Footer: LazyExoticComponent<() => JSX.Element> // no props
Example
import { hookRegistry } from '@salla.sa/twilight-theme-engine/hooks';
// The footer renders a "copyright" slot with the store name as context.
// A handler there replaces the default Copyright line.
hookRegistry.register<{ storeName: string }>('copyright', ({ storeName }) => (
<>
© {new Date().getFullYear()} {storeName}. All rights reserved.
</>
));
How it behaves
Top to bottom: the
footer:starthook slot; the store name (an engineLinkhome) and description; social links, trust badges (dark when the theme settingfooter_is_darkis on) and, when the store has a tax number, the number with a thumbnail that opens the tax certificate in anImageModal; the footer menu; contacts; app icons; the copyright line and payment icons; thefooter:endhook slot.The copyright line is
<HookSlot name="copyright" context={{ storeName }} fallback={<Copyright storeName={store.name} />} />: registering anycopyrighthandler replacesCopyright.Section titles are translated:
blocks.footer.pages_links,blocks.footer.socialandblocks.footer.download_apps.It is lazy (code-split).
Gotchas
store.descriptionis HTML (the demo store's starts with<p class="ql-direction-rtl">), and the footer inserts it as HTML. A footer of your own that renders{store.description}as text shows the tags literally.registerappends: acopyrighthandler registered twice (on import and again fromrouter.tsx) prints the line twice.
Related
The footer's bottom line: a translated "Copyright" label, the current year and the store name linking home.
MasterLayoutThe default page frame: header, main content and footer, plus the login, offer and branch pop-ups a storefront needs.
hookRegistryThe one shared list of slot handlers: register content under a slot name, read or clear it, or register many at once with defineHooks.
Source and docs
- Engine source:
packages/theme-engine/src/components/layout/Footer.tsx