feat: update banner design [CW-1491] (#7296)
* refactor: banner styling * refactor: update button style for reply assign banner * feat: remove update-banner classes --------- Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
This commit is contained in:
@@ -115,11 +115,6 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import './assets/scss/app';
|
@import './assets/scss/app';
|
||||||
.update-banner {
|
|
||||||
height: var(--space-larger);
|
|
||||||
align-items: center;
|
|
||||||
font-size: var(--font-size-small) !important;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
|
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<banner
|
<banner
|
||||||
v-if="shouldShowBanner"
|
v-if="shouldShowBanner"
|
||||||
class="update-banner"
|
|
||||||
color-scheme="primary"
|
color-scheme="primary"
|
||||||
:banner-message="bannerMessage"
|
:banner-message="bannerMessage"
|
||||||
href-link="https://github.com/chatwoot/chatwoot/releases"
|
href-link="https://github.com/chatwoot/chatwoot/releases"
|
||||||
|
|||||||
@@ -11,11 +11,12 @@
|
|||||||
{{ hrefLinkText }}
|
{{ hrefLinkText }}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
<div class="actions">
|
||||||
<woot-button
|
<woot-button
|
||||||
v-if="hasActionButton"
|
v-if="hasActionButton"
|
||||||
size="small"
|
size="tiny"
|
||||||
variant="link"
|
|
||||||
icon="arrow-right"
|
icon="arrow-right"
|
||||||
|
:variant="actionButtonVariant"
|
||||||
color-scheme="primary"
|
color-scheme="primary"
|
||||||
class-names="banner-action__button"
|
class-names="banner-action__button"
|
||||||
@click="onClick"
|
@click="onClick"
|
||||||
@@ -24,13 +25,15 @@
|
|||||||
</woot-button>
|
</woot-button>
|
||||||
<woot-button
|
<woot-button
|
||||||
v-if="hasCloseButton"
|
v-if="hasCloseButton"
|
||||||
size="small"
|
size="tiny"
|
||||||
variant="link"
|
:color-scheme="colorScheme"
|
||||||
color-scheme="secondary"
|
|
||||||
icon="dismiss-circle"
|
icon="dismiss-circle"
|
||||||
class-names="banner-action__button"
|
class-names="banner-action__button"
|
||||||
@click="onClickClose"
|
@click="onClickClose"
|
||||||
/>
|
>
|
||||||
|
{{ $t('GENERAL_SETTINGS.DISMISS') }}
|
||||||
|
</woot-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -53,6 +56,10 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
actionButtonVariant: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
actionButtonLabel: {
|
actionButtonLabel: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
@@ -68,7 +75,12 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
bannerClasses() {
|
bannerClasses() {
|
||||||
return [this.colorScheme];
|
const classList = [this.colorScheme, `banner-align-${this.align}`];
|
||||||
|
|
||||||
|
if (this.hasActionButton || this.hasCloseButton) {
|
||||||
|
classList.push('has-button');
|
||||||
|
}
|
||||||
|
return classList;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -84,17 +96,26 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.banner {
|
.banner {
|
||||||
|
--x-padding: var(--space-normal);
|
||||||
|
--y-padding: var(--space-slab);
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
gap: var(--x-padding);
|
||||||
color: var(--white);
|
color: var(--white);
|
||||||
font-size: var(--font-size-mini);
|
font-size: var(--font-size-mini);
|
||||||
padding: var(--space-slab) var(--space-normal);
|
padding: var(--y-padding) var(--x-padding);
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
position: sticky;
|
|
||||||
|
|
||||||
&.primary {
|
&.primary {
|
||||||
background: var(--w-500);
|
background: var(--w-500);
|
||||||
.banner-action__button {
|
.banner-action__button {
|
||||||
|
background: var(--w-600);
|
||||||
|
border: none;
|
||||||
color: var(--white);
|
color: var(--white);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: var(--w-800);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +128,16 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.alert {
|
&.alert {
|
||||||
background: var(--r-400);
|
background: var(--r-500);
|
||||||
|
.banner-action__button {
|
||||||
|
background: var(--r-700);
|
||||||
|
border: none;
|
||||||
|
color: var(--white);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: var(--r-800);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.warning {
|
&.warning {
|
||||||
@@ -133,8 +163,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.banner-action__button {
|
.banner-action__button {
|
||||||
margin: 0 var(--space-smaller);
|
|
||||||
|
|
||||||
::v-deep .button__content {
|
::v-deep .button__content {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
@@ -144,5 +172,11 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
display: flex;
|
||||||
|
gap: var(--space-smaller);
|
||||||
|
right: var(--y-padding);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<div class="reply-box" :class="replyBoxClass">
|
<div class="reply-box" :class="replyBoxClass">
|
||||||
<banner
|
<banner
|
||||||
v-if="showSelfAssignBanner"
|
v-if="showSelfAssignBanner"
|
||||||
|
action-button-variant="link"
|
||||||
color-scheme="secondary"
|
color-scheme="secondary"
|
||||||
:banner-message="$t('CONVERSATION.NOT_ASSIGNED_TO_YOU')"
|
:banner-message="$t('CONVERSATION.NOT_ASSIGNED_TO_YOU')"
|
||||||
:has-action-button="true"
|
:has-action-button="true"
|
||||||
|
|||||||
Reference in New Issue
Block a user