Compare commits
1 commit
e0d57329c9
...
746a243dc3
Author | SHA1 | Date | |
---|---|---|---|
746a243dc3 |
3 changed files with 4 additions and 20 deletions
|
@ -8,10 +8,7 @@ export default function Home() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='max-h-full'>
|
<div className='max-h-full'>
|
||||||
<Calendar
|
<Calendar userId={data?.data.user?.id} height='calc(100svh - 50px - (var(--spacing) * 2 * 5))' />
|
||||||
userId={data?.data.user?.id}
|
|
||||||
height='calc(100svh - 50px - (var(--spacing) * 2 * 5))'
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,8 +219,7 @@ export const GET = auth(async function GET(req, { params }) {
|
||||||
success: true,
|
success: true,
|
||||||
calendar: calendar.filter(
|
calendar: calendar.filter(
|
||||||
(event, index, self) =>
|
(event, index, self) =>
|
||||||
self.findIndex((e) => e.id === event.id && e.type === event.type) ===
|
self.findIndex((e) => e.id === event.id && e.type === event.type) === index,
|
||||||
index,
|
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -41,13 +41,7 @@ const DaDRBCalendar = withDragAndDrop<
|
||||||
|
|
||||||
const localizer = momentLocalizer(moment);
|
const localizer = momentLocalizer(moment);
|
||||||
|
|
||||||
export default function Calendar({
|
export default function Calendar({ userId, height }: { userId?: string; height: string }) {
|
||||||
userId,
|
|
||||||
height,
|
|
||||||
}: {
|
|
||||||
userId?: string;
|
|
||||||
height: string;
|
|
||||||
}) {
|
|
||||||
return (
|
return (
|
||||||
<QueryErrorResetBoundary>
|
<QueryErrorResetBoundary>
|
||||||
{({ reset }) => (
|
{({ reset }) => (
|
||||||
|
@ -78,13 +72,7 @@ export default function Calendar({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function CalendarWithUserEvents({
|
function CalendarWithUserEvents({ userId, height }: { userId: string; height: string }) {
|
||||||
userId,
|
|
||||||
height,
|
|
||||||
}: {
|
|
||||||
userId: string;
|
|
||||||
height: string;
|
|
||||||
}) {
|
|
||||||
const sesstion = useSession();
|
const sesstion = useSession();
|
||||||
const [currentView, setCurrentView] = React.useState<
|
const [currentView, setCurrentView] = React.useState<
|
||||||
'month' | 'week' | 'day' | 'agenda' | 'work_week'
|
'month' | 'week' | 'day' | 'agenda' | 'work_week'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue