fix: Uses label component for add label button (#2337)

* fix: Uses label component for add label button

* Use button instead of span
This commit is contained in:
Nithin David Thomas 2021-05-27 08:24:29 +05:30 committed by GitHub
parent 9ffdb0ec70
commit 9c555e70c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 17 deletions

View file

@ -52,7 +52,11 @@ export default {
}, },
labelStyle() { labelStyle() {
if (this.bgColor) { if (this.bgColor) {
return { background: this.bgColor, color: this.textColor }; return {
background: this.bgColor,
color: this.textColor,
border: `1px solid ${this.bgColor}`,
};
} }
return {}; return {};
}, },

View file

@ -1,20 +1,17 @@
<template> <template>
<woot-button <woot-button variant="link" class="label--add" @click="addLabel">
variant="hollow" <woot-label
size="tiny"
icon="ion-plus-round"
color-scheme="secondary" color-scheme="secondary"
class-names="button-wrap" :title="$t('CONTACT_PANEL.LABELS.MODAL.ADD_BUTTON')"
@click="toggleLabels" icon="ion-plus-round"
> />
{{ $t('CONTACT_PANEL.LABELS.MODAL.ADD_BUTTON') }}
</woot-button> </woot-button>
</template> </template>
<script> <script>
export default { export default {
methods: { methods: {
toggleLabels() { addLabel() {
this.$emit('add'); this.$emit('add');
}, },
}, },
@ -22,13 +19,16 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.button-wrap { .label--add {
padding: var(--space-micro) var(--space-small); &::v-deep .label {
display: inline; cursor: pointer;
line-height: 1.2; background: transparent;
border-color: var(--s-700);
margin: 0;
&::v-deep .icon { &:hover {
font-size: var(--font-size-mini); background: var(--s-50);
}
} }
} }
</style> </style>