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

@ -36,10 +36,6 @@ export default {
type: String,
default: '',
},
iconSize: {
type: [Number, String],
default: 20,
},
emoji: {
type: String,
default: '',
@ -72,10 +68,12 @@ export default {
}
return this.variant;
},
hasOnlyIconClasses() {
hasOnlyIcon() {
const hasEmojiOrIcon = this.emoji || this.icon;
if (!this.$slots.default && hasEmojiOrIcon) return 'button--only-icon';
return '';
return !this.$slots.default && hasEmojiOrIcon;
},
hasOnlyIconClasses() {
return this.hasOnlyIcon ? 'button--only-icon' : '';
},
buttonClasses() {
return [
@ -88,6 +86,41 @@ export default {
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: {
handleClick(evt) {