/
PaidTierBar.vue
58 lines (51 loc) · 1.7 KB
/
PaidTierBar.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
// Copyright (C) 2021 Storj Labs, Inc.
// See LICENSE for copying information.
<template>
<div class="pt-bar">
<p>
Upload up to 75TB by upgrading to a Storj Pro Account.
</p>
<p class="pt-bar__functional" @click="openBanner">
Upgrade now.
</p>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import { AnalyticsHttpApi } from '@/api/analytics';
import { AnalyticsEvent } from '@/utils/constants/analyticsEventNames';
import { AB_TESTING_ACTIONS } from '@/store/modules/abTesting';
import { ABHitAction } from '@/types/abtesting';
// @vue/component
@Component
export default class PaidTierBar extends Vue {
@Prop({ default: () => () => false })
public readonly openAddPMModal: () => void;
private readonly analytics: AnalyticsHttpApi = new AnalyticsHttpApi();
// Send analytics event to segment when Upgrade Account banner is clicked.
public async openBanner(): Promise<void> {
this.openAddPMModal();
await this.analytics.eventTriggered(AnalyticsEvent.UPGRADE_BANNER_CLICKED);
await this.$store.dispatch(AB_TESTING_ACTIONS.HIT, ABHitAction.UPGRADE_ACCOUNT_CLICKED);
}
}
</script>
<style scoped lang="scss">
.pt-bar {
width: 100%;
box-sizing: border-box;
font-family: 'font_regular', sans-serif;
display: flex;
align-items: center;
justify-content: space-between;
background: #0047ff;
font-size: 14px;
line-height: 18px;
color: #eee;
padding: 5px 30px;
&__functional {
font-family: 'font_bold', sans-serif;
cursor: pointer;
}
}
</style>