Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ return {
```
3. Use the `getMagentoImage` method in template like this:
```vue
<nuxt-img
<SfImage
image-tag="nuxt-img"
:src="getMagentoImage(wishlistGetters.getItemImage(product))"
:alt="wishlistGetters.getItemName(product)"
:width="140"
Expand Down
72 changes: 4 additions & 68 deletions packages/theme/components/Header/SearchBar/SearchResults.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
v-for="(product, index) in products"
:key="index"
class="result-card"
image-tag="nuxt-img"
:regular-price="$fc(productGetters.getPrice(product).regular)"
:max-rating="5"
:score-rating="productGetters.getAverageRating(product)"
Expand Down Expand Up @@ -92,47 +93,15 @@
:is-in-wishlist-icon="isAuthenticated ? 'heart_fill' : ''"
:is-in-wishlist="product.isInWishlist"
@click:wishlist="addItemToWishlist(product)"
>
<template #image="imageSlotProps">
<SfButton
:link="imageSlotProps.link"
class="sf-button--pure sf-product-card__link"
data-testid="product-link"
aria-label="Go To Product"
v-on="$listeners"
>
<template v-if="Array.isArray(imageSlotProps.image)">
<nuxt-img
v-for="(picture, key) in imageSlotProps.image.slice(
0,
2
)"
:key="key"
class="sf-product-card__picture"
:src="picture"
:alt="imageSlotProps.title"
:width="imageSlotProps.imageWidth"
:height="imageSlotProps.imageHeight"
/>
</template>
<nuxt-img
v-else
class="sf-product-card__image lol"
:src="imageSlotProps.image"
:alt="imageSlotProps.title"
:width="imageSlotProps.imageWidth"
:height="imageSlotProps.imageHeight"
/>
</SfButton>
</template>
</SfProductCard>
/>
</div>
</SfScrollable>
<div class="results--mobile smartphone-only">
<SfProductCard
v-for="(product, index) in products"
:key="index"
class="result-card"
image-tag="nuxt-img"
:regular-price="$fc(productGetters.getPrice(product).regular)"
:max-rating="5"
:score-rating="productGetters.getAverageRating(product)"
Expand All @@ -157,40 +126,7 @@
:is-in-wishlist-icon="isAuthenticated ? 'heart_fill' : ''"
:is-in-wishlist="product.isInWishlist"
@click:wishlist="addItemToWishlist(product)"
>
<template #image="imageSlotProps">
<SfButton
:link="imageSlotProps.link"
class="sf-button--pure sf-product-card__link"
data-testid="product-link"
aria-label="Go To Product"
v-on="$listeners"
>
<template v-if="Array.isArray(imageSlotProps.image)">
<nuxt-img
v-for="(picture, key) in imageSlotProps.image.slice(
0,
2
)"
:key="key"
class="sf-product-card__picture"
:src="picture"
:alt="imageSlotProps.title"
:width="imageSlotProps.imageWidth"
:height="imageSlotProps.imageHeight"
/>
</template>
<nuxt-img
v-else
class="sf-product-card__image lol"
:src="imageSlotProps.image"
:alt="imageSlotProps.title"
:width="imageSlotProps.imageWidth"
:height="imageSlotProps.imageHeight"
/>
</SfButton>
</template>
</SfProductCard>
/>
</div>
</SfMegaMenuColumn>
<div class="action-buttons smartphone-only">
Expand Down
6 changes: 4 additions & 2 deletions packages/theme/components/HeaderLogo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
:to="localePath('/')"
class="sf-header__logo"
>
<nuxt-img
<SfImage
v-if="logoSrc"
image-tag="nuxt-img"
:src="logoSrc"
:alt="logoAlt"
:title="logoAlt"
Expand All @@ -22,14 +23,15 @@
</template>

<script lang="ts">
import { SfImage } from '@storefront-ui/vue';
import { computed, defineComponent } from '@nuxtjs/composition-api';
import { useConfig } from '~/composables';
import { storeConfigGetters } from '~/getters';
import SvgImage from '~/components/General/SvgImage.vue';

export default defineComponent({
name: 'HeaderLogo',
components: { SvgImage },
components: { SvgImage, SfImage },
setup() {
const { config } = useConfig();

Expand Down
57 changes: 27 additions & 30 deletions packages/theme/components/InstagramFeed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,75 +7,83 @@
<div class="grid grid-images">
<div class="grid__row">
<div class="grid__col">
<nuxt-img
v-if="isMobile"
<SfImage
src="/homepage/imageAm.webp"
alt="katherina_trn"
loading="lazy"
image-tag="nuxt-img"
class="smartphone-only"
:width="160"
:height="160"
/>
<nuxt-img
v-else
<SfImage
src="/homepage/imageAd.webp"
alt="katherina_trn"
loading="lazy"
image-tag="nuxt-img"
class="desktop-only"
:width="470"
:height="470"
/>
</div>
<div class="grid__col small">
<nuxt-img
v-if="isMobile"
<SfImage
src="/homepage/imageBm.webp"
alt="katherina_trn"
loading="lazy"
image-tag="nuxt-img"
class="smartphone-only"
:width="160"
:height="160"
/>
<nuxt-img
v-else
<SfImage
src="/homepage/imageCd.webp"
alt="katherina_trn"
loading="lazy"
image-tag="nuxt-img"
class="desktop-only"
:width="470"
:height="160"
/>
</div>
</div>
<div class="grid__row">
<div class="grid__col small">
<nuxt-img
v-if="isMobile"
<SfImage
src="/homepage/imageCm.webp"
alt="katherina_trn"
loading="lazy"
image-tag="nuxt-img"
class="smartphone-only"
:width="160"
:height="160"
/>
<nuxt-img
v-else
<SfImage
src="/homepage/imageBd.webp"
alt="katherina_trn"
loading="lazy"
image-tag="nuxt-img"
class="desktop-only"
:width="470"
:height="160"
/>
</div>
<div class="grid__col">
<nuxt-img
v-if="isMobile"
<SfImage
src="/homepage/imageDm.webp"
alt="katherina_trn"
loading="lazy"
image-tag="nuxt-img"
class="smartphone-only"
:width="160"
:height="160"
/>
<nuxt-img
v-else
<SfImage
src="/homepage/imageDd.webp"
alt="katherina_trn"
loading="lazy"
image-tag="nuxt-img"
class="desktop-only"
:width="470"
:height="470"
/>
Expand All @@ -87,26 +95,15 @@
<script>
import {
SfSection,
SfImage,
} from '@storefront-ui/vue';
import {
mapMobileObserver,
unMapMobileObserver,
} from '@storefront-ui/vue/src/utilities/mobile-observer.js';
import { computed, defineComponent, onBeforeUnmount } from '@nuxtjs/composition-api';
import { defineComponent } from '@nuxtjs/composition-api';

export default defineComponent({
name: 'InstagramFeed',
components: {
SfSection,
},
setup() {
const isMobile = computed(() => mapMobileObserver().isMobile.get());

onBeforeUnmount(() => {
unMapMobileObserver();
});

return { isMobile };
SfImage,
},
});
</script>
Expand Down
52 changes: 30 additions & 22 deletions packages/theme/components/MobileStoreBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,31 @@
class="sf-banner--left desktop-only banner-app"
>
<template #call-to-action>
<div class="banner-app__call-to-action">
<div class="app-banner__call-to-action">
<SfButton
class="banner-app__button sf-button--pure"
class="app-banner__button sf-banner__call-to-action"
aria-label="Go to Apple Product"
@click="() => {}"
data-testid="banner-cta-button"
>
<nuxt-img
<SfImage
src="/homepage/apple.png"
loading="lazy"
width="174"
height="57"
alt="Apple"
:width="134"
:height="44"
/>
</SfButton>
<SfButton
class="banner-app__button sf-button--pure"
class="app-banner__button sf-banner__call-to-action"
aria-label="Go to Google Product"
@click="() => {}"
data-testid="banner-cta-button"
>
<nuxt-img
<SfImage
src="/homepage/google.png"
loading="lazy"
width="174"
height="57"
alt="Google"
:width="134"
:height="44"
/>
</SfButton>
</div>
Expand All @@ -39,6 +41,7 @@
import {
SfBanner,
SfButton,
SfImage,
} from '@storefront-ui/vue';
import { defineComponent } from '@nuxtjs/composition-api';

Expand All @@ -47,39 +50,44 @@ export default defineComponent({
components: {
SfBanner,
SfButton,
SfImage,
},
});
</script>
<style lang="scss" scoped>

.banner-app {
.app-banner {
--banner-title-margin: var(--spacer-base) 0 var(--spacer-xl) 0;
--banner-padding: 0 0 var(--spacer-2xl);
--banner-title-font-size: var(--h1-font-size);
--banner-subtitle-font-size: var(--font-size--xl);
--banner-title-font-weight: var(--font-weight--semibold);
--banner-subtitle-font-weight: var(--font-weight--medium);
--banner-title-text-transform: capitalize;
--banner-title-text-transform: none;
--banner-background-size: contain;
--banner-background-position: right;
&__title {
margin: var(--spacer-base) 0 var(--spacer-xl) 0;
font-size: var(--h1-font-size);
font-family: var(--font-family--secondary);
font-weight: var(--font-weight--semibold);
text-transform: capitalize;
}
display: block;
min-height: 26.25rem;
max-width: 77.5rem;
max-width: 65rem;
margin: 0 auto;
padding: 5.625rem 31.25rem 0 5.625rem;
padding: 0 calc(25% + var(--spacer-2xl)) 0 var(--spacer-xl);
&__call-to-action {
--button-background: transparent;
display: flex;
flex-wrap: nowrap;
}
&__button {
--image-width: 10.875rem;
--image-height: 3.5625rem;
pointer-events: visible;
--button-padding: 0;
--button-width: 8.375rem;
--button-height: 2.75rem;
& + & {
margin: 0 0 0 var(--spacer-base);
margin: 0 0 0 calc(var(--spacer-xl) / 2);
}
}
}

</style>
Loading