Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bruceharrison1984 committed Jan 12, 2023
1 parent b36e4dd commit a8ef2f1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const EventWeekLayout = ({ events, daysInweek }: EventLayoutProps) => {
const { eventComponent: EventComponent } = useComponents();
const { setHighlight, clearHighlight, isHighlighted } = useEventHighlight();
const { onEventClick } = useActions();
const { setParentContainerRef, isEventVisible } = useEventIntersection();
const { setParentContainerRef } = useEventIntersection();

return (
<div className="event-week-layout" ref={setParentContainerRef}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ export const EventIntersectionProvider = ({
[eventVisibility, isDateBetween]
);

const isEventVisible = (key: string) => eventVisibility[key]?.visible;

/**
* This method checks if an event is fully visible, and if not hides it
* We do this via direct Refs because direct updates are faster and cleaner than relying upon
Expand Down Expand Up @@ -105,7 +103,6 @@ export const EventIntersectionProvider = ({

const value: EventIntersectionState = {
setParentContainerRef,
isEventVisible,
getEventsOnDate,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ export type EventIntersectionState = {
setParentContainerRef: React.Dispatch<
React.SetStateAction<HTMLElement | null>
>;
/** Lookup an event and retrieve its visibility */
isEventVisible: (key: string) => boolean;

/** Gets an array of events that occur on or span the supplied date. */
getEventsOnDate: (date: Date) => InternalCalendarEvent[];
};

0 comments on commit a8ef2f1

Please sign in to comment.