From 88fc4d894a5fc4864c5eb1f36898c9c7d9a6b779 Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Thu, 14 Nov 2019 13:46:43 +0530 Subject: [PATCH] Init Contact Panel (#206) --- .../assets/scss/widgets/_conv-header.scss | 14 ++++++ .../assets/scss/widgets/_thumbnail.scss | 2 + .../components/widgets/Thumbnail.vue | 11 +++++ .../widgets/conversation/ConversationBox.vue | 21 +++++++- .../conversation/ConversationHeader.vue | 32 +++++++++--- .../dashboard/conversation/ContactPanel.vue | 49 +++++++++++++++++++ .../conversation/ConversationView.vue | 20 +++++++- 7 files changed, 138 insertions(+), 11 deletions(-) create mode 100644 app/javascript/dashboard/routes/dashboard/conversation/ContactPanel.vue diff --git a/app/javascript/dashboard/assets/scss/widgets/_conv-header.scss b/app/javascript/dashboard/assets/scss/widgets/_conv-header.scss index d34df4d42..004a8236e 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_conv-header.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_conv-header.scss @@ -44,8 +44,22 @@ .user--name { @include margin(0); font-size: $font-size-medium; + } + + .user--profile__meta { + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: center; margin-left: $space-slab; } + + .user--profile__button { + color: $color-woot; + font-size: $font-size-mini; + margin-top: $space-micro; + cursor: pointer; + } } } diff --git a/app/javascript/dashboard/assets/scss/widgets/_thumbnail.scss b/app/javascript/dashboard/assets/scss/widgets/_thumbnail.scss index b025bb693..6a6533780 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_thumbnail.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_thumbnail.scss @@ -4,6 +4,8 @@ .user-thumbnail { border-radius: 50%; + height: 100%; + width: 100%; } .source-badge { diff --git a/app/javascript/dashboard/components/widgets/Thumbnail.vue b/app/javascript/dashboard/components/widgets/Thumbnail.vue index e833a1ae2..c45d9f9cb 100644 --- a/app/javascript/dashboard/components/widgets/Thumbnail.vue +++ b/app/javascript/dashboard/components/widgets/Thumbnail.vue @@ -13,12 +13,14 @@ class="user-thumbnail" background-color="#1f93ff" color="white" + :size="avatarSize" > @@ -58,6 +60,15 @@ export default { imgError: false, }; }, + computed: { + avatarSize() { + return Number(this.size.replace(/\D+/g, '')); + }, + badgeStyle() { + const badgeSize = `${this.avatarSize / 3}px`; + return { width: badgeSize, height: badgeSize }; + }, + }, methods: { onImgError() { this.imgError = true; diff --git a/app/javascript/dashboard/components/widgets/conversation/ConversationBox.vue b/app/javascript/dashboard/components/widgets/conversation/ConversationBox.vue index b1a0b047e..5d93ac9fa 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ConversationBox.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ConversationBox.vue @@ -1,7 +1,11 @@