storj/web/satellite/src/App.vue

168 lines
5.0 KiB
Vue
Raw Normal View History

2019-01-24 20:15:10 +00:00
// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
<template>
<div id="app">
<router-view />
<!-- Area for displaying notification -->
<NotificationArea />
</div>
</template>
<script lang="ts">
2019-09-09 11:33:39 +01:00
import { Component, Vue } from 'vue-property-decorator';
import NotificationArea from '@/components/notifications/NotificationArea.vue';
import { PartneredSatellite } from '@/types/common';
2019-09-09 11:33:39 +01:00
import { APP_STATE_ACTIONS } from '@/utils/constants/actionNames';
import { MetaUtils } from '@/utils/meta';
2019-09-09 11:33:39 +01:00
// @vue/component
2019-09-09 11:33:39 +01:00
@Component({
components: {
NotificationArea,
2019-09-09 11:33:39 +01:00
},
})
export default class App extends Vue {
/**
* Lifecycle hook after initial render.
* Sets up variables from meta tags from config such satellite name, etc.
*/
public mounted(): void {
const satelliteName = MetaUtils.getMetaContent('satellite-name');
const partneredSatellitesData = MetaUtils.getMetaContent('partnered-satellites');
let partneredSatellitesJSON = [];
if (partneredSatellitesData) {
partneredSatellitesJSON = JSON.parse(partneredSatellitesData);
}
const isBetaSatellite = MetaUtils.getMetaContent('is-beta-satellite');
const couponCodeBillingUIEnabled = MetaUtils.getMetaContent('coupon-code-billing-ui-enabled');
const couponCodeSignupUIEnabled = MetaUtils.getMetaContent('coupon-code-signup-ui-enabled');
const isNewProjectDashboard = MetaUtils.getMetaContent('new-project-dashboard');
const isNewObjectsFlow = MetaUtils.getMetaContent('new-objects-flow');
if (satelliteName) {
this.$store.dispatch(APP_STATE_ACTIONS.SET_SATELLITE_NAME, satelliteName);
if (partneredSatellitesJSON.length) {
const partneredSatellites: PartneredSatellite[] = [];
partneredSatellitesJSON.forEach((sat: PartneredSatellite) => {
// skip current satellite
if (sat.name !== satelliteName) {
partneredSatellites.push(sat);
}
});
this.$store.dispatch(APP_STATE_ACTIONS.SET_PARTNERED_SATELLITES, partneredSatellites);
}
}
if (isBetaSatellite) {
this.$store.dispatch(APP_STATE_ACTIONS.SET_SATELLITE_STATUS, isBetaSatellite === 'true');
}
if (couponCodeBillingUIEnabled) {
this.$store.dispatch(APP_STATE_ACTIONS.SET_COUPON_CODE_BILLING_UI_STATUS, couponCodeBillingUIEnabled === 'true');
}
if (couponCodeSignupUIEnabled) {
this.$store.dispatch(APP_STATE_ACTIONS.SET_COUPON_CODE_SIGNUP_UI_STATUS, couponCodeSignupUIEnabled === 'true');
}
if (isNewProjectDashboard) {
this.$store.dispatch(APP_STATE_ACTIONS.SET_PROJECT_DASHBOARD_STATUS, isNewProjectDashboard === 'true');
}
if (isNewObjectsFlow) {
this.$store.dispatch(APP_STATE_ACTIONS.SET_OBJECTS_FLOW_STATUS, isNewObjectsFlow === 'true');
}
}
2019-09-09 11:33:39 +01:00
}
</script>
<style lang="scss">
html {
overflow: hidden;
}
body {
margin: 0 !important;
height: 100vh;
zoom: 100%;
overflow: hidden;
}
img,
a {
-webkit-user-drag: none;
}
#app {
height: 100%;
}
@font-face {
font-family: 'font_regular';
font-style: normal;
font-weight: 400;
font-display: swap;
src:
local(''),
url('../static/fonts/inter-v3-latin-regular.woff2') format('woff2'),
url('../static/fonts/inter-v3-latin-regular.woff') format('woff'),
url('../static/fonts/inter-v3-latin-regular.ttf') format('truetype');
}
@font-face {
font-family: 'font_medium';
font-style: normal;
font-weight: 600;
font-display: swap;
src:
local(''),
url('../static/fonts/inter-v3-latin-600.woff2') format('woff2'),
url('../static/fonts/inter-v3-latin-600.woff') format('woff'),
url('../static/fonts/inter-v3-latin-600.ttf') format('truetype');
}
@font-face {
font-family: 'font_bold';
font-style: normal;
font-weight: 800;
font-display: swap;
src:
local(''),
url('../static/fonts/inter-v3-latin-800.woff2') format('woff2'),
url('../static/fonts/inter-v3-latin-800.woff') format('woff'),
url('../static/fonts/inter-v3-latin-800.ttf') format('truetype');
}
a {
text-decoration: none;
outline: none;
cursor: pointer;
}
input,
textarea {
font-family: inherit;
border: 1px solid rgb(56 75 101 / 40%);
color: #354049;
caret-color: #2683ff;
}
2019-05-29 17:22:16 +01:00
::-webkit-scrollbar {
width: 4px;
}
::-webkit-scrollbar-track {
box-shadow: inset 0 0 5px #fff;
}
::-webkit-scrollbar-thumb {
background: #afb7c1;
2019-05-29 17:22:16 +01:00
border-radius: 6px;
height: 5px;
}
</style>