Chore: Fixes icon size in button (#3555)

* Chore: Fixes icon size in button

* Changes normal button to woot button
This commit is contained in:
Nithin David Thomas 2021-12-14 17:37:25 +05:30 committed by GitHub
parent ac372f188d
commit c2191e48b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 87 additions and 71 deletions

View file

@ -66,6 +66,27 @@ $default-button-height: 4.0rem;
} }
} }
&.clear.button--only-icon:hover {
background: var(--w-50);
&.secondary {
background: var(--s-50);
}
&.success {
background: var(--g-50);
}
&.alert {
background: var(--r-50);
}
&.warning {
background: var(--y-100);
}
}
// Sizes // Sizes
&.tiny { &.tiny {
height: var(--space-medium); height: var(--space-medium);

View file

@ -13,9 +13,9 @@ l<template>
/> />
<woot-button <woot-button
v-else v-else
size="small"
variant="clear" variant="clear"
color-scheme="danger" color-scheme="alert"
class="btn-clear-filters"
@click="resetAndFetchData" @click="resetAndFetchData"
> >
{{ $t('FILTER.CLEAR_BUTTON_LABEL') }} {{ $t('FILTER.CLEAR_BUTTON_LABEL') }}
@ -24,10 +24,11 @@ l<template>
v-tooltip.top-end="$t('FILTER.TOOLTIP_LABEL')" v-tooltip.top-end="$t('FILTER.TOOLTIP_LABEL')"
variant="clear" variant="clear"
color-scheme="secondary" color-scheme="secondary"
icon="filter"
size="small"
class="btn-filter" class="btn-filter"
@click="onToggleAdvanceFiltersModal" @click="onToggleAdvanceFiltersModal"
> >
<fluent-icon icon="filter" />
</woot-button> </woot-button>
</div> </div>
</div> </div>
@ -405,16 +406,10 @@ export default {
.filter--actions { .filter--actions {
display: flex; display: flex;
align-items: center; align-items: center;
.btn-filter { }
cursor: pointer;
i { .btn-filter {
font-size: var(--font-size-two); margin: 0 var(--space-smaller);
}
}
.btn-clear-filters {
color: var(--r-500);
cursor: pointer;
}
} }
.filter__applied { .filter__applied {

View file

@ -7,7 +7,6 @@
color-scheme="success" color-scheme="success"
icon="checkmark" icon="checkmark"
emoji="✅" emoji="✅"
icon-size="16"
:is-loading="isLoading" :is-loading="isLoading"
@click="onCmdResolveConversation" @click="onCmdResolveConversation"
> >
@ -19,7 +18,6 @@
color-scheme="warning" color-scheme="warning"
icon="arrow-redo" icon="arrow-redo"
emoji="👀" emoji="👀"
icon-size="16"
:is-loading="isLoading" :is-loading="isLoading"
@click="onCmdOpenConversation" @click="onCmdOpenConversation"
> >
@ -30,7 +28,6 @@
class-names="resolve" class-names="resolve"
color-scheme="primary" color-scheme="primary"
icon="person" icon="person"
icon-size="16"
:is-loading="isLoading" :is-loading="isLoading"
@click="onCmdOpenConversation" @click="onCmdOpenConversation"
> >
@ -42,7 +39,6 @@
:color-scheme="buttonClass" :color-scheme="buttonClass"
:disabled="isLoading" :disabled="isLoading"
icon="chevron-down" icon="chevron-down"
icon-size="16"
emoji="🔽" emoji="🔽"
@click="openDropdown" @click="openDropdown"
/> />

View file

@ -40,7 +40,7 @@
:class="{ 'is-active': isActive }" :class="{ 'is-active': isActive }"
@click="e => newLinkClick(e, navigate)" @click="e => newLinkClick(e, navigate)"
> >
<fluent-icon icon="add" /> <fluent-icon icon="add" size="16" />
<span class="button__content"> <span class="button__content">
{{ $t(`SIDEBAR.${menuItem.newLinkTag}`) }} {{ $t(`SIDEBAR.${menuItem.newLinkTag}`) }}
</span> </span>

View file

@ -36,10 +36,6 @@ export default {
type: String, type: String,
default: '', default: '',
}, },
iconSize: {
type: [Number, String],
default: 20,
},
emoji: { emoji: {
type: String, type: String,
default: '', default: '',
@ -72,10 +68,12 @@ export default {
} }
return this.variant; return this.variant;
}, },
hasOnlyIconClasses() { hasOnlyIcon() {
const hasEmojiOrIcon = this.emoji || this.icon; const hasEmojiOrIcon = this.emoji || this.icon;
if (!this.$slots.default && hasEmojiOrIcon) return 'button--only-icon'; return !this.$slots.default && hasEmojiOrIcon;
return ''; },
hasOnlyIconClasses() {
return this.hasOnlyIcon ? 'button--only-icon' : '';
}, },
buttonClasses() { buttonClasses() {
return [ return [
@ -88,6 +86,41 @@ export default {
this.isExpanded ? 'expanded' : '', this.isExpanded ? 'expanded' : '',
]; ];
}, },
withTextIconSize() {
switch (this.size) {
case 'tiny':
return 12;
case 'small':
return 14;
case 'medium':
return 16;
case 'large':
return 18;
default:
return 16;
}
},
withoutTextIconSize() {
switch (this.size) {
case 'tiny':
return 14;
case 'small':
return 16;
case 'medium':
return 18;
case 'large':
return 20;
default:
return 18;
}
},
iconSize() {
return this.hasOnlyIcon
? this.withoutTextIconSize
: this.withTextIconSize;
},
}, },
methods: { methods: {
handleClick(evt) { handleClick(evt) {

View file

@ -8,7 +8,6 @@
color-scheme="secondary" color-scheme="secondary"
variant="smooth" variant="smooth"
size="small" size="small"
:icon-size="14"
@click="toggleEmojiPicker" @click="toggleEmojiPicker"
/> />
@ -27,7 +26,6 @@
:title="$t('CONVERSATION.REPLYBOX.TIP_ATTACH_ICON')" :title="$t('CONVERSATION.REPLYBOX.TIP_ATTACH_ICON')"
icon="attach" icon="attach"
emoji="📎" emoji="📎"
:icon-size="14"
color-scheme="secondary" color-scheme="secondary"
variant="smooth" variant="smooth"
size="small" size="small"
@ -37,7 +35,6 @@
v-if="enableRichEditor && !isOnPrivateNote" v-if="enableRichEditor && !isOnPrivateNote"
icon="quote" icon="quote"
emoji="🖊️" emoji="🖊️"
:icon-size="16"
color-scheme="secondary" color-scheme="secondary"
variant="smooth" variant="smooth"
size="small" size="small"

View file

@ -1,23 +1,23 @@
<template> <template>
<div class="top-box"> <div class="top-box">
<div class="mode-wrap button-group"> <div class="mode-wrap button-group">
<button <woot-button
class="button clear button--reply" variant="clear"
class="button--reply"
:class="replyButtonClass" :class="replyButtonClass"
@click="handleReplyClick" @click="handleReplyClick"
> >
<emoji-or-icon icon="" emoji="💬" />
{{ $t('CONVERSATION.REPLYBOX.REPLY') }} {{ $t('CONVERSATION.REPLYBOX.REPLY') }}
</button> </woot-button>
<button <woot-button
class="button clear button--note" class="button--note"
variant="clear"
:class="noteButtonClass" :class="noteButtonClass"
@click="handleNoteClick" @click="handleNoteClick"
> >
<emoji-or-icon icon="" emoji="📝" />
{{ $t('CONVERSATION.REPLYBOX.PRIVATE_NOTE') }} {{ $t('CONVERSATION.REPLYBOX.PRIVATE_NOTE') }}
</button> </woot-button>
</div> </div>
<div class="action-wrap"> <div class="action-wrap">
<div v-if="isMessageLengthReachingThreshold" class="tabs-title"> <div v-if="isMessageLengthReachingThreshold" class="tabs-title">
@ -29,7 +29,6 @@
<woot-button <woot-button
v-if="popoutReplyBox" v-if="popoutReplyBox"
variant="clear" variant="clear"
size="large"
icon="dismiss" icon="dismiss"
color-scheme="secondary" color-scheme="secondary"
class-names="popout-button" class-names="popout-button"
@ -38,7 +37,6 @@
<woot-button <woot-button
v-else v-else
variant="clear" variant="clear"
size="large"
icon="resize-large" icon="resize-large"
color-scheme="secondary" color-scheme="secondary"
class-names="popout-button" class-names="popout-button"
@ -49,7 +47,6 @@
<script> <script>
import { REPLY_EDITOR_MODES, CHAR_LENGTH_WARNING } from './constants'; import { REPLY_EDITOR_MODES, CHAR_LENGTH_WARNING } from './constants';
import EmojiOrIcon from 'shared/components/EmojiOrIcon';
import { import {
hasPressedAltAndPKey, hasPressedAltAndPKey,
hasPressedAltAndLKey, hasPressedAltAndLKey,
@ -57,9 +54,6 @@ import {
import eventListenerMixins from 'shared/mixins/eventListenerMixins'; import eventListenerMixins from 'shared/mixins/eventListenerMixins';
export default { export default {
name: 'ReplyTopPanel', name: 'ReplyTopPanel',
components: {
EmojiOrIcon,
},
mixins: [eventListenerMixins], mixins: [eventListenerMixins],
props: { props: {
mode: { mode: {
@ -189,11 +183,4 @@ export default {
color: var(--s-600); color: var(--s-600);
} }
} }
.popout-button {
display: flex;
justify-content: flex-end;
height: auto;
padding-right: var(--space-normal);
}
</style> </style>

View file

@ -22,7 +22,6 @@
<div class="filter-actions"> <div class="filter-actions">
<woot-button <woot-button
icon="add" icon="add"
icon-size="16"
color-scheme="success" color-scheme="success"
variant="smooth" variant="smooth"
size="small" size="small"

View file

@ -3,8 +3,7 @@
<woot-button <woot-button
v-if="!currentChat.muted" v-if="!currentChat.muted"
v-tooltip="$t('CONTACT_PANEL.MUTE_CONTACT')" v-tooltip="$t('CONTACT_PANEL.MUTE_CONTACT')"
variant="smooth" variant="clear"
size="small"
color-scheme="secondary" color-scheme="secondary"
icon="speaker-mute" icon="speaker-mute"
@click="mute" @click="mute"
@ -12,16 +11,14 @@
<woot-button <woot-button
v-else v-else
v-tooltip.left="$t('CONTACT_PANEL.UNMUTE_CONTACT')" v-tooltip.left="$t('CONTACT_PANEL.UNMUTE_CONTACT')"
variant="smooth" variant="clear"
size="small"
color-scheme="secondary" color-scheme="secondary"
icon="speaker-1" icon="speaker-1"
@click="unmute" @click="unmute"
/> />
<woot-button <woot-button
v-tooltip="$t('CONTACT_PANEL.SEND_TRANSCRIPT')" v-tooltip="$t('CONTACT_PANEL.SEND_TRANSCRIPT')"
variant="smooth" variant="clear"
size="small"
color-scheme="secondary" color-scheme="secondary"
icon="share" icon="share"
@click="toggleEmailActionsModal" @click="toggleEmailActionsModal"
@ -93,8 +90,8 @@ export default {
.actions--container { .actions--container {
align-items: center; align-items: center;
.button { .resolve-actions {
margin-right: var(--space-small); margin-left: var(--space-small);
} }
} }

View file

@ -19,7 +19,6 @@
variant="clear" variant="clear"
size="small" size="small"
icon="clipboard" icon="clipboard"
icon-size="16"
@click="handleCopy" @click="handleCopy"
> >
{{ $t('CONVERSATION.CONTEXT_MENU.COPY') }} {{ $t('CONVERSATION.CONTEXT_MENU.COPY') }}
@ -31,7 +30,6 @@
color-scheme="alert" color-scheme="alert"
size="small" size="small"
icon="delete" icon="delete"
icon-size="16"
@click="handleDelete" @click="handleDelete"
> >
{{ $t('CONVERSATION.CONTEXT_MENU.DELETE') }} {{ $t('CONVERSATION.CONTEXT_MENU.DELETE') }}

View file

@ -20,7 +20,6 @@
variant="smooth" variant="smooth"
size="tiny" size="tiny"
icon="delete" icon="delete"
icon-size="16"
color-scheme="secondary" color-scheme="secondary"
@click="onDelete" @click="onDelete"
/> />

View file

@ -9,7 +9,6 @@
<woot-button <woot-button
v-if="showSelfAssign" v-if="showSelfAssign"
icon="arrow-right" icon="arrow-right"
icon-size="14"
variant="link" variant="link"
size="small" size="small"
@click="onSelfAssign" @click="onSelfAssign"

View file

@ -63,8 +63,7 @@
title="$t('CONTACT_PANEL.NEW_MESSAGE')" title="$t('CONTACT_PANEL.NEW_MESSAGE')"
class="new-message" class="new-message"
icon="chat" icon="chat"
icon-size="14" size="small"
size="small expanded"
@click="toggleConversationModal" @click="toggleConversationModal"
/> />
<woot-button <woot-button
@ -72,9 +71,8 @@
title="$t('EDIT_CONTACT.BUTTON_LABEL')" title="$t('EDIT_CONTACT.BUTTON_LABEL')"
class="edit-contact" class="edit-contact"
icon="edit" icon="edit"
icon-size="14"
variant="smooth" variant="smooth"
size="small expanded" size="small"
@click="toggleEditModal" @click="toggleEditModal"
/> />
<woot-button <woot-button
@ -83,9 +81,8 @@
title="$t('CONTACT_PANEL.MERGE_CONTACT')" title="$t('CONTACT_PANEL.MERGE_CONTACT')"
class="merge-contact" class="merge-contact"
icon="merge" icon="merge"
icon-size="14"
variant="smooth" variant="smooth"
size="small expanded" size="small"
color-scheme="secondary" color-scheme="secondary"
:disabled="uiFlags.isMerging" :disabled="uiFlags.isMerging"
@click="openMergeModal" @click="openMergeModal"
@ -96,9 +93,8 @@
title="$t('DELETE_CONTACT.BUTTON_LABEL')" title="$t('DELETE_CONTACT.BUTTON_LABEL')"
class="delete-contact" class="delete-contact"
icon="delete" icon="delete"
icon-size="14"
variant="smooth" variant="smooth"
size="small expanded" size="small"
color-scheme="alert" color-scheme="alert"
:disabled="uiFlags.isDeleting" :disabled="uiFlags.isDeleting"
@click="toggleDeleteModal" @click="toggleDeleteModal"

View file

@ -13,7 +13,6 @@
variant="link" variant="link"
color-scheme="secondary" color-scheme="secondary"
icon="clipboard" icon="clipboard"
icon-size="14"
class-names="icon copy-icon" class-names="icon copy-icon"
@click="onCopy" @click="onCopy"
/> />