Compare commits

..

1 commit

Author SHA1 Message Date
746a243dc3 feat(calendar): add calendar to home page
Some checks failed
container-scan / Container Scan (pull_request) Failing after 7m31s
docker-build / docker (pull_request) Failing after 8m49s
tests / Tests (pull_request) Failing after 5m51s
2025-06-26 11:06:03 +02:00
3 changed files with 4 additions and 20 deletions

View file

@ -8,10 +8,7 @@ export default function Home() {
return (
<div className='max-h-full'>
<Calendar
userId={data?.data.user?.id}
height='calc(100svh - 50px - (var(--spacing) * 2 * 5))'
/>
<Calendar userId={data?.data.user?.id} height='calc(100svh - 50px - (var(--spacing) * 2 * 5))' />
</div>
);
}

View file

@ -219,8 +219,7 @@ export const GET = auth(async function GET(req, { params }) {
success: true,
calendar: calendar.filter(
(event, index, self) =>
self.findIndex((e) => e.id === event.id && e.type === event.type) ===
index,
self.findIndex((e) => e.id === event.id && e.type === event.type) === index,
),
});
});

View file

@ -41,13 +41,7 @@ const DaDRBCalendar = withDragAndDrop<
const localizer = momentLocalizer(moment);
export default function Calendar({
userId,
height,
}: {
userId?: string;
height: string;
}) {
export default function Calendar({ userId, height }: { userId?: string; height: string }) {
return (
<QueryErrorResetBoundary>
{({ reset }) => (
@ -78,13 +72,7 @@ export default function Calendar({
);
}
function CalendarWithUserEvents({
userId,
height,
}: {
userId: string;
height: string;
}) {
function CalendarWithUserEvents({ userId, height }: { userId: string; height: string }) {
const sesstion = useSession();
const [currentView, setCurrentView] = React.useState<
'month' | 'week' | 'day' | 'agenda' | 'work_week'