Skip to content

Commit

Permalink
using FetchAsteroidWatchWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
stephiescastle committed Sep 18, 2024
1 parent 39a28f3 commit 10fcc99
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 31 deletions.
3 changes: 2 additions & 1 deletion 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 @@ -26,5 +27,5 @@ export default (app) => {
})

// use static dsn widget instead of fetch
app.component('FetchDsnWidget', DsnWidget)
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 10fcc99

Please sign in to comment.