2019-01-24 20:15:10 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
2018-11-27 10:51:33 +00:00
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2018-11-14 14:00:01 +00:00
|
|
|
<template>
|
2018-11-19 15:32:50 +00:00
|
|
|
<div class="new-project-container">
|
2019-04-05 16:08:14 +01:00
|
|
|
<div class="new-project-button-container" :class="{ active: !hasProjects }" v-on:click="toggleSelection" id="newProjectButton">
|
2019-04-11 02:27:55 +01:00
|
|
|
<h1>+ New Project</h1>
|
2018-11-14 14:00:01 +00:00
|
|
|
</div>
|
2019-01-09 15:40:21 +00:00
|
|
|
<NewProjectPopup v-if="isPopupShown"/>
|
2018-11-14 14:00:01 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2019-07-08 14:45:25 +01:00
|
|
|
import { mapState } from 'vuex';
|
|
|
|
import { Component, Vue } from 'vue-property-decorator';
|
|
|
|
import NewProjectPopup from '@/components/project/NewProjectPopup.vue';
|
|
|
|
import { APP_STATE_ACTIONS } from '@/utils/constants/actionNames';
|
2018-11-14 14:00:01 +00:00
|
|
|
|
2019-07-08 14:45:25 +01:00
|
|
|
// Button and popup for adding new Project
|
|
|
|
@Component({
|
2018-11-14 14:00:01 +00:00
|
|
|
methods: {
|
|
|
|
toggleSelection: function () {
|
2019-01-09 15:40:21 +00:00
|
|
|
this.$store.dispatch(APP_STATE_ACTIONS.TOGGLE_NEW_PROJ);
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
NewProjectPopup
|
2019-01-09 15:40:21 +00:00
|
|
|
},
|
|
|
|
computed: mapState({
|
2019-04-05 16:08:14 +01:00
|
|
|
isPopupShown: function (state: any): boolean {
|
|
|
|
return state.appStateModule.appState.isNewProjectPopupShown;
|
|
|
|
},
|
|
|
|
hasProjects: function (state: any): boolean {
|
|
|
|
return state.projectsModule.projects.length;
|
|
|
|
}
|
2019-01-09 15:40:21 +00:00
|
|
|
}),
|
2019-07-08 14:45:25 +01:00
|
|
|
})
|
2018-11-14 14:00:01 +00:00
|
|
|
|
2019-07-08 14:45:25 +01:00
|
|
|
export default class NewProjectArea extends Vue {}
|
2018-11-14 14:00:01 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2018-11-19 15:32:50 +00:00
|
|
|
.new-project-container {
|
2018-11-14 14:00:01 +00:00
|
|
|
padding-left: 10px;
|
|
|
|
padding-right: 10px;
|
|
|
|
background-color: #FFFFFF;
|
2018-11-16 14:28:02 +00:00
|
|
|
cursor: pointer;
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
2018-12-18 14:43:23 +00:00
|
|
|
|
2018-11-19 15:32:50 +00:00
|
|
|
.new-project-button-container {
|
2018-11-14 14:00:01 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2018-11-23 15:48:11 +00:00
|
|
|
width: 170px;
|
|
|
|
height: 50px;
|
2018-11-14 14:00:01 +00:00
|
|
|
border-radius: 6px;
|
|
|
|
border: 1px solid #AFB7C1;
|
2018-11-23 15:48:11 +00:00
|
|
|
background-color: white;
|
2018-12-18 14:43:23 +00:00
|
|
|
|
|
|
|
|
2018-11-14 14:00:01 +00:00
|
|
|
h1 {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_medium';
|
2018-11-14 14:00:01 +00:00
|
|
|
font-size: 16px;
|
|
|
|
line-height: 23px;
|
|
|
|
color: #354049;
|
|
|
|
}
|
2018-11-23 15:48:11 +00:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: #2683FF;
|
|
|
|
border: 1px solid #2683FF;
|
|
|
|
box-shadow: 0px 4px 20px rgba(35, 121, 236, 0.4);
|
|
|
|
|
|
|
|
h1 {
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
}
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
2019-04-05 16:08:14 +01:00
|
|
|
.new-project-button-container.active {
|
|
|
|
background-color: #2683FF;
|
|
|
|
border: 1px solid #2683FF;
|
|
|
|
box-shadow: 0px 4px 20px rgba(35, 121, 236, 0.4);
|
|
|
|
|
|
|
|
h1 {
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
}
|
2018-11-14 14:00:01 +00:00
|
|
|
</style>
|