Skip to content

Commit

Permalink
fix: using FetchAsteroidWatchWidget (#624)
Browse files Browse the repository at this point in the history
* using FetchAsteroidWatchWidget

* fixing mock component
  • Loading branch information
stephiescastle authored Sep 18, 2024
1 parent 39a28f3 commit 606173a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 30 deletions.
4 changes: 4 additions & 0 deletions apps/vue-storybook/.storybook/_mock-components.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// import and assign mock components
import { action } from '@storybook/addon-actions'
import DsnWidget from '@explorer-1/vue/src/components/DsnWidget/DsnWidget.vue'
import AsteroidWatchWidget from '@explorer-1/vue/src/components/AsteroidWatchWidget/AsteroidWatchWidget.vue'

export default (app) => {
// nuxt-link mock component
Expand All @@ -27,4 +28,7 @@ export default (app) => {

// use static dsn widget instead of fetch
app.component('FetchDsnWidget', DsnWidget)

// use static asteroid watch widget instead of fetch
app.component('FetchAsteroidWatchWidget', AsteroidWatchWidget)
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<script setup lang="ts">
import { reactive } from 'vue'
import NavSecondary from './../../../components/NavSecondary/NavSecondary.vue'
import LayoutHelper from './../../../components/LayoutHelper/LayoutHelper.vue'
import DetailHeadline from './../../../components/DetailHeadline/DetailHeadline.vue'
import HeroMedia from './../../../components/HeroMedia/HeroMedia.vue'
import ShareButtons from './../../../components/ShareButtons/ShareButtons.vue'
import BlockStreamfield from './../../../components/BlockStreamfield/BlockStreamfield.vue'
interface PageAsteroidWatchContentProps {
data: any
}
const props = withDefaults(defineProps<PageAsteroidWatchContentProps>(), {
data: undefined
})
const { data } = reactive(props)
</script>
<template>
<div
v-if="data"
Expand Down Expand Up @@ -30,7 +48,7 @@
</LayoutHelper>

<template v-if="data.slug === 'next-five-approaches'">
<AsteroidWatchWidget class="lg:mb-18 mb-10" />
<FetchAsteroidWatchWidget class="lg:mb-18 mb-10" />
</template>

<!-- share buttons -->
Expand All @@ -48,32 +66,3 @@
<BlockStreamfield :data="data.body" />
</div>
</template>
<script>
import { defineComponent } from 'vue'
import NavSecondary from './../../../components/NavSecondary/NavSecondary.vue'
import LayoutHelper from './../../../components/LayoutHelper/LayoutHelper.vue'
import DetailHeadline from './../../../components/DetailHeadline/DetailHeadline.vue'
import HeroMedia from './../../../components/HeroMedia/HeroMedia.vue'
import ShareButtons from './../../../components/ShareButtons/ShareButtons.vue'
import BlockStreamfield from './../../../components/BlockStreamfield/BlockStreamfield.vue'
import AsteroidWatchWidget from './../../../components/AsteroidWatchWidget/AsteroidWatchWidget.vue'
export default defineComponent({
name: 'PageAsteroidWatchContent',
components: {
NavSecondary,
LayoutHelper,
HeroMedia,
ShareButtons,
BlockStreamfield,
DetailHeadline,
AsteroidWatchWidget
},
props: {
data: {
type: Object,
required: false
}
}
})
</script>

0 comments on commit 606173a

Please sign in to comment.