diff --git a/assets/main.css b/assets/main.css index ad39aa5..68dd98d 100644 --- a/assets/main.css +++ b/assets/main.css @@ -2,7 +2,8 @@ @tailwind components; @tailwind utilities; -:root { +@layer base { + :root { --background: 0 0% 100%; --foreground: 222.2 84% 4.9%; @@ -35,7 +36,7 @@ --radius: 0.5rem; } - :root.dark { + .dark { --background: 222.2 84% 4.9%; --foreground: 210 40% 98%; @@ -64,6 +65,7 @@ --destructive-foreground: 210 40% 98%; --ring: 212.7 26.8% 83.9%; + } } @layer base { diff --git a/components.json b/components.json index be94b1d..3dc3dc9 100644 --- a/components.json +++ b/components.json @@ -2,6 +2,7 @@ "$schema": "https://shadcn-vue.com/schema.json", "style": "default", "typescript": true, + "tsConfigPath": ".nuxt/tsconfig.json", "tailwind": { "config": "tailwind.config.js", "css": "assets/main.css", diff --git a/components/calendar/CalendarEvent.vue b/components/calendar/CalendarEvent.vue index 8abdc39..96b530d 100644 --- a/components/calendar/CalendarEvent.vue +++ b/components/calendar/CalendarEvent.vue @@ -60,6 +60,7 @@ onMounted(() => { class="text-xs px-2 py-1 block w-full text-left rounded-sm focus-visible:bg-red-200" :class=" cn({ + 'italic': event.hidden, 'text-white bg-slate-600 hover:bg-slate-700': !event.category, 'text-white bg-lime-600 hover:bg-lime-700': event.category?.name === 'naissance', 'text-white bg-stone-500 hover:bg-stone-700': event.category?.name === 'mort', diff --git a/components/calendar/CalendarEventDetails.vue b/components/calendar/CalendarEventDetails.vue index 3ae0c96..27013ba 100644 --- a/components/calendar/CalendarEventDetails.vue +++ b/components/calendar/CalendarEventDetails.vue @@ -9,7 +9,8 @@ import { PhHourglassHigh, PhHourglassLow, PhMapPinArea, - PhDotsThreeOutlineVertical + PhDotsThreeOutlineVertical, + PhEye } from '@phosphor-icons/vue' const { defaultDate, getFormattedDateTitle, jumpToDate, getRelativeString } = useCalendar() @@ -189,6 +190,19 @@ function deployDeleteModal() { + + + + + + Évènement privé + + + + Cet évènement est uniquement visible pour vous + + + diff --git a/components/calendar/form/CreateEvent.vue b/components/calendar/form/CreateEvent.vue index 524121f..8fd6d42 100644 --- a/components/calendar/form/CreateEvent.vue +++ b/components/calendar/form/CreateEvent.vue @@ -1,7 +1,7 @@ + + + + + + diff --git a/components/ui/label/index.ts b/components/ui/label/index.ts new file mode 100644 index 0000000..572c2f0 --- /dev/null +++ b/components/ui/label/index.ts @@ -0,0 +1 @@ +export { default as Label } from './Label.vue' diff --git a/components/ui/switch/Switch.vue b/components/ui/switch/Switch.vue new file mode 100644 index 0000000..f2ee993 --- /dev/null +++ b/components/ui/switch/Switch.vue @@ -0,0 +1,37 @@ + + + + + + + diff --git a/components/ui/switch/index.ts b/components/ui/switch/index.ts new file mode 100644 index 0000000..87b4b17 --- /dev/null +++ b/components/ui/switch/index.ts @@ -0,0 +1 @@ +export { default as Switch } from './Switch.vue' diff --git a/models/CalendarEvent.ts b/models/CalendarEvent.ts index c59f2fe..a1e9be0 100644 --- a/models/CalendarEvent.ts +++ b/models/CalendarEvent.ts @@ -24,7 +24,8 @@ export const postEventBodySchema = z.object({ description: z.string().optional().nullable(), location: z.string().optional().nullable(), startDate: dateSchema.required(), - endDate: dateSchema.optional().nullable() + endDate: dateSchema.optional().nullable(), + hidden: z.boolean().optional().nullable() }), calendarId: z.number({ coerce: true }).int().positive() }) diff --git a/server/api/calendars/events/[id].patch.ts b/server/api/calendars/events/[id].patch.ts index bd0815b..6e3298f 100644 --- a/server/api/calendars/events/[id].patch.ts +++ b/server/api/calendars/events/[id].patch.ts @@ -41,6 +41,7 @@ export default defineEventHandler(async (event) => { title: bodyData?.event.title, description: bodyData.event.description, location: bodyData.event.location, + hidden: bodyData.event.hidden, calendar_id: bodyData?.calendarId } as never ) diff --git a/server/api/calendars/events/create.post.ts b/server/api/calendars/events/create.post.ts index c550ecb..9782b41 100644 --- a/server/api/calendars/events/create.post.ts +++ b/server/api/calendars/events/create.post.ts @@ -25,6 +25,7 @@ export default defineEventHandler(async (event) => { title: bodyData?.event.title, description: bodyData.event.description, location: bodyData.event.location, + hidden: bodyData.event.hidden, calendar_id: bodyData?.calendarId } as never )
Cet évènement est uniquement visible pour vous