2018-11-14 14:00:01 +00:00
|
|
|
<template>
|
2018-11-19 15:32:50 +00:00
|
|
|
<div class="account-button-container" >
|
|
|
|
<div class="account-button-toggle-container" v-on:click="toggleSelection" >
|
2018-11-16 14:28:02 +00:00
|
|
|
<!-- background of this div generated and stores in store -->
|
2018-11-19 15:32:50 +00:00
|
|
|
<div class="account-button-toggle-container__avatar" :style="style">
|
2018-11-16 14:28:02 +00:00
|
|
|
<!-- First digit of firstName after Registration -->
|
|
|
|
<!-- img if avatar was set -->
|
|
|
|
<h1>{{avatarLetter}}</h1>
|
|
|
|
</div>
|
2018-11-23 15:48:11 +00:00
|
|
|
<h1 class="account-button-toggle-container__user-name">{{userName}}</h1>
|
2018-11-19 15:32:50 +00:00
|
|
|
<div class="account-button-toggle-container__expander-area">
|
2018-11-16 14:28:02 +00:00
|
|
|
<img v-if="!isChoiceShown" src="../../../../static/images/register/BlueExpand.svg" />
|
|
|
|
<img v-if="isChoiceShown" src="../../../../static/images/register/BlueHide.svg" />
|
2018-11-14 14:00:01 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-11-16 14:28:02 +00:00
|
|
|
<AccountDropdown v-if="isChoiceShown" @onClose="toggleSelection" />
|
|
|
|
</div>
|
2018-11-14 14:00:01 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Vue } from 'vue-property-decorator';
|
2018-11-16 14:28:02 +00:00
|
|
|
import AccountDropdown from "./AccountDropdown.vue";
|
2018-11-14 14:00:01 +00:00
|
|
|
|
|
|
|
@Component(
|
|
|
|
{
|
|
|
|
data: function() {
|
|
|
|
return {
|
|
|
|
// this.$store.userName
|
2018-11-16 14:28:02 +00:00
|
|
|
userName: "User Name",
|
|
|
|
isChoiceShown: false
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
2018-11-16 14:28:02 +00:00
|
|
|
style: function() : object {
|
2018-11-14 14:00:01 +00:00
|
|
|
//color from $store
|
|
|
|
return { background: "#95D486" }
|
|
|
|
},
|
|
|
|
// may change later
|
|
|
|
avatarLetter: function() : string {
|
|
|
|
return this.$data.userName.slice(0,1).toUpperCase();
|
|
|
|
}
|
2018-11-16 14:28:02 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toggleSelection: function() : void {
|
|
|
|
this.$data.isChoiceShown = !this.$data.isChoiceShown;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
AccountDropdown
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
export default class AccountButton extends Vue {}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
a {
|
|
|
|
text-decoration: none;
|
|
|
|
outline: none;
|
|
|
|
}
|
2018-11-19 15:32:50 +00:00
|
|
|
.account-button-container {
|
2018-11-16 14:28:02 +00:00
|
|
|
position: relative;
|
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-11-23 15:48:11 +00:00
|
|
|
|
2018-11-19 15:32:50 +00:00
|
|
|
.account-button-toggle-container {
|
2018-11-14 14:00:01 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
2018-11-23 15:48:11 +00:00
|
|
|
justify-content: flex-start;
|
|
|
|
width: 100%;
|
|
|
|
max-width: 190px;
|
|
|
|
height: 50px;
|
|
|
|
|
|
|
|
&__user-name {
|
|
|
|
margin-left: 12px;
|
|
|
|
width: 100px;
|
|
|
|
font-family: 'montserrat_medium';
|
|
|
|
font-size: 16px;
|
|
|
|
line-height: 23px;
|
|
|
|
color: #354049;
|
|
|
|
}
|
2018-11-19 15:32:50 +00:00
|
|
|
|
|
|
|
&__avatar {
|
2018-11-23 15:48:11 +00:00
|
|
|
width: 40px;
|
|
|
|
height: 40px;
|
2018-11-19 15:32:50 +00:00
|
|
|
border-radius: 6px;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
h1 {
|
|
|
|
font-family: 'montserrat_medium';
|
|
|
|
font-size: 16px;
|
|
|
|
line-height: 23px;
|
|
|
|
color: #354049;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&__expander-area {
|
2018-11-23 15:48:11 +00:00
|
|
|
margin-left: 12px;
|
2018-11-19 15:32:50 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
width: 28px;
|
|
|
|
height: 28px;
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
|
|
|
}
|
2018-11-23 15:48:11 +00:00
|
|
|
|
|
|
|
@media screen and (max-width: 720px) {
|
|
|
|
|
|
|
|
.account-button-toggle-container {
|
|
|
|
&__user-name {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-14 14:00:01 +00:00
|
|
|
</style>
|