From f79e489a0ada8c6781dd9f9b2d65ee04581ed83c Mon Sep 17 00:00:00 2001 From: Nithin David Thomas Date: Wed, 9 Jun 2021 14:01:43 +0530 Subject: [PATCH] chore: Use button component in ReplyBox Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> --- .../assets/scss/widgets/_buttons.scss | 60 +++++---- .../assets/scss/widgets/_reply-box.scss | 21 --- .../components/buttons/ResolveAction.vue | 6 +- .../dashboard/components/ui/WootButton.vue | 24 +++- .../widgets/WootWriter/ReplyBottomPanel.vue | 123 +++++++----------- .../contacts/components/ContactNote.vue | 16 +-- .../contacts/components/ReminderItem.vue | 6 +- 7 files changed, 117 insertions(+), 139 deletions(-) diff --git a/app/javascript/dashboard/assets/scss/widgets/_buttons.scss b/app/javascript/dashboard/assets/scss/widgets/_buttons.scss index 1d6b12631..edbef16bb 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_buttons.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_buttons.scss @@ -1,31 +1,24 @@ +$default-button-height: 4.0rem; + .button { align-items: center; display: inline-flex; - height: 4.0rem; + height: $default-button-height; margin-bottom: 0; - &.button--emoji { - align-items: center; - background: var(--b-50); - border: 1px solid var(--color-border-light); - border-radius: var(--border-radius-large); - display: flex; - font-size: var(--font-size-small); - height: var(--space-large); - justify-content: center; - padding: var(--space-micro); - text-align: center; - width: var(--space-large); - - &:hover { - background: var(--b-200); - } - } - .spinner { padding: 0 var(--space-small); } + .icon--emoji+.button__content { + padding-left: var(--space-small); + } + + .icon--font+.button__content { + padding-left: var(--space-small); + } + + // @TODDO - Remove after moving all buttons to woot-button .icon+.button__content { padding-left: var(--space-small); } @@ -48,23 +41,23 @@ // Smooth style &.smooth { - @include button-style(var(--w-100), var(--w-50), var(--w-700)); + @include button-style(var(--w-50), var(--w-100), var(--w-700)); &.secondary { - @include button-style(var(--s-100), var(--s-50), var(--s-700)); + @include button-style(var(--s-50), var(--s-100), var(--s-700)); } &.success { - @include button-style(var(--g-100), var(--g-50), var(--g-700)); + @include button-style(var(--g-50), var(--g-100), var(--g-700)); } &.alert { - @include button-style(var(--r-100), var(--r-50), var(--r-700)); + @include button-style(var(--r-50), var(--r-100), var(--r-700)); } &.warning { - @include button-style(var(--y-200), var(--y-100), var(--y-900)); + @include button-style(var(--y-100), var(--y-200), var(--y-900)); } } @@ -81,6 +74,25 @@ height: var(--space-larger); } + &.button--only-icon { + justify-content: center; + padding-left: 0; + padding-right: 0; + width: $default-button-height; + + &.tiny { + width: var(--space-medium); + } + + &.small { + width: var(--space-large); + } + + &.large { + width: var(--space-larger); + } + } + &.link { height: auto; margin: 0; diff --git a/app/javascript/dashboard/assets/scss/widgets/_reply-box.scss b/app/javascript/dashboard/assets/scss/widgets/_reply-box.scss index c09812527..8a53545fe 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_reply-box.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_reply-box.scss @@ -52,25 +52,4 @@ } } - .file-uploads>label { - cursor: pointer; - - &:hover .button--emoji { - background: var(--b-200); - } - } - - .bottom-box .button--emoji.button--upload { - padding: 0; - - .file-uploads { - height: 100%; - line-height: var(--space-large); - width: 100%; - } - - label { - padding: var(--space-small); - } - } } diff --git a/app/javascript/dashboard/components/buttons/ResolveAction.vue b/app/javascript/dashboard/components/buttons/ResolveAction.vue index 0343a20ff..5c429d237 100644 --- a/app/javascript/dashboard/components/buttons/ResolveAction.vue +++ b/app/javascript/dashboard/components/buttons/ResolveAction.vue @@ -6,6 +6,7 @@ class-names="resolve" color-scheme="success" icon="ion-checkmark" + emoji="✅" :is-loading="isLoading" @click="() => toggleStatus(STATUS_TYPE.RESOLVED)" > @@ -16,6 +17,7 @@ class-names="resolve" color-scheme="warning" icon="ion-refresh" + emoji="👀" :is-loading="isLoading" @click="() => toggleStatus(STATUS_TYPE.OPEN)" > @@ -36,9 +38,9 @@ :color-scheme="buttonClass" :disabled="isLoading" icon="ion-arrow-down-b" + emoji="🔽" @click="openDropdown" - > - + />
- + diff --git a/app/javascript/dashboard/routes/dashboard/contacts/components/ContactNote.vue b/app/javascript/dashboard/routes/dashboard/contacts/components/ContactNote.vue index f3e718464..fe0e30861 100644 --- a/app/javascript/dashboard/routes/dashboard/contacts/components/ContactNote.vue +++ b/app/javascript/dashboard/routes/dashboard/contacts/components/ContactNote.vue @@ -14,19 +14,17 @@
@@ -111,12 +109,12 @@ export default { .actions { display: flex; visibility: hidden; - } - .button--emoji { - margin-left: var(--space-small); - height: var(--space-medium); - width: var(--space-medium); + .button { + margin-left: var(--space-small); + height: var(--space-medium); + width: var(--space-medium); + } } } diff --git a/app/javascript/dashboard/routes/dashboard/contacts/components/ReminderItem.vue b/app/javascript/dashboard/routes/dashboard/contacts/components/ReminderItem.vue index 2fe47a66e..49755d1d2 100644 --- a/app/javascript/dashboard/routes/dashboard/contacts/components/ReminderItem.vue +++ b/app/javascript/dashboard/routes/dashboard/contacts/components/ReminderItem.vue @@ -23,20 +23,18 @@