summaryrefslogtreecommitdiff
path: root/src/components/structure/Footer.svelte
diff options
context:
space:
mode:
authorrxliuli <rxliuli@gmail.com>2025-11-04 05:03:50 +0800
committerrxliuli <rxliuli@gmail.com>2025-11-04 05:03:50 +0800
commitbce557cc2dc767628bed6aac87301a1be7c5431b (patch)
treeb51a051228d01fe3306cd7626d4a96768aadb944 /src/components/structure/Footer.svelte
init commit
Diffstat (limited to 'src/components/structure/Footer.svelte')
-rw-r--r--src/components/structure/Footer.svelte47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/components/structure/Footer.svelte b/src/components/structure/Footer.svelte
new file mode 100644
index 0000000..ceabfec
--- /dev/null
+++ b/src/components/structure/Footer.svelte
@@ -0,0 +1,47 @@
+<script lang="ts">
+ import { getI18n } from '~/stores/i18n';
+ import Footer, {
+ type Translate,
+ } from '@amp/web-app-components/src/components/Footer/Footer.svelte';
+ import LocaleSwitcherButton from '@amp/web-app-components/src/components/buttons/LocaleSwitcherButton/LocaleSwitcherButton.svelte';
+ import { items } from '~/constants/footer-items';
+ import { getLocale } from '~/utils/locale';
+ import {
+ regions,
+ languages,
+ storefrontNameTranslations,
+ } from '~/utils/storefront-data';
+
+ const i18n = getI18n();
+ const locale = getLocale();
+
+ const translate: Translate = (key, options) => $i18n.t(key, options);
+</script>
+
+<section class="footer-container">
+ <Footer footerItems={items} translateFn={translate}>
+ <LocaleSwitcherButton
+ slot="secondary-content"
+ translateFn={translate}
+ {regions}
+ {languages}
+ {locale}
+ {storefrontNameTranslations}
+ defaultRoute="iphone/today"
+ />
+ </Footer>
+</section>
+
+<style lang="scss">
+ @use 'ac-sasskit/modules/viewportcontent/core' as *;
+ @use 'amp/stylekit/core/viewports' as *;
+
+ .footer-container {
+ background-color: var(--footerBg);
+ }
+
+ .footer-container :global(footer) {
+ max-width: calc(viewport-content-for(xlarge));
+ margin: 0 auto;
+ }
+</style>