-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPressReleaseCard.vue
98 lines (98 loc) · 1.94 KB
/
PressReleaseCard.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
91
92
93
94
95
96
97
98
<template>
<section class="cision-feed-item">
<h1>{{ item.title }}</h1>
<time>{{ item.date }}</time>
<span v-if="markItem">
{{ releaseText }}
</span>
<div v-if="showMedia && item.image" class="cision-feed-item-media">
<img :src="item.image" :alt="item.title" />
</div>
<p v-if="showIntro" class="intro">{{ item.intro }}</p>
<p v-if="showBody">{{ item.body }}</p>
<nuxt-link :to="link">
{{ linkText }}
</nuxt-link>
</section>
</template>
<script>
export default {
name: 'PressReleaseCard',
components: {},
props: {
item: {
type: Object,
required: true,
},
showMedia: {
type: Boolean,
default: false,
},
showIntro: {
type: Boolean,
default: false,
},
showBody: {
type: Boolean,
default: true,
},
markItem: {
type: Boolean,
default: false,
},
regulatoryText: {
type: String,
required: false,
default: 'Regulatory',
},
nonRegulatoryText: {
type: String,
required: false,
default: 'Non-regulatory',
},
linkText: {
type: String,
default: 'Read more',
},
},
computed: {
link() {
return `${this.$cision.options?.basePath + '/' + this.item.encryptedId}`
},
releaseText() {
return this.item.isRegulatory
? this.regulatoryText
: this.nonRegulatoryText
},
},
}
</script>
<style scoped>
.cision-feed-item {
overflow: hidden;
border-bottom: 1px solid #c0c0c0;
padding: 15px 0 30px 0;
margin-bottom: 15px;
}
.cision-feed-item .cision-feed-regulatory {
display: block;
padding: 15px 0;
}
.cision-feed-item-media {
width: 100%;
padding-bottom: 10px;
display: block;
}
.cision-feed-item-media img {
display: block;
margin: 5px auto;
max-width: 100%;
vertical-align: middle;
border: 0;
}
@media screen and (min-width: 768px) {
.cision-feed-item {
padding: 30px;
}
}
</style>