feat: update ProjectE application
This commit is contained in:
@@ -4,6 +4,7 @@ import { Calendar, dateFnsLocalizer } from 'react-big-calendar';
|
||||
import 'react-big-calendar/lib/css/react-big-calendar.css';
|
||||
import { format, parse, startOfWeek, getDay } from 'date-fns';
|
||||
import { enUS } from 'date-fns/locale/en-US';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
const locales = {
|
||||
'en-US': enUS,
|
||||
@@ -22,9 +23,10 @@ interface CalendarEvent {
|
||||
title: string;
|
||||
start: Date;
|
||||
end: Date;
|
||||
type: 'task' | 'habit' | 'project' | 'milestone';
|
||||
type: 'task' | 'project' | 'milestone';
|
||||
domain: string;
|
||||
color: string;
|
||||
href: string;
|
||||
}
|
||||
|
||||
interface BigCalendarWrapperProps {
|
||||
@@ -44,11 +46,9 @@ function eventStyleGetter(event: CalendarEvent) {
|
||||
};
|
||||
}
|
||||
|
||||
function handleSelectEvent(event: CalendarEvent) {
|
||||
console.log('Selected event:', event);
|
||||
}
|
||||
|
||||
export function BigCalendarWrapper({ events }: BigCalendarWrapperProps) {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<Calendar
|
||||
localizer={localizer}
|
||||
@@ -57,7 +57,7 @@ export function BigCalendarWrapper({ events }: BigCalendarWrapperProps) {
|
||||
endAccessor="end"
|
||||
style={{ height: 600 }}
|
||||
eventPropGetter={eventStyleGetter}
|
||||
onSelectEvent={handleSelectEvent}
|
||||
onSelectEvent={(event) => router.push(event.href)}
|
||||
views={['month', 'week', 'day']}
|
||||
defaultView="month"
|
||||
popup
|
||||
|
||||
Reference in New Issue
Block a user