Fixed hydration mismatches
This commit is contained in:
26
components/calendar/SearchCTA.vue
Normal file
26
components/calendar/SearchCTA.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<script lang="ts" setup>
|
||||
import { breakpointsTailwind, useBreakpoints } from "@vueuse/core"
|
||||
import { PhMagnifyingGlass } from "@phosphor-icons/vue"
|
||||
|
||||
const { revealAdvancedSearch, } = useCalendar()
|
||||
|
||||
const breakpoints = useBreakpoints(
|
||||
breakpointsTailwind
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ClientOnly>
|
||||
<UiButton
|
||||
:search-slash="breakpoints.lg.value"
|
||||
:size="breakpoints.lg.value ? 'default' : 'icon'"
|
||||
@click="revealAdvancedSearch()"
|
||||
>
|
||||
<PhMagnifyingGlass size="20" weight="light" />
|
||||
|
||||
<span class="max-lg:hidden">
|
||||
{{ $t('entity.advancedSearch.title') }}
|
||||
</span>
|
||||
</UiButton>
|
||||
</ClientOnly>
|
||||
</template>
|
||||
@@ -23,17 +23,19 @@ const breakpoints = useBreakpoints(
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UiButton
|
||||
class="max-md:fixed max-md:bottom-8 max-md:right-8 max-md:z-50 max-md:size-14 max-md:rounded-xl"
|
||||
:size="breakpoints.lg.value ? 'default' : 'icon'"
|
||||
@click="toggleDialog"
|
||||
>
|
||||
<PhPlus :size="breakpoints.md.value ? 18 : 24" weight="bold" />
|
||||
<ClientOnly>
|
||||
<UiButton
|
||||
class="max-md:fixed max-md:bottom-8 max-md:right-8 max-md:z-50 max-md:size-14 max-md:rounded-xl"
|
||||
:size="breakpoints.lg.value ? 'default' : 'icon'"
|
||||
@click="toggleDialog"
|
||||
>
|
||||
<PhPlus :size="breakpoints.md.value ? 18 : 24" weight="bold" />
|
||||
|
||||
<strong class="font-semibold max-lg:hidden">
|
||||
{{ $t("entity.calendar.event.newEvent") }}
|
||||
</strong>
|
||||
</UiButton>
|
||||
<strong class="font-semibold max-lg:hidden">
|
||||
{{ $t("entity.calendar.event.newEvent") }}
|
||||
</strong>
|
||||
</UiButton>
|
||||
</ClientOnly>
|
||||
|
||||
<UiDialog v-model:open="isDialogOpen">
|
||||
<UiDialogContent
|
||||
|
||||
@@ -1,15 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { breakpointsTailwind, useBreakpoints } from "@vueuse/core"
|
||||
import { useCalendar } from "~/stores/CalendarStore"
|
||||
|
||||
import { PhMagnifyingGlass } from "@phosphor-icons/vue"
|
||||
|
||||
const { revealAdvancedSearch, } = useCalendar()
|
||||
const { isReadOnly, defaultDate } = storeToRefs(useCalendar())
|
||||
|
||||
const breakpoints = useBreakpoints(
|
||||
breakpointsTailwind
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -29,17 +21,7 @@ const breakpoints = useBreakpoints(
|
||||
|
||||
<menu class="flex items-center gap-2">
|
||||
<li>
|
||||
<UiButton
|
||||
:search-slash="breakpoints.lg.value"
|
||||
:size="breakpoints.lg.value ? 'default' : 'icon'"
|
||||
@click="revealAdvancedSearch()"
|
||||
>
|
||||
<PhMagnifyingGlass size="20" weight="light" />
|
||||
|
||||
<span class="max-lg:hidden">
|
||||
{{ $t('entity.advancedSearch.title') }}
|
||||
</span>
|
||||
</UiButton>
|
||||
<CalendarSearchCTA />
|
||||
</li>
|
||||
<li>
|
||||
<CalendarCategoriesCTA />
|
||||
|
||||
Reference in New Issue
Block a user