Skip to content

Commit

Permalink
edited style for calendar event block
Browse files Browse the repository at this point in the history
  • Loading branch information
qianxuege committed Dec 23, 2024
1 parent 546ae53 commit b1b1bbb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
40 changes: 35 additions & 5 deletions frontend/src/components/calendar/Calendar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { RefObject, useRef, useState } from "react";
import React, { RefObject, useEffect, useRef, useState } from "react";
import FullCalendar from "@fullcalendar/react";
import dayGridPlugin from "@fullcalendar/daygrid";
import timeGridPlugin from "@fullcalendar/timegrid";
Expand All @@ -16,10 +16,25 @@ import { RemoveFCEventType } from "../../types";

function renderEventContent(eventContent: EventContentArg) {
return (
<div className={`w-full ${eventContent.event.allDay ? 'bg-green': 'bg-green'}`}>
// <div className={`w-full ${eventContent.event.allDay ? 'bg-green': 'bg-green'}`}>

<p className="w-full truncate ..."><b>{eventContent.timeText}</b> {eventContent.event.title}</p>
</div>
// <p className="w-full truncate ..."><b>{eventContent.timeText}</b> {eventContent.event.title}</p>
// </div>

<div className={`w-full bg-white border-solid border-2 border-green rounded-md p-1`}>
<p className="w-full text-black truncate ...">{eventContent.event.title}</p>
{/* <div
style={{
position: "absolute",
bottom: "8px",
right: "8px",
fontSize: "1.2em",
color: "#6FBF73",
}}
>
✔️
</div> */}
</div>
)
}

Expand All @@ -38,9 +53,24 @@ export default function Calendar({showSearchBar, events, calendarRef, handleRemo
const [currentEvents, setCurrentEvents] = useState<EventApi[]>();
const [currView, setCurrView] = useState<string>('dayGridMonth');
const [showGCal, setShowGCal] = useState<boolean>(false);

const [eventsWStyle, setEventsWStyle] = useState({});
// console.log(events);

// useEffect(()=> {
// updateState();
// },[events])

// const updateState = () => {
// const newJsonObject = {
// events: events,
// color: 'white',
// textColor: 'black'
// };
// console.log(newJsonObject);
// setEventsWStyle(()=> newJsonObject);
// }


const handleDropdown = (event: SelectChangeEvent<string>) => {
const {target: { value }} = event;
setCurrView(value);
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ const Home: React.FC = () => {
start: start,
end: end,
allDay: allDay,
searchCardId: searchCardId
searchCardId: searchCardId,
backgroundColor: 'white',
borderColor: 'transparent',
}];
setEvents(newEvents);
}
Expand Down

0 comments on commit b1b1bbb

Please sign in to comment.