storj/web/satellite/src/App.vue

162 lines
4.8 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.ts';
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 isNewOnboardingFlow = MetaUtils.getMetaContent('new-onboarding-flow');
if (satelliteName) {
this.$store.dispatch(APP_STATE_ACTIONS.SET_SATELLITE_NAME, satelliteName);
if (partneredSatellitesJson) {
const partneredSatellites: PartneredSatellite[] = [];
partneredSatellitesJson.forEach((partner) => {
const name = partner[0];
const address = partner[1];
// skip current satellite
if (name !== satelliteName) {
partneredSatellites.push(new PartneredSatellite(name, address));
}
});
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 (isNewOnboardingFlow) {
this.$store.dispatch(APP_STATE_ACTIONS.SET_ONB_CLI_FLOW_STATUS, isNewOnboardingFlow === '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;
}
@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 rgba(56, 75, 101, 0.4);
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>