-
Notifications
You must be signed in to change notification settings - Fork 10
/
Header.vue
52 lines (51 loc) · 1.45 KB
/
Header.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<template>
<header class="headerContainer absolute w-100 ph4 ph5-l pv5 pv5-l flex flex-row justify-between items-center z-1" :class="{ 'headerContainer--products-page': $route.name === 'products', clip: $route.name === 'cart-checkout' }">
<router-link to="/">
<div
class="logoContainer dim pointer w-70 w-85-l"
:class="[isThankYouPathname ? 'fill-cherry' : 'fill-near-white']"
>
<LogoSvg width="100%" height="auto"/>
</div>
</router-link>
<div class="flex" :class="{ 'scale-animation': cartAnimation }">
<router-link to="cart-checkout" class="flex flex-row items-center no-underline dim">
<div
class="cartIconContainer pointer"
:class="[isThankYouPathname ? 'fill-cherry' : 'fill-near-white']"
>
<CartIconSvg width="100%" height="100%"/>
</div>
<p class="medium-text f7"
:class="[isThankYouPathname ? 'cherry' : 'white']"
>
{{ cart ? cart.total_items : '0'}}
</p>
</router-link>
</div>
</header>
</template>
<script>
import LogoSvg from '../assets/logo.svg'
import CartIconSvg from '../assets/cart-icon.svg'
export default {
name: 'Header',
props: {
cart: {
required: true,
},
cartAnimation: {
required: true
}
},
components: {
LogoSvg,
CartIconSvg
},
computed: {
isThankYouPathname() {
return this.$route.name === 'thank-you';
}
}
}
</script>