move handlebar on click when handlebar is showing

This commit is contained in:
Josh Hawkins 2024-03-07 18:30:33 -06:00
parent 28957004ba
commit f7150aa43f
2 changed files with 7 additions and 0 deletions

View File

@ -97,6 +97,7 @@ export function EventReviewTimeline({
minimapEndTime={minimapEndTime}
severityType={severityType}
contentRef={contentRef}
setHandlebarTime={setHandlebarTime}
/>
);
});

View File

@ -29,6 +29,7 @@ type EventSegmentProps = {
minimapEndTime?: number;
severityType: ReviewSeverity;
contentRef: RefObject<HTMLDivElement>;
setHandlebarTime?: React.Dispatch<React.SetStateAction<number>>;
};
export function EventSegment({
@ -41,6 +42,7 @@ export function EventSegment({
minimapEndTime,
severityType,
contentRef,
setHandlebarTime,
}: EventSegmentProps) {
const {
getSeverity,
@ -192,6 +194,10 @@ export function EventSegment({
element.classList.add("outline-0", "shadow-none");
}, 3000);
}
if (setHandlebarTime) {
setHandlebarTime(startTimestamp);
}
}
// we know that these deps are correct
// eslint-disable-next-line react-hooks/exhaustive-deps