2021-04-27 13:21:13 +01:00
|
|
|
// Copyright (C) 2021 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
<template>
|
2021-06-09 16:13:19 +01:00
|
|
|
<div class="loader">
|
2021-08-10 14:14:37 +01:00
|
|
|
<LoaderImage :class="{ white: isWhite }" :style="style" />
|
2021-06-09 16:13:19 +01:00
|
|
|
</div>
|
2021-04-27 13:21:13 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Prop, Vue } from 'vue-property-decorator';
|
|
|
|
|
2021-06-09 16:13:19 +01:00
|
|
|
import LoaderImage from '@/../static/images/common/loader.svg';
|
|
|
|
|
2021-08-31 14:49:45 +01:00
|
|
|
// @vue/component
|
2021-06-09 16:13:19 +01:00
|
|
|
@Component({
|
|
|
|
components: {
|
|
|
|
LoaderImage,
|
|
|
|
},
|
|
|
|
})
|
2021-04-27 13:21:13 +01:00
|
|
|
export default class VLoader extends Vue {
|
2021-06-09 16:13:19 +01:00
|
|
|
@Prop({ default: 'unset' })
|
2021-04-27 13:21:13 +01:00
|
|
|
private readonly width: string;
|
2021-06-09 16:13:19 +01:00
|
|
|
@Prop({ default: 'unset' })
|
2021-04-27 13:21:13 +01:00
|
|
|
private readonly height: string;
|
2021-06-09 16:13:19 +01:00
|
|
|
@Prop({ default: false })
|
|
|
|
private readonly isWhite: boolean;
|
2021-04-27 13:21:13 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns loader's width and height from props.
|
|
|
|
*/
|
2021-08-02 19:17:49 +01:00
|
|
|
public get style(): Record<string, unknown> {
|
2021-04-27 13:21:13 +01:00
|
|
|
return { width: this.width, height: this.height };
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.loader {
|
2021-06-09 16:13:19 +01:00
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
2021-04-27 13:21:13 +01:00
|
|
|
}
|
|
|
|
|
2021-06-09 16:13:19 +01:00
|
|
|
.white {
|
|
|
|
|
|
|
|
path {
|
|
|
|
fill: #fff;
|
|
|
|
}
|
2021-04-27 13:21:13 +01:00
|
|
|
}
|
|
|
|
</style>
|