Skip to content

Commit bd2acec

Browse files
committedJan 24, 2023
fix: dark theme notification slot color issues
1 parent 31419ae commit bd2acec

File tree

1 file changed

+39
-61
lines changed

1 file changed

+39
-61
lines changed
 

‎src/components/MewNotification/MewNotification.vue

+39-61
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,24 @@
1818
class="px-2 py-0"
1919
:color="backgroundColor"
2020
>
21-
<v-container
22-
fluid
23-
class="px-0"
24-
>
21+
<v-container fluid class="px-0">
2522
<v-row dense>
26-
<v-col
27-
class="d-flex align-center"
28-
cols="8"
29-
>
23+
<v-col class="d-flex align-center" cols="8">
3024
<!-- ===================================================================================== -->
3125
<!-- Displays indicator if notification not read -->
3226
<!-- ===================================================================================== -->
3327
<div
3428
v-if="
3529
$vuetify.breakpoint.smAndUp &&
36-
!notification.read &&
37-
showIndicator
30+
!notification.read &&
31+
showIndicator
3832
"
3933
:class="[
4034
getClasses(notification.status.value.toLowerCase()),
4135
'indicator',
4236
'ml-2',
4337
'd-none',
44-
'd-sm-flex',
38+
'd-sm-flex'
4539
]"
4640
/>
4741

@@ -59,10 +53,7 @@
5953
<!-- ===================================================================================== -->
6054
<!-- Displays swap icons if it is a swap notification -->
6155
<!-- ===================================================================================== -->
62-
<div
63-
v-else
64-
class="d-flex flex-column currency-symbol ml-2"
65-
>
56+
<div v-else class="d-flex flex-column currency-symbol ml-2">
6657
<MewTokenContainer
6758
:img="
6859
notification.fromObj.icon
@@ -130,10 +121,7 @@
130121
</div>
131122
</div>
132123
</v-col>
133-
<v-col
134-
cols="4"
135-
class="text-right pr-2"
136-
>
124+
<v-col cols="4" class="text-right pr-2">
137125
<mew-badge
138126
:badge-title="notification.type.string"
139127
:badge-type="getBadgeType"
@@ -148,20 +136,11 @@
148136
</v-container>
149137
</v-expansion-panel-header>
150138

151-
<v-expansion-panel-content
152-
class="pa-0"
153-
:color="backgroundColor"
154-
>
139+
<v-expansion-panel-content class="pa-0" :color="backgroundColor">
155140
<div class="expanded-container capitalize">
156141
<v-container>
157-
<v-row
158-
v-for="(detail, idx) in getDetails"
159-
:key="idx"
160-
>
161-
<v-col
162-
cols="6"
163-
class="textPrimary--text"
164-
>
142+
<v-row v-for="(detail, idx) in getDetails" :key="idx">
143+
<v-col cols="6" class="textPrimary--text">
165144
{{ detail.string }}:
166145
</v-col>
167146
<v-col
@@ -183,11 +162,7 @@
183162
hide-icon
184163
>
185164
<template #activatorSlot="{ on }">
186-
<a
187-
:href="detail.link"
188-
target="_blank"
189-
v-on="on"
190-
>
165+
<a :href="detail.link" target="_blank" v-on="on">
191166
<mew-transform-hash :hash="detail.value" />
192167
</a>
193168
</template>
@@ -221,7 +196,7 @@ export default {
221196
MewBadge,
222197
MewBlockie,
223198
MewTransformHash,
224-
MewTooltip,
199+
MewTooltip
225200
},
226201
props: {
227202
/**
@@ -240,78 +215,78 @@ export default {
240215
return {
241216
txHash: {
242217
value: '',
243-
string: '',
218+
string: ''
244219
},
245220
gasPrice: {
246221
value: '',
247-
string: '',
222+
string: ''
248223
},
249224
gasLimit: {
250225
value: '',
251-
string: '',
226+
string: ''
252227
},
253228
total: {
254229
value: '',
255-
string: '',
230+
string: ''
256231
},
257232
from: {
258233
value: '',
259-
string: '',
234+
string: ''
260235
},
261236
to: {
262237
value: '',
263-
string: '',
238+
string: ''
264239
},
265240
amount: {
266241
value: '',
267-
string: '',
242+
string: ''
268243
},
269244
timestamp: {
270245
value: '',
271-
string: '',
246+
string: ''
272247
},
273248
status: {
274249
value: '',
275-
string: '',
250+
string: ''
276251
},
277252
type: {
278253
value: '',
279-
string: '',
254+
string: ''
280255
},
281256
fromObj: {
282257
currency: '',
283258
amount: '',
284-
icon: '',
259+
icon: ''
285260
},
286261
toObj: {
287262
currency: '',
288263
amount: '',
289264
icon: '',
290-
to: '',
265+
to: ''
291266
},
292-
read: false,
267+
read: false
293268
};
294-
},
269+
}
295270
},
296271
showIndicator: {
297272
type: Boolean,
298-
default: true,
299-
},
273+
default: true
274+
}
300275
},
301276
data() {
302277
return {
303278
ethTokenPlaceholder: ethTokenPlaceholder,
304279
txTypes: {
305280
in: 'txIn',
306281
out: 'txOut',
307-
swap: 'swap',
282+
swap: 'swap'
308283
},
309284
txStatusOptions: {
310285
success: 'success',
311286
pending: 'pending',
312-
failed: 'failed',
287+
failed: 'failed'
313288
},
314-
hashType: 'Transaction Hash',
289+
hashType: 'Transaction Hash'
315290
};
316291
},
317292
computed: {
@@ -326,13 +301,16 @@ export default {
326301
: this.notification.toObj.amount;
327302
},
328303
backgroundColor() {
304+
if (this.$vuetify.theme.dark) {
305+
return 'buttonGrayLight';
306+
}
329307
if (this.notification.status.value == this.txStatusOptions.pending) {
330308
return 'warning';
331309
}
332310
if (this.notification.status.value == this.txStatusOptions.failed) {
333311
return 'error lighten-1';
334312
}
335-
return 'superPrimary';
313+
return 'buttonGrayLight';
336314
},
337315
getBadgeType() {
338316
const type = this.notification.type.value.toLowerCase();
@@ -346,7 +324,7 @@ export default {
346324
'gasLimit',
347325
'total',
348326
'timestamp',
349-
'status',
327+
'status'
350328
];
351329
for (const key in this.notification) {
352330
if (detailTypes.indexOf(key) >= 0) {
@@ -357,7 +335,7 @@ export default {
357335
},
358336
isSwap() {
359337
return this.notification.type.value.toLowerCase() === this.txTypes.swap;
360-
},
338+
}
361339
},
362340
methods: {
363341
isHash(type) {
@@ -393,8 +371,8 @@ export default {
393371
}
394372
return 'failed-type';
395373
}
396-
},
397-
},
374+
}
375+
}
398376
};
399377
</script>
400378