2019-09-09 17:00:25 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="remaining-space-container">
|
|
|
|
<p class="remaining-space-container__title">{{label}}</p>
|
2019-09-12 14:46:22 +01:00
|
|
|
<p class="remaining-space-container__amount"><b>{{remaining}}GB</b></p>
|
2019-09-09 17:00:25 +01:00
|
|
|
<div class="remaining-space-container__bar">
|
2019-09-30 16:17:30 +01:00
|
|
|
<VInfo :text="infoMessage">
|
2019-10-02 11:26:50 +01:00
|
|
|
<VBar
|
|
|
|
:current="currentBarAmount"
|
|
|
|
:max="maxBarAmount"
|
|
|
|
color="#224CA5"
|
|
|
|
/>
|
2019-09-30 16:17:30 +01:00
|
|
|
</VInfo>
|
2019-09-09 17:00:25 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Prop, Vue } from 'vue-property-decorator';
|
|
|
|
|
2019-09-30 16:17:30 +01:00
|
|
|
import VBar from '@/app/components/VBar.vue';
|
|
|
|
import VInfo from '@/app/components/VInfo.vue';
|
2019-09-09 17:00:25 +01:00
|
|
|
|
|
|
|
@Component ({
|
|
|
|
components: {
|
2019-09-30 16:17:30 +01:00
|
|
|
VBar,
|
|
|
|
VInfo,
|
2019-09-09 17:00:25 +01:00
|
|
|
},
|
|
|
|
})
|
2019-09-30 16:17:30 +01:00
|
|
|
export default class BarInfo extends Vue {
|
2019-09-09 17:00:25 +01:00
|
|
|
@Prop({default: ''})
|
|
|
|
private readonly label: string;
|
|
|
|
@Prop({default: ''})
|
|
|
|
private readonly amount: number;
|
|
|
|
@Prop({default: ''})
|
|
|
|
private readonly infoText: string;
|
|
|
|
@Prop({default: ''})
|
|
|
|
private readonly currentBarAmount: number;
|
|
|
|
@Prop({default: ''})
|
|
|
|
private readonly maxBarAmount: number;
|
|
|
|
|
|
|
|
public get infoMessage(): string {
|
|
|
|
return `${Math.floor(100 - (this.currentBarAmount / this.maxBarAmount) * 100)}% ${this.infoText}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
public get remaining(): string {
|
|
|
|
return this.amount.toFixed(2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.remaining-space-container {
|
|
|
|
width: 325px;
|
|
|
|
height: 90px;
|
|
|
|
background-color: #FFFFFF;
|
|
|
|
border: 1px solid #E9EFF4;
|
|
|
|
border-radius: 11px;
|
|
|
|
padding: 34px 36px 39px 39px;
|
|
|
|
margin-bottom: 32px;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
&__title {
|
|
|
|
font-size: 14px;
|
|
|
|
color: #586C86;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__amount {
|
|
|
|
font-size: 32px;
|
|
|
|
line-height: 57px;
|
|
|
|
color: #535F77;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|