elk/components/PWAPrompt.client.vue

32 lines
984 B
Vue
Raw Normal View History

<script setup>
import { usePWA } from '~/composables/pwa'
const { close, needRefresh, updateServiceWorker } = usePWA()
</script>
<!-- TODO: remove shadow on mobile and position it above the bottom nav -->
<template>
<div
v-if="needRefresh"
role="alertdialog"
aria-labelledby="pwa-toast-title"
aria-describedby="pwa-toast-description"
2022-12-23 18:05:48 +00:00
m-2 p5 bg="fade" relative
rounded-lg of-hidden
flex="~ col gap-3"
>
2022-12-23 18:05:48 +00:00
<h2 id="pwa-toast-title" 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="updateServiceWorker()">
{{ $t('pwa.update') }}
</button>
<button type="button" btn-text filter-saturate-0 px-4 py-1 text-center text-sm @click="close()">
{{ $t('pwa.dismiss') }}
</button>
</div>
2022-12-23 18:05:48 +00:00
<div i-ri-arrow-down-circle-line absolute text-8em bottom--10 right--10 text-primary op10 />
</div>
</template>