feat: add offline check (#247)

Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
This commit is contained in:
Alex 2022-12-01 11:08:09 +08:00 committed by GitHub
parent 93d78d9c8b
commit 96775ebcf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 6 deletions

View file

@ -0,0 +1,17 @@
<script setup lang="ts">
defineProps<{
smallScreen: boolean
}>()
const online = useOnline()
</script>
<template>
<div
v-if="!online"
w-full min-h-30px px4 py3 text-primary bg-base
border="t base" flex="~ gap-2 center"
>
<div i-ri:wifi-off-line />
{{ $t('common.offline_desc') }}
</div>
</template>

View file

@ -3,7 +3,7 @@
</script>
<template>
<nav h-14 fixed bottom-0 left-0 right-0 z-10 border="t base" bg-base flex flex-row>
<nav h-14 border="t base" flex flex-row>
<template v-if="currentUser">
<NuxtLink to="/home" active-class="text-primary" flex flex-row items-center place-content-center h-full flex-1 @click="$scrollToTop">
<div i-ri:home-5-line />