Changed calendar layout for buttons
This commit is contained in:
2
app.vue
2
app.vue
@@ -37,7 +37,7 @@ const useIdFunction = () => useId()
|
||||
<div class="h-full grid grid-cols-[auto_1fr] dark:bg-black transition-colors">
|
||||
<Sidebar />
|
||||
|
||||
<div class="wrapper shadow-body-light dark:shadow-body-dark transition-all">
|
||||
<div class="wrapper max-h-screen shadow-body-light dark:shadow-body-dark transition-all">
|
||||
<NuxtPage />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { breakpointsTailwind, useBreakpoints } from "@vueuse/core"
|
||||
import { PhPlus } from "@phosphor-icons/vue";
|
||||
|
||||
const isDialogOpen = ref<boolean>(false);
|
||||
@@ -15,13 +16,21 @@ function toggleDialog() {
|
||||
function handleClosing() {
|
||||
setTimeout(() => resetSkeleton(), 100)
|
||||
}
|
||||
|
||||
const breakpoints = useBreakpoints(
|
||||
breakpointsTailwind
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UiButton @click="toggleDialog">
|
||||
<PhPlus size="18" weight="bold" />
|
||||
<UiButton
|
||||
class="max-md:fixed max-md:bottom-16 max-md:right-8 max-md:z-50 max-md:size-12 max-md:shadow"
|
||||
:size="breakpoints.lg.value ? 'default' : 'icon'"
|
||||
@click="toggleDialog"
|
||||
>
|
||||
<PhPlus :size="breakpoints.md.value ? 18 : 24" weight="bold" />
|
||||
|
||||
<strong class="font-semibold">
|
||||
<strong class="font-semibold max-lg:hidden">
|
||||
{{ $t("entity.calendar.event.newEvent") }}
|
||||
</strong>
|
||||
</UiButton>
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
<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>
|
||||
@@ -24,9 +29,14 @@ const { isReadOnly, defaultDate } = storeToRefs(useCalendar())
|
||||
|
||||
<menu class="flex items-center gap-2">
|
||||
<li>
|
||||
<UiButton search-slash @click="revealAdvancedSearch()">
|
||||
<UiButton
|
||||
:search-slash="breakpoints.lg.value"
|
||||
:size="breakpoints.lg.value ? 'default' : 'icon'"
|
||||
@click="revealAdvancedSearch()"
|
||||
>
|
||||
<PhMagnifyingGlass size="20" weight="light" />
|
||||
<span>
|
||||
|
||||
<span class="max-lg:hidden">
|
||||
{{ $t('entity.advancedSearch.title') }}
|
||||
</span>
|
||||
</UiButton>
|
||||
|
||||
@@ -149,8 +149,6 @@ const eventsNotDisplayed: ComputedRef<number> = computed<number>(() => eventsFo
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// .tile are the direct children of the grid
|
||||
// We need to get, between each element, a 1px solid line to separate them, for columns and rows
|
||||
.tile {
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
|
||||
@@ -6,6 +6,9 @@ const { currentDate, decrementViewMonth, incrementViewMonth } = useCalendar()
|
||||
const { currentMonthData } = storeToRefs(useCalendar())
|
||||
|
||||
function handleWheel(e: WheelEvent) {
|
||||
// Prevent scrolling
|
||||
e.preventDefault()
|
||||
|
||||
const isMovingUp = e.deltaY < 0
|
||||
if (isMovingUp) {
|
||||
moveCalendarLeft()
|
||||
@@ -24,7 +27,7 @@ const moveCalendarRight = useThrottleFn(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grid grid-cols-10" @wheel="handleWheel">
|
||||
<div class="grid grid-cols-5 md:grid-cols-7 lg:grid-cols-10" @wheel="handleWheel">
|
||||
<template v-if="currentMonthData">
|
||||
<CalendarStateMonthlyDayTile
|
||||
v-for="day in currentMonthData?.days"
|
||||
|
||||
Reference in New Issue
Block a user