aboutsummaryrefslogtreecommitdiff
path: root/front-end/src/bootstrap/components/CookieWarning.vue
blob: 2651cd19a49a7125f5e94d33b73431e217d1c515 (plain)
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
<script setup lang="ts">
import { computed, toRefs } from 'vue'
import { useEnvSize } from '@vnuge/vnlib.browser'

const props = defineProps<{
  hidden?: boolean
}>()

const { hidden } = toRefs(props)
const { headerHeight } = useEnvSize()

const show = computed(() => (!window.navigator.cookieEnabled) && !hidden.value)
const style = computed(() => ({ top: headerHeight.value + 'px' }))

</script>
<template>
  <div v-if="show" class="fixed top-0 left-0 z-10 w-full" :style="style">
    <div class="flex w-full p-2 text-center text-white bg-blue-600">
      <div class="m-auto text-sm font-semibold md:text-base">
        You must have cookies enabled for this site to work properly
      </div>
    </div>
  </div>
</template>