-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathIssue.vue
90 lines (75 loc) · 2.02 KB
/
Issue.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<template lang="pug">
article.issue
IssueHeader(:issue="issue")
.issue-description
MarkdownRenderer(:content="issue.description")
//- PlayPodcastButton(v-if="podcastExists", @click="playPodcast")
hr.hr
h1.issue-section-header Stories
Story(v-for="story of stories", :story="story", :key="story.url")
hr.hr
h1.issue-section-header Libraries
Library(v-for="library of libraries", :library="library", :key="library.url")
</template>
<script setup lang="ts">
import { computed } from 'vue'
import Story from './Story'
import Library from './Library'
import PlayPodcastButton from './PlayPodcastButton'
import IssueHeader from '@/components/IssueHeader'
import MarkdownRenderer from '@/components/MarkdownRenderer'
const props = defineProps<{
issue: {
issueNumber: number
description: string
stories: Array<{ fields: any }>
podcast: { source: string }
}
}>()
const store = useStore()
const stories = computed(() => {
if (!props.issue.stories) return []
return props.issue.stories
.filter(story => !story.fields.isLibrary)
.map(story => story.fields)
})
const libraries = computed(() => {
if (!props.issue.stories) return []
return props.issue.stories
.filter(story => story.fields.isLibrary)
.map(library => library.fields)
})
const podcastExists = computed(() => !!props.issue.podcast.source)
const playPodcast = () => {
store.currentPodcastNumber = props.issue.issueNumber
// eventBus.$emit('play')
}
// onMounted(() => {
// this.$ga.event('issue', 'open', props.issue.issueNumber)
// })
</script>
<style lang="sass" scoped>
@use '~/assets/branding'
.issue
padding: 0 0 20px
margin-bottom: 30px
border-bottom: 1px solid #eee
.issue-actions
margin-top: 15px
display: flex
.issue-section-header
margin: 20px 0
font-size: 32px
.issue-player
margin-top: 10px
line-height: 40px
background: #f9f9f9
padding: 10px 20px
border-radius: 10px
img
width: 40px
height: 40px
vertical-align: middle
margin-right: 10px
display: inline-block
</style>