Skip to content

Commit

Permalink
[TECH] Utiliser l'auto-import des composants proposé par Nuxt.
Browse files Browse the repository at this point in the history
  • Loading branch information
pix-service-auto-merge authored Jul 19, 2021
2 parents ed93075 + 2ff756b commit 79d8a70
Show file tree
Hide file tree
Showing 23 changed files with 23 additions and 152 deletions.
7 changes: 0 additions & 7 deletions components/BurgerMenuNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@
</template>

<script>
import LanguageSwitcher from '@/components/LanguageSwitcher'
import BurgerMenuNavItems from '@/components/BurgerMenuNavItems'
export default {
name: 'BurgerMenuNav',
components: {
LanguageSwitcher,
BurgerMenuNavItems,
},
props: {
items: {
type: Object,
Expand Down
5 changes: 0 additions & 5 deletions components/ChartSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@
</template>

<script>
import LineChart from '@/components/LineChart'
export default {
name: 'ChartSection',
components: {
LineChart,
},
props: {
data: {
type: Object,
Expand Down
10 changes: 2 additions & 8 deletions components/FooterSliceZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:key="`footer-slice-left-${index}`"
>
<template v-if="slice.slice_type === 'logos_zone'">
<logos-zone :slice="slice" class="footer-left__logos" />
<slices-logos-zone :slice="slice" class="footer-left__logos" />
</template>
<prismic-rich-text
v-if="slice.slice_type === 'text'"
Expand All @@ -31,7 +31,7 @@
</div>
</div>
<div class="footer__right">
<navigation-group
<slices-navigation-group
v-for="(slice, index) in navigationGroups"
:key="`footer-slice-right-${index}`"
class="footer-right__navigation"
Expand All @@ -44,15 +44,9 @@
<script>
import { mapState } from 'vuex'
import { groupBy } from 'lodash'
import LogosZone from '@/components/slices/LogosZone'
import NavigationGroup from '@/components/slices/NavigationGroup'
export default {
name: 'FooterSliceZone',
components: {
LogosZone,
NavigationGroup,
},
data() {
return {
socialMediasHoverMap: {},
Expand Down
17 changes: 3 additions & 14 deletions components/NavigationSliceZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
:key="`navigation-slice-left-${index}`"
>
<template v-if="slice.slice_type === 'logos_zone'">
<logos-zone :slice="slice" />
<slices-logos-zone :slice="slice" />
</template>
<template v-if="slice.slice_type === 'navigation_zone'">
<navigation-zone :slice="slice" />
<slices-navigation-zone :slice="slice" />
</template>
</section>
</div>
Expand All @@ -25,7 +25,7 @@
class="navigation-slice-zone-content__right-side"
>
<template v-if="slice.slice_type === 'actions_zone'">
<actions-zone :slice="slice" />
<slices-actions-zone :slice="slice" />
</template>
</section>
</div>
Expand All @@ -35,19 +35,8 @@
<script>
import { mapState } from 'vuex'
import { groupBy } from 'lodash'
import LogosZone from '@/components/slices/LogosZone'
import NavigationZone from '@/components/slices/NavigationZone'
import ActionsZone from '@/components/slices/ActionsZone'
import BurgerMenuNav from '@/components/BurgerMenuNav'
export default {
name: 'NavigationSliceZone',
components: {
ActionsZone,
LogosZone,
NavigationZone,
BurgerMenuNav,
},
computed: {
isPixPro() {
return process.env.isPixPro
Expand Down
3 changes: 0 additions & 3 deletions components/NewsItemPost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@
</template>

<script>
import SliceZone from '@/components/SliceZone'
export default {
name: 'NewsItemPost',
components: { SliceZone },
props: {
newsItem: {
type: Object,
Expand Down
33 changes: 7 additions & 26 deletions components/SliceZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,33 @@
<prismic-rich-text :field="slice.primary.text" />
</template>
<template v-if="slice.slice_type === 'pop-in'">
<pop-in-campaigns :slice="slice" :index-for-id="index" />
<slices-pop-in-campaigns :slice="slice" :index-for-id="index" />
</template>
<template v-if="slice.slice_type === 'banner'">
<page-banner :slice="slice" :index-for-id="index" />
<slices-page-banner :slice="slice" :index-for-id="index" />
</template>
<template v-if="slice.slice_type === 'article'">
<article-slice :slice="slice" :index-for-id="index" />
<slices-article :slice="slice" :index-for-id="index" />
</template>
<template v-if="slice.slice_type === 'multiple_block'">
<multiple-block-slice :slice="slice" :index-for-id="index" />
<slices-multiple-block :slice="slice" :index-for-id="index" />
</template>
<template v-if="slice.slice_type === 'partners_logos'">
<partners-logos-slice :slice="slice" :index-for-id="index" />
<slices-partners-logos :slice="slice" :index-for-id="index" />
</template>
<template v-if="slice.slice_type === 'latest_news'">
<latest-news-slice :slice="slice" :index-for-id="index" />
<slices-latest-news :slice="slice" :index-for-id="index" />
</template>
<template v-if="slice.slice_type === 'stat'">
<stat :slice="slice" :index-for-id="index" />
<slices-stat :slice="slice" :index-for-id="index" />
</template>
</section>
</div>
</template>

<script>
import PageBanner from '@/components/slices/PageBanner'
import ArticleSlice from '@/components/slices/Article'
import LatestNewsSlice from '@/components/slices/LatestNews'
import PopInCampaigns from '@/components/slices/PopInCampaigns'
import MultipleBlockSlice from '@/components/slices/MultipleBlock'
import PartnersLogosSlice from '@/components/slices/PartnersLogos'
import Stat from '@/components/slices/Stat'
export default {
name: 'SliceZone',
components: {
MultipleBlockSlice,
PageBanner,
ArticleSlice,
LatestNewsSlice,
PopInCampaigns,
PartnersLogosSlice,
Stat,
},
props: {
slices: {
type: Array,
Expand All @@ -57,5 +40,3 @@ export default {
},
}
</script>

<style></style>
5 changes: 0 additions & 5 deletions components/slices/ActionsZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,8 @@
</template>

<script>
import LanguageSwitcher from '@/components/LanguageSwitcher'
export default {
name: 'ActionsZone',
components: {
LanguageSwitcher,
},
props: {
slice: {
type: Object,
Expand Down
5 changes: 0 additions & 5 deletions components/slices/Article.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,8 @@
</template>

<script>
import CtaButton from '../CtaButton'
export default {
name: 'Article',
components: {
CtaButton,
},
props: {
slice: {
type: Object,
Expand Down
5 changes: 0 additions & 5 deletions components/slices/LatestNews.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,8 @@
</template>

<script>
import NewsItemCard from '../NewsItemCard'
export default {
name: 'LatestNews',
components: {
NewsItemCard,
},
props: {
slice: {
type: Object,
Expand Down
5 changes: 0 additions & 5 deletions components/slices/NavigationZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,8 @@
</template>

<script>
import NavigationDropdown from '@/components/NavigationDropdown'
export default {
name: 'NavigationZone',
components: {
NavigationDropdown,
},
props: {
slice: {
type: Object,
Expand Down
3 changes: 0 additions & 3 deletions components/slices/PageBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@
</template>

<script>
import MediaPlayer from '../MediaPlayer'
export default {
name: 'PageBanner',
components: { MediaPlayer },
props: {
slice: {
type: Object,
Expand Down
5 changes: 0 additions & 5 deletions components/slices/Stat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@
</template>

<script>
import ChartSection from '~/components/ChartSection'
export default {
name: 'StatSlice',
components: {
ChartSection,
},
props: {
slice: {
type: Object,
Expand Down
14 changes: 0 additions & 14 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@
</div>
</template>

<script>
import HotNewsBanner from '@/components/HotNewsBanner'
import NavigationSliceZone from '@/components/NavigationSliceZone'
import FooterSliceZone from '@/components/FooterSliceZone'
export default {
components: {
FooterSliceZone,
HotNewsBanner,
NavigationSliceZone,
},
}
</script>

<style lang="scss">
html {
font-size: 16px;
Expand Down
2 changes: 1 addition & 1 deletion nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const config = {
'~plugins/vue-js-modal',
{ src: '~/plugins/prismicLinks', ssr: false },
],

components: true,
/*
** Nuxt.js dev-modules
*/
Expand Down
8 changes: 0 additions & 8 deletions pages/pix-pro/_custom-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</template>

<script>
import FormPage from '@/components/FormPage'
import SimplePage from '@/components/SimplePage'
import SliceZone from '@/components/SliceZone'
import { documentFetcher } from '~/services/document-fetcher'
export default {
Expand All @@ -27,11 +24,6 @@ export default {
'en-gb': '/:uid',
},
},
components: {
FormPage,
SimplePage,
SliceZone,
},
async asyncData({ params, app, req, error, currentPagePath }) {
try {
const document = await documentFetcher(
Expand Down
10 changes: 0 additions & 10 deletions pages/pix-pro/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</template>

<script>
import FormPage from '@/components/FormPage'
import SimplePage from '@/components/SimplePage'
import SliceZone from '@/components/SliceZone'
import { documentFetcher } from '~/services/document-fetcher'
export default {
Expand All @@ -27,11 +24,6 @@ export default {
'en-gb': '/',
},
},
components: {
FormPage,
SimplePage,
SliceZone,
},
async asyncData({ app, req, error, currentPagePath }) {
try {
const document = await documentFetcher(
Expand Down Expand Up @@ -64,5 +56,3 @@ export default {
},
}
</script>

<style lang="scss"></style>
8 changes: 0 additions & 8 deletions pages/pix-site/_custom-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</template>

<script>
import FormPage from '@/components/FormPage'
import SimplePage from '@/components/SimplePage'
import SliceZone from '@/components/SliceZone'
import { documentFetcher } from '~/services/document-fetcher'
export default {
Expand All @@ -27,11 +24,6 @@ export default {
'en-gb': '/:uid',
},
},
components: {
FormPage,
SimplePage,
SliceZone,
},
async asyncData({ params, app, req, error, currentPagePath }) {
try {
const document = await documentFetcher(
Expand Down
6 changes: 0 additions & 6 deletions pages/pix-site/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
</template>

<script>
import SliceZone from '@/components/SliceZone'
import { documentFetcher } from '~/services/document-fetcher'
export default {
Expand All @@ -17,9 +16,6 @@ export default {
'en-gb': '/',
},
},
components: {
SliceZone,
},
async asyncData({ app, req, error, currentPagePath }) {
try {
const document = await documentFetcher(
Expand Down Expand Up @@ -66,5 +62,3 @@ export default {
},
}
</script>

<style lang="scss"></style>
Loading

0 comments on commit 79d8a70

Please sign in to comment.