(header) back button if app installed

This commit is contained in:
Julien Calixte
2019-11-28 23:05:40 +01:00
parent 87fab8f7c3
commit b5d3baaf24
7 changed files with 43 additions and 30 deletions

View File

@@ -20,6 +20,17 @@
</div>
</online-view>
</router-link>
<app-installed class="navbar-item">
<template v-slot:app-installed>
<a href="#" @click="back">
<img
class="back-icon"
src="./assets/icons/baseline_arrow_back_white_48dp.png"
alt="back"
/>
</a>
</template>
</app-installed>
<span class="vaquant-title" :class="{ visible: shadow }">{{
title
}}</span>
@@ -73,13 +84,15 @@ import { Action, Getter } from 'vuex-class'
import IUser from '@/models/IUser'
import { COFFEE_LINK } from '@/utils/constants'
import OnlineView from '@/components/OnlineView.vue'
import AppInstalled from '@/components/AppInstalled.vue'
@Component({
directives: {
ClickOutside
},
components: {
'online-view': OnlineView
'online-view': OnlineView,
'app-installed': AppInstalled
}
})
export default class App extends Vue {
@@ -114,6 +127,10 @@ export default class App extends Vue {
public hideMenu(): void {
this.menuOpen = false
}
public back(): void {
window.history.back()
}
}
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

View File

@@ -0,0 +1,21 @@
<template>
<span>
<slot v-if="isInstalled" name="app-installed"></slot>
<slot v-else name="app-not-installed"></slot>
</span>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
@Component
export default class AppInstalled extends Vue {
private isInstalled: boolean = false
private mounted() {
this.isInstalled =
window.matchMedia &&
window.matchMedia('(display-mode: standalone)').matches
}
}
</script>

View File

@@ -81,6 +81,10 @@ img {
width: 50px;
}
.back-icon {
vertical-align: middle;
}
.breadcrumb {
font-size: 16pt;
text-align: center;

View File

@@ -476,7 +476,6 @@ export default class AccountItem extends BaseAccount {
color: var(--primary-font-color);
}
.account-title {
margin: 10px 0;
span,
a {
padding: 0 10px;