ui: update button for mobile

This commit is contained in:
Anthony Fu 2022-12-23 19:26:28 +01:00
parent 589cf463bd
commit cd268c9bc7
6 changed files with 28 additions and 13 deletions

View file

@ -0,0 +1,17 @@
<script setup>
import { pwa } from '~/composables/pwa'
</script>
<template>
<button
v-if="pwa.needRefresh"
bg="fade" relative rounded
flex="~ gap-1 center" px3 py1 text-primary
@click="pwa.updateServiceWorker()"
>
<div i-ri-download-cloud-2-line />
<h2 flex="~ gap-2" items-center>
{{ $t('pwa.update_available_short') }}
</h2>
</button>
</template>

View file

@ -0,0 +1,25 @@
<script setup>
import { pwa } from '~/composables/pwa'
</script>
<template>
<div
v-if="pwa.needRefresh"
m-2 p5 bg="fade" relative
rounded-lg of-hidden
flex="~ col gap-3"
>
<h2 flex="~ gap-2" items-center>
{{ $t('pwa.title') }}
</h2>
<div flex="~ gap-1">
<button type="button" btn-solid px-4 py-1 text-center text-sm @click="pwa.updateServiceWorker()">
{{ $t('pwa.update') }}
</button>
<button type="button" btn-text filter-saturate-0 px-4 py-1 text-center text-sm @click="pwa.close()">
{{ $t('pwa.dismiss') }}
</button>
</div>
<div i-ri-arrow-down-circle-line absolute text-8em bottom--10 right--10 text-primary op10 />
</div>
</template>