Skip to content

Commit

Permalink
perf: make PDP instagram feed section loaded when visible
Browse files Browse the repository at this point in the history
M2-520
  • Loading branch information
bartoszherba committed May 12, 2022
1 parent e66aaec commit 495ba44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/theme/components/utils/LoadWhenVisible.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<slot v-if="isVisible" />
</div>
</template>
<script>
<script lang="ts">
import {
defineComponent, onMounted, onUnmounted, ref,
} from '@nuxtjs/composition-api';
Expand Down
7 changes: 3 additions & 4 deletions packages/theme/modules/catalog/pages/product.vue
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@
</LoadWhenVisible>
</div>
</SfLoader>
<LazyHydrate when-visible>
<LoadWhenVisible>
<InstagramFeed />
</LazyHydrate>
</LoadWhenVisible>
<LoadWhenVisible>
<MobileStoreBanner />
</LoadWhenVisible>
Expand Down Expand Up @@ -312,7 +312,6 @@ import type { Product } from '~/modules/catalog/product/types';
import BundleProductSelector from '~/modules/catalog/product/components/BundleProductSelector.vue';
import GroupedProductSelector from '~/modules/catalog/product/components/GroupedProductSelector.vue';
import { ProductTypeUnion } from '~/modules/catalog/product/enums/ProductTypeUnion';
import InstagramFeed from '~/components/InstagramFeed.vue';
import ProductAddReviewForm from '~/components/ProductAddReviewForm.vue';
import SvgImage from '~/components/General/SvgImage.vue';
import HTMLContent from '~/components/HTMLContent.vue';
Expand All @@ -331,7 +330,7 @@ export default defineComponent({
BundleProductSelector,
GroupedProductSelector,
HTMLContent,
InstagramFeed,
InstagramFeed: () => import('~/components/InstagramFeed.vue'),
LazyHydrate,
MobileStoreBanner: () => import('~/components/MobileStoreBanner.vue'),
ProductAddReviewForm,
Expand Down

0 comments on commit 495ba44

Please sign in to comment.