Changed today CTA on mobile
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed } from "vue"
|
||||
import { breakpointsTailwind, useBreakpoints } from "@vueuse/core"
|
||||
import { PhCalendar } from "@phosphor-icons/vue"
|
||||
|
||||
const { defaultDate, jumpToDefaultDate, getFormattedDateTitle, currentDate } = useCalendar()
|
||||
|
||||
@@ -8,15 +9,29 @@ const defaultDateFormatted: string = getFormattedDateTitle(defaultDate, true)
|
||||
const buttonDisabledState: ComputedRef<boolean> = computed<boolean>(() => {
|
||||
return currentDate.currentMonth === defaultDate.month && currentDate.currentYear === defaultDate.year
|
||||
})
|
||||
|
||||
const breakpoints = useBreakpoints(
|
||||
breakpointsTailwind
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UiTooltipProvider :delay-duration="250">
|
||||
<UiTooltip>
|
||||
<UiTooltipTrigger as-child>
|
||||
<UiButton size="sm" variant="secondary" :disabled="buttonDisabledState" @click="jumpToDefaultDate">
|
||||
{{ $t('entity.calendar.date.today') }}
|
||||
</UiButton>
|
||||
<ClientOnly>
|
||||
<UiButton
|
||||
:size="breakpoints.md.value ? 'default' : 'icon'"
|
||||
variant="secondary"
|
||||
:disabled="buttonDisabledState" @click="jumpToDefaultDate"
|
||||
>
|
||||
<PhCalendar v-if="!breakpoints.md.value" size="20" weight="fill" />
|
||||
|
||||
<span v-if="breakpoints.md.value">
|
||||
{{ $t('entity.calendar.date.today') }}
|
||||
</span>
|
||||
</UiButton>
|
||||
</ClientOnly>
|
||||
</UiTooltipTrigger>
|
||||
<UiTooltipContent>
|
||||
<p>{{ defaultDateFormatted }}</p>
|
||||
|
||||
Reference in New Issue
Block a user