forked from EnergySage/es-ds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEsSupport.vue
117 lines (109 loc) · 2.79 KB
/
EsSupport.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<template>
<div
class="d-flex support-holder align-items-center"
v-bind="$attrs"
v-on="$listeners">
<div class="image-holder mr-50">
<a
target="_blank"
aria-label="Help"
:href="link">
<b-img
width="64px"
height="64px"
:class="`image image-bg-${variant}`"
:src="src"
alt="Help Image" />
</a>
</div>
<div class="text-holder d-flex flex-column">
<div class="title">
<div class="h5 mb-25 font-size-base font-weight-bold">
<slot
v-if="hasTitle"
name="title" />
<template v-else>
Need help signing up?
</template>
</div>
</div>
<div class="link">
<a
target="_blank"
class="font-size-75 supportLink"
:href="link">
<slot
v-if="hasLinkCopy"
name="linkCopy" />
<template v-else>
Schedule a free call with your EnergySage Advisor.
</template>
</a>
</div>
</div>
</div>
</template>
<script lang="js">
import { BImg } from 'bootstrap-vue';
export default {
name: 'EsSupport',
components: {
BImg,
},
props: {
/**
* Link
*/
link: {
default: '',
type: String,
required: true,
},
/**
* Image src
*
*/
src: {
type: String,
required: true,
},
/**
* Support Variant
*/
variant: {
type: String,
required: false,
default: 'warm',
validator: (val) => ['warm', 'cool'].includes(val),
},
},
computed: {
hasTitle() {
return !!this.$slots.title;
},
hasLinkCopy() {
return !!this.$slots.linkCopy;
},
},
};
</script>
<style lang="scss" scoped>
@use "~@energysage/es-bs-base/scss/variables" as variables;
.support-holder {
max-width: 325px;
.image-holder {
height: 64px;
width: 64px;
.image {
border-radius: 2rem;
object-fit: contain;
&.image-bg-warm {
background: linear-gradient(141.22deg, variables.$yellow 8.76%, variables.$pink 100%);
}
&.image-bg-cool {
background: variables.$teal-300;
}
}
}
}
</style>