Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions src/components/AppToolbarCentered.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
<v-row justify="center" no-gutters>
<container>
<v-toolbar ref="toolbar" :flat="flat" :height="height">
<v-btn v-if="showBack" icon size="small" @click="goBack">
<v-icon :icon="mdiArrowLeft" size="x-large" />
</v-btn>

<back-button v-if="showBack" @click="goBack" />
<v-toolbar-title v-if="title" class="a-text-regular-enlarged">
<div>{{ title }}</div>
<div v-if="subtitle" class="body-1">
Expand All @@ -21,8 +18,10 @@

<script>
import { mdiArrowLeft } from '@mdi/js'
import BackButton from '@/components/common/BackButton/BackButton.vue'

export default {
components: { BackButton },
props: {
title: {
type: String,
Expand Down Expand Up @@ -96,16 +95,6 @@ export default {
:deep(.v-toolbar-title:not(:first-child)) {
margin-inline-start: 0;
}

:deep(.v-toolbar__content > .v-btn:first-child) {
margin-inline-start: 4px;
}

:deep(.v-btn:hover) {
> .v-btn__overlay {
opacity: 0;
}
}
}

.app-toolbar--fixed {
Expand Down
21 changes: 4 additions & 17 deletions src/components/Chat/ChatToolbar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<v-toolbar flat height="56" :class="`${className}`" color="transparent">
<v-btn icon @click="goBack">
<back-button @click="goBack">
<v-badge
v-if="numOfNewMessages > 0"
:value="numOfNewMessages"
Expand All @@ -9,8 +9,7 @@
:content="numOfNewMessages > 99 ? '99+' : numOfNewMessages"
>
</v-badge>
<v-icon :icon="mdiArrowLeft" />
</v-btn>
</back-button>
<div v-if="!isWelcomeChat(partnerId)">
<slot name="avatar-toolbar" />
</div>
Expand Down Expand Up @@ -44,8 +43,10 @@
import partnerName from '@/mixins/partnerName'
import { isAdamantChat, isWelcomeChat } from '@/lib/chat/meta/utils'
import { mdiArrowLeft } from '@mdi/js'
import BackButton from '@/components/common/BackButton/BackButton.vue'

export default {
components: { BackButton },
mixins: [partnerName],
props: {
partnerId: {
Expand Down Expand Up @@ -140,13 +141,6 @@ export default {
}
}

:deep(.v-toolbar__content > .v-btn:first-child) {
width: 36px;
height: 36px;
margin: 0 12px;
border-radius: 50%;
}

:deep(.v-text-field) {
@include mixins.a-text-regular-enlarged-bold();

Expand Down Expand Up @@ -181,13 +175,6 @@ export default {
margin-bottom: 0;
}
}

:deep(.v-btn) {
&:hover > .v-btn__overlay {
opacity: 0.2;
transition: all 0.4s ease;
}
}
}

/** Themes **/
Expand Down
28 changes: 28 additions & 0 deletions src/components/common/BackButton/BackButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<v-btn :class="className" icon>
<slot />
<v-icon :icon="mdiArrowLeft" />
</v-btn>
</template>

<script setup lang="ts">
import { mdiArrowLeft } from '@mdi/js'

const className = 'back-button'
</script>

<style lang="scss">
.back-button {
&:first-child {
width: 36px;
height: 36px;
margin: 0 12px !important;
border-radius: 50%;
}

&:hover > .v-btn__overlay {
opacity: 0.2;
transition: all 0.4s ease;
}
}
</style>