2019-08-19 12:20:38 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
<template>
|
2019-10-25 11:01:03 +01:00
|
|
|
<div class="user-container" :class="{ 'owner': isProjectOwner }">
|
2019-08-19 12:20:38 +01:00
|
|
|
<div class="user-container__base-info">
|
2019-10-25 11:01:03 +01:00
|
|
|
<div v-if="!isProjectOwner" class="checkbox"></div>
|
2019-08-19 12:20:38 +01:00
|
|
|
<div class="user-container__base-info__avatar" :style="avatarData.style">
|
2019-09-26 14:36:12 +01:00
|
|
|
<h1 class="user-container__base-info__avatar__letter">{{avatarData.letter}}</h1>
|
2019-08-19 12:20:38 +01:00
|
|
|
</div>
|
2019-10-22 12:12:49 +01:00
|
|
|
<div class="user-container__base-info__name-area">
|
|
|
|
<p class="user-container__base-info__name-area__user-name">{{itemName}}</p>
|
|
|
|
<p v-if="isProjectOwner" class="user-container__base-info__name-area__owner-status">Project Owner</p>
|
|
|
|
</div>
|
2019-08-19 12:20:38 +01:00
|
|
|
</div>
|
2019-10-02 10:42:12 +01:00
|
|
|
<p class="user-container__date">{{itemDate}}</p>
|
|
|
|
<p class="user-container__user-email">{{itemEmail}}</p>
|
2019-08-19 12:20:38 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2019-09-09 11:33:39 +01:00
|
|
|
import { Component, Prop, Vue } from 'vue-property-decorator';
|
2019-08-19 12:20:38 +01:00
|
|
|
|
2019-09-09 11:33:39 +01:00
|
|
|
import { ProjectMember } from '@/types/projectMembers';
|
|
|
|
import { getColor } from '@/utils/avatarColorManager';
|
2019-08-19 12:20:38 +01:00
|
|
|
|
2019-09-09 11:33:39 +01:00
|
|
|
@Component
|
|
|
|
export default class ProjectMemberListItem extends Vue {
|
|
|
|
@Prop({default: new ProjectMember('', '', '', '', '')})
|
|
|
|
public itemData: ProjectMember;
|
2019-08-19 12:20:38 +01:00
|
|
|
|
2019-09-09 11:33:39 +01:00
|
|
|
public get avatarData(): object {
|
|
|
|
const fullName: string = this.itemData.user.getFullName();
|
2019-08-19 12:20:38 +01:00
|
|
|
|
2019-09-09 11:33:39 +01:00
|
|
|
const letter = fullName.slice(0, 1).toLocaleUpperCase();
|
2019-08-19 12:20:38 +01:00
|
|
|
|
2019-09-09 11:33:39 +01:00
|
|
|
const style = {
|
2019-09-13 15:58:18 +01:00
|
|
|
background: getColor(letter),
|
2019-09-09 11:33:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
letter,
|
2019-09-13 15:58:18 +01:00
|
|
|
style,
|
2019-09-09 11:33:39 +01:00
|
|
|
};
|
2019-08-19 12:20:38 +01:00
|
|
|
}
|
2019-10-02 10:42:12 +01:00
|
|
|
|
|
|
|
public get itemName(): string {
|
|
|
|
return this.itemData.formattedFullName();
|
|
|
|
}
|
|
|
|
|
|
|
|
public get itemDate(): string {
|
|
|
|
return this.itemData.joinedAtLocal();
|
|
|
|
}
|
|
|
|
|
|
|
|
public get itemEmail(): string {
|
|
|
|
return this.itemData.formattedEmail();
|
|
|
|
}
|
2019-10-22 12:12:49 +01:00
|
|
|
|
|
|
|
public get isProjectOwner(): boolean {
|
|
|
|
return this.itemData.user.id === this.$store.getters.selectedProject.ownerId;
|
|
|
|
}
|
2019-09-09 11:33:39 +01:00
|
|
|
}
|
2019-08-19 12:20:38 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.user-container {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
padding-left: 28px;
|
|
|
|
height: 83px;
|
|
|
|
background-color: #fff;
|
|
|
|
cursor: pointer;
|
|
|
|
width: calc(100% - 28px);
|
2019-09-26 14:36:12 +01:00
|
|
|
font-family: 'font_regular';
|
2019-08-19 12:20:38 +01:00
|
|
|
|
|
|
|
&__base-info {
|
|
|
|
width: 50%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
|
|
|
&__avatar {
|
|
|
|
min-width: 40px;
|
|
|
|
max-width: 40px;
|
|
|
|
min-height: 40px;
|
|
|
|
max-height: 40px;
|
|
|
|
border-radius: 6px;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
background-color: #FF8658;
|
|
|
|
|
2019-09-26 14:36:12 +01:00
|
|
|
&__letter {
|
2019-10-22 12:12:49 +01:00
|
|
|
margin: 0;
|
2019-08-19 12:20:38 +01:00
|
|
|
font-size: 16px;
|
|
|
|
color: #F5F6FA;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-22 12:12:49 +01:00
|
|
|
&__name-area {
|
|
|
|
|
|
|
|
&__user-name {
|
|
|
|
margin: 0 0 0 20px;
|
|
|
|
font-size: 16px;
|
|
|
|
font-family: 'font_bold';
|
|
|
|
color: #354049;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__owner-status {
|
|
|
|
margin: 0 0 0 20px;
|
|
|
|
font-size: 13px;
|
|
|
|
color: #AFB7C1;
|
|
|
|
font-family: 'font_medium';
|
|
|
|
}
|
2019-08-19 12:20:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&__date {
|
|
|
|
width: 25%;
|
|
|
|
font-size: 16px;
|
|
|
|
color: #354049;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__user-email {
|
|
|
|
width: 25%;
|
|
|
|
font-size: 16px;
|
|
|
|
color: #354049;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.checkbox {
|
2019-10-23 13:26:39 +01:00
|
|
|
background-image: url("../../../static/images/team/checkboxEmpty.png");
|
2019-10-25 11:01:03 +01:00
|
|
|
margin-right: 20px;
|
2019-08-19 12:20:38 +01:00
|
|
|
min-width: 23px;
|
|
|
|
height: 23px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.user-container.selected {
|
|
|
|
background-color: #2683FF;
|
|
|
|
|
|
|
|
.checkbox {
|
|
|
|
min-width: 23px;
|
|
|
|
height: 23px;
|
2019-10-23 13:26:39 +01:00
|
|
|
background-image: url("../../../static/images/team/checkboxChecked.png");
|
2019-08-19 12:20:38 +01:00
|
|
|
}
|
|
|
|
|
2019-10-22 12:12:49 +01:00
|
|
|
.user-container__base-info__name-area__user-name,
|
|
|
|
.user-container__base-info__name-area__owner-status,
|
2019-09-26 14:36:12 +01:00
|
|
|
.user-container__date,
|
|
|
|
.user-container__user-email {
|
2019-08-19 12:20:38 +01:00
|
|
|
color: #FFFFFF;
|
|
|
|
}
|
|
|
|
}
|
2019-10-25 11:01:03 +01:00
|
|
|
|
|
|
|
.owner {
|
|
|
|
cursor: default;
|
|
|
|
}
|
2019-08-19 12:20:38 +01:00
|
|
|
</style>
|