From 2be97cf50a91f2d709a7f4520aa852d575566ce5 Mon Sep 17 00:00:00 2001 From: Nithin David <1277421+nithindavid@users.noreply.github.com> Date: Fri, 3 Dec 2021 20:46:49 +0530 Subject: [PATCH] Chore: Updates design of conversation list --- .../assets/scss/_foundation-custom.scss | 49 +++++ .../assets/scss/_foundation-settings.scss | 4 +- .../assets/scss/widgets/_buttons.scss | 4 + .../scss/widgets/_conversation-card.scss | 75 +------ .../scss/widgets/_conversation-view.scss | 5 - .../dashboard/assets/scss/widgets/_tabs.scss | 60 ++---- .../dashboard/components/ChatList.vue | 9 +- .../SecondaryChildNavItem.vue | 31 --- .../sidebarComponents/SecondaryNavItem.vue | 2 +- .../dashboard/components/ui/Tabs/TabsItem.vue | 31 ++- .../dashboard/components/ui/WootButton.vue | 5 + .../components/widgets/ChatTypeTabs.vue | 9 +- .../components/widgets/InboxName.vue | 10 +- .../widgets/conversation/ConversationCard.vue | 190 +++++++++++------- .../conversation/ConversationHeader.vue | 3 +- 15 files changed, 264 insertions(+), 223 deletions(-) diff --git a/app/javascript/dashboard/assets/scss/_foundation-custom.scss b/app/javascript/dashboard/assets/scss/_foundation-custom.scss index 1cfd002cf..f35b1e47f 100644 --- a/app/javascript/dashboard/assets/scss/_foundation-custom.scss +++ b/app/javascript/dashboard/assets/scss/_foundation-custom.scss @@ -55,11 +55,60 @@ code { padding-right: var(--space-normal); } +$badge-size: var(--space-normal); +$label-badge-size: var(--space-slab); .badge { + height: min-content; + line-height: 1; + font-weight: var(--font-weight-bold); border-radius: var(--border-radius-normal); + + &.small { + font-size: var(--font-size-nano); + min-width: var(--space-slab); + padding: var(--space-micro); + } + + &.rounded { + border-radius: var(--space-mega); + } + + + &.secondary { + min-width: unset; + background: var(--s-75); + color: var(--s-500); + font-weight: var(--font-weight-bold); + } } +.badge--label, +.badge--icon { + display: inline-flex; + border-radius: var(--border-radius-small); + margin-right: var(--space-smaller); + background: var(--s-100); +} + +.badge--icon { + align-items: center; + height: $badge-size; + justify-content: center; + min-width: $badge-size; + + .svg-icon { + color: inherit; + } +} + +.badge--label { + height: $label-badge-size; + min-width: $label-badge-size; + margin-left: var(--space-smaller); +} + + .padding-right-small { padding-right: var(--space-one); } diff --git a/app/javascript/dashboard/assets/scss/_foundation-settings.scss b/app/javascript/dashboard/assets/scss/_foundation-settings.scss index 13b7dfafd..08d72e80b 100644 --- a/app/javascript/dashboard/assets/scss/_foundation-settings.scss +++ b/app/javascript/dashboard/assets/scss/_foundation-settings.scss @@ -217,10 +217,10 @@ $accordionmenu-arrow-size: 6px; $badge-background: $primary-color; $badge-color: $white; -$badge-color-alt: $black; +$badge-color-alt: $color-body; $badge-palette: $foundation-palette; $badge-padding: var(--space-smaller); -$badge-minwidth: 2.1em; +$badge-minwidth: var(--space-normal); $badge-font-size: var(--font-size-nano); // 10. Breadcrumbs diff --git a/app/javascript/dashboard/assets/scss/widgets/_buttons.scss b/app/javascript/dashboard/assets/scss/widgets/_buttons.scss index 55c7bc3de..721f76b66 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_buttons.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_buttons.scss @@ -37,6 +37,10 @@ $default-button-height: 4.0rem; border-radius: $space-larger; } + &.not-rounded { + border-radius: 0; + } + // @TODO Use with link &.compact { diff --git a/app/javascript/dashboard/assets/scss/widgets/_conversation-card.scss b/app/javascript/dashboard/assets/scss/widgets/_conversation-card.scss index 0ad6dff38..062637707 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_conversation-card.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_conversation-card.scss @@ -13,48 +13,22 @@ .conversation { @include flex; @include flex-shrink; - @include padding(0 0 0 $space-normal); - border-bottom: 1px solid transparent; - border-left: $space-micro solid transparent; - border-top: 1px solid transparent; + padding: 0 var(--space-small); + margin: var(--space-small); + border-radius: var(--border-radius-large); cursor: pointer; position: relative; &.active { animation: left-shift-animation .25s $swift-ease-out-function; - background: $color-background; - border-bottom-color: $color-border-light; - border-left-color: $color-woot; - border-top-color: $color-border-light; - - .conversation--details { - border-top-color: transparent; - } - - +.conversation .conversation--details { - border-top-color: transparent; - } + background: var(--color-background); } - &:first-child { - .conversation--details { - border-top-color: transparent; - } - } - - &:last-child { - .conversation--details { - border-bottom-color: $color-border-light; - } - } .conversation--details { - @include margin(0 0 0 $space-one); - @include border-light-bottom; - @include border-light-top; - @include padding($space-slab 0); - border-bottom-color: transparent; + @include margin(0 0 0 $space-small); + @include padding($space-small 0); } .conversation--user { @@ -84,41 +58,8 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - width: 27rem; - } - - .conversation--meta { - @include flex; - flex-direction: column; - position: absolute; - right: $space-normal; - top: $space-normal; - - .unread { - $unread-size: $space-normal; - @include round-corner; - @include light-shadow; - background: darken($success-color, 3%); - color: $color-white; - display: none; - font-size: $font-size-micro; - font-weight: $font-weight-black; - height: $unread-size; - line-height: $unread-size; - margin-left: auto; - margin-top: $space-smaller; - min-width: $unread-size; - padding: 0 $space-smaller; - text-align: center; - } - - .timestamp { - color: $dark-gray; - font-size: $font-size-micro; - font-weight: $font-weight-normal; - line-height: $space-normal; - margin-left: auto; - } + width: auto; + flex-grow: 0; } &.unread-chat { diff --git a/app/javascript/dashboard/assets/scss/widgets/_conversation-view.scss b/app/javascript/dashboard/assets/scss/widgets/_conversation-view.scss index 39cf6ad54..96519300b 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_conversation-view.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_conversation-view.scss @@ -86,11 +86,6 @@ align-items: center; justify-content: space-between; - .page-title { - margin-bottom: $zero; - margin-left: $space-normal; - } - .status--filter { @include padding($zero null $zero $space-normal); @include margin($zero); diff --git a/app/javascript/dashboard/assets/scss/widgets/_tabs.scss b/app/javascript/dashboard/assets/scss/widgets/_tabs.scss index dbb68f6d5..f19511faa 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_tabs.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_tabs.scss @@ -6,22 +6,7 @@ border-top-width: 0; } -// Tab chat type -.tab--chat-type { - @include flex; - - .tabs-title { - a { - font-size: $font-size-default; - font-weight: $font-weight-medium; - padding-bottom: $space-slab; - padding-top: $space-slab; - } - } -} - .tabs-title { - @include margin($zero $space-slab); .badge { background: $color-background; @@ -33,36 +18,18 @@ padding: $space-smaller; } - &:first-child { - margin-left: 0; - } - - &:last-child { - margin-right: 0; - } - - &:hover, - &:focus { - a { - color: darken($medium-gray, 20%); - } - } - - a { + a, + .button { @include position(relative, 1px null null null); - align-items: center; border-bottom: 2px solid transparent; - color: $medium-gray; - display: flex; - flex-direction: row; - font-size: $font-size-small; transition: border-color .15s $swift-ease-out-function; } &.is-active { - a { + + a, + .button { border-bottom-color: $color-woot; - color: $color-woot; } .badge { @@ -70,4 +37,21 @@ color: $color-woot; } } + + // Sleek tabs + &.smooth { + + a, + .button { + border-bottom: 0; + top: 0; + } + + &.is-active { + .badge { + background: var(--s-100); + color: var(--s-600); + } + } + } } diff --git a/app/javascript/dashboard/components/ChatList.vue b/app/javascript/dashboard/components/ChatList.vue index b5053a292..2579422d9 100644 --- a/app/javascript/dashboard/components/ChatList.vue +++ b/app/javascript/dashboard/components/ChatList.vue @@ -2,7 +2,7 @@ l