Remove label and make overlay respect selected theme

This commit is contained in:
Nick Mowen 2023-06-28 06:19:42 -06:00
parent 6fb5fdae51
commit e92916e955
2 changed files with 2 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import { Fragment, h } from 'preact'; import { Fragment, h } from 'preact';
import { useState } from 'preact/hooks'; import { useState } from 'preact/hooks';
export default function TimelineEventOverlay({ event, eventOverlay, cameraConfig }) { export default function TimelineEventOverlay({ eventOverlay, cameraConfig }) {
const boxLeftEdge = Math.round(eventOverlay.data.box[0] * 100); const boxLeftEdge = Math.round(eventOverlay.data.box[0] * 100);
const boxTopEdge = Math.round(eventOverlay.data.box[1] * 100); const boxTopEdge = Math.round(eventOverlay.data.box[1] * 100);
const boxRightEdge = Math.round((1 - eventOverlay.data.box[2] - eventOverlay.data.box[0]) * 100); const boxRightEdge = Math.round((1 - eventOverlay.data.box[2] - eventOverlay.data.box[0]) * 100);
@ -55,8 +55,7 @@ export default function TimelineEventOverlay({ event, eventOverlay, cameraConfig
) : null} ) : null}
</div> </div>
{isHovering && ( {isHovering && (
<div className="absolute bg-slate-800 p-4 block text-white text-lg" style={getHoverStyle()}> <div className="absolute bg-white dark:bg-slate-800 p-4 block dark:text-white text-lg" style={getHoverStyle()}>
<div className="font-bold text-xl">{event.label} attributes:</div>
<div>{`Area: ${getObjectArea()} px`}</div> <div>{`Area: ${getObjectArea()} px`}</div>
<div>{`Ratio: ${getObjectRatio()}`}</div> <div>{`Ratio: ${getObjectRatio()}`}</div>
</div> </div>

View File

@ -719,7 +719,6 @@ export default function Events({ path, ...props }) {
> >
{eventOverlay ? ( {eventOverlay ? (
<TimelineEventOverlay <TimelineEventOverlay
event={event}
eventOverlay={eventOverlay} eventOverlay={eventOverlay}
cameraConfig={config.cameras[event.camera]} cameraConfig={config.cameras[event.camera]}
/> />