Skip to content

Commit af965b4

Browse files
authored
Merge pull request #758 from Adamant-im/feat/ui-same-back-buttons
chore: use the same style for back button as it was in chat room
2 parents cbe2e69 + 36fbc47 commit af965b4

File tree

3 files changed

+35
-31
lines changed

3 files changed

+35
-31
lines changed

src/components/AppToolbarCentered.vue

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
<v-row justify="center" no-gutters>
44
<container>
55
<v-toolbar ref="toolbar" :flat="flat" :height="height">
6-
<v-btn v-if="showBack" icon size="small" @click="goBack">
7-
<v-icon :icon="mdiArrowLeft" size="x-large" />
8-
</v-btn>
9-
6+
<back-button v-if="showBack" @click="goBack" />
107
<v-toolbar-title v-if="title" class="a-text-regular-enlarged">
118
<div>{{ title }}</div>
129
<div v-if="subtitle" class="body-1">
@@ -21,8 +18,10 @@
2118

2219
<script>
2320
import { mdiArrowLeft } from '@mdi/js'
21+
import BackButton from '@/components/common/BackButton/BackButton.vue'
2422
2523
export default {
24+
components: { BackButton },
2625
props: {
2726
title: {
2827
type: String,
@@ -96,16 +95,6 @@ export default {
9695
:deep(.v-toolbar-title:not(:first-child)) {
9796
margin-inline-start: 0;
9897
}
99-
100-
:deep(.v-toolbar__content > .v-btn:first-child) {
101-
margin-inline-start: 4px;
102-
}
103-
104-
:deep(.v-btn:hover) {
105-
> .v-btn__overlay {
106-
opacity: 0;
107-
}
108-
}
10998
}
11099
111100
.app-toolbar--fixed {

src/components/Chat/ChatToolbar.vue

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<v-toolbar flat height="56" :class="`${className}`" color="transparent">
3-
<v-btn icon @click="goBack">
3+
<back-button @click="goBack">
44
<v-badge
55
v-if="numOfNewMessages > 0"
66
:value="numOfNewMessages"
@@ -9,8 +9,7 @@
99
:content="numOfNewMessages > 99 ? '99+' : numOfNewMessages"
1010
>
1111
</v-badge>
12-
<v-icon :icon="mdiArrowLeft" />
13-
</v-btn>
12+
</back-button>
1413
<div v-if="!isWelcomeChat(partnerId)">
1514
<slot name="avatar-toolbar" />
1615
</div>
@@ -44,8 +43,10 @@
4443
import partnerName from '@/mixins/partnerName'
4544
import { isAdamantChat, isWelcomeChat } from '@/lib/chat/meta/utils'
4645
import { mdiArrowLeft } from '@mdi/js'
46+
import BackButton from '@/components/common/BackButton/BackButton.vue'
4747
4848
export default {
49+
components: { BackButton },
4950
mixins: [partnerName],
5051
props: {
5152
partnerId: {
@@ -140,13 +141,6 @@ export default {
140141
}
141142
}
142143
143-
:deep(.v-toolbar__content > .v-btn:first-child) {
144-
width: 36px;
145-
height: 36px;
146-
margin: 0 12px;
147-
border-radius: 50%;
148-
}
149-
150144
:deep(.v-text-field) {
151145
@include mixins.a-text-regular-enlarged-bold();
152146
@@ -181,13 +175,6 @@ export default {
181175
margin-bottom: 0;
182176
}
183177
}
184-
185-
:deep(.v-btn) {
186-
&:hover > .v-btn__overlay {
187-
opacity: 0.2;
188-
transition: all 0.4s ease;
189-
}
190-
}
191178
}
192179
193180
/** Themes **/
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<template>
2+
<v-btn :class="className" icon>
3+
<slot />
4+
<v-icon :icon="mdiArrowLeft" />
5+
</v-btn>
6+
</template>
7+
8+
<script setup lang="ts">
9+
import { mdiArrowLeft } from '@mdi/js'
10+
11+
const className = 'back-button'
12+
</script>
13+
14+
<style lang="scss">
15+
.back-button {
16+
&:first-child {
17+
width: 36px;
18+
height: 36px;
19+
margin: 0 12px !important;
20+
border-radius: 50%;
21+
}
22+
23+
&:hover > .v-btn__overlay {
24+
opacity: 0.2;
25+
transition: all 0.4s ease;
26+
}
27+
}
28+
</style>

0 commit comments

Comments
 (0)