|
@@ -16,8 +16,8 @@ const EVENT_STICK_MARKER_WIDTH = 4;
|
|
|
|
|
|
type Props = {
|
|
|
crumbs: Crumb[];
|
|
|
- durationMS: number;
|
|
|
- startTimestamp: number;
|
|
|
+ durationMs: number;
|
|
|
+ startTimestampMs: number;
|
|
|
width: number;
|
|
|
className?: string;
|
|
|
};
|
|
@@ -25,18 +25,23 @@ type Props = {
|
|
|
function ReplayTimelineEvents({
|
|
|
className,
|
|
|
crumbs,
|
|
|
- durationMS,
|
|
|
- startTimestamp,
|
|
|
+ durationMs,
|
|
|
+ startTimestampMs,
|
|
|
width,
|
|
|
}: Props) {
|
|
|
const totalColumns = Math.floor(width / EVENT_STICK_MARKER_WIDTH);
|
|
|
- const eventsByCol = getCrumbsByColumn(startTimestamp, durationMS, crumbs, totalColumns);
|
|
|
+ const eventsByCol = getCrumbsByColumn(
|
|
|
+ startTimestampMs,
|
|
|
+ durationMs,
|
|
|
+ crumbs,
|
|
|
+ totalColumns
|
|
|
+ );
|
|
|
|
|
|
return (
|
|
|
<Timeline.Columns className={className} totalColumns={totalColumns} remainder={0}>
|
|
|
{Array.from(eventsByCol.entries()).map(([column, breadcrumbs]) => (
|
|
|
<EventColumn key={column} column={column}>
|
|
|
- <Event crumbs={breadcrumbs} startTimestamp={startTimestamp} />
|
|
|
+ <Event crumbs={breadcrumbs} startTimestampMs={startTimestampMs} />
|
|
|
</EventColumn>
|
|
|
))}
|
|
|
</Timeline.Columns>
|
|
@@ -55,10 +60,10 @@ const EventColumn = styled(Timeline.Col)<{column: number}>`
|
|
|
|
|
|
function Event({
|
|
|
crumbs,
|
|
|
- startTimestamp,
|
|
|
+ startTimestampMs,
|
|
|
}: {
|
|
|
crumbs: Crumb[];
|
|
|
- startTimestamp: number;
|
|
|
+ startTimestampMs: number;
|
|
|
className?: string;
|
|
|
}) {
|
|
|
const {setCurrentTime} = useReplayContext();
|
|
@@ -66,17 +71,17 @@ function Event({
|
|
|
const handleClick = useCallback(
|
|
|
(crumb: Crumb) => {
|
|
|
crumb.timestamp !== undefined
|
|
|
- ? setCurrentTime(relativeTimeInMs(crumb.timestamp, startTimestamp))
|
|
|
+ ? setCurrentTime(relativeTimeInMs(crumb.timestamp, startTimestampMs))
|
|
|
: null;
|
|
|
},
|
|
|
- [setCurrentTime, startTimestamp]
|
|
|
+ [setCurrentTime, startTimestampMs]
|
|
|
);
|
|
|
|
|
|
const title = crumbs.map(crumb => (
|
|
|
<BreadcrumbItem
|
|
|
key={crumb.id}
|
|
|
crumb={crumb}
|
|
|
- startTimestamp={startTimestamp}
|
|
|
+ startTimestampMs={startTimestampMs}
|
|
|
isHovered={false}
|
|
|
isSelected={false}
|
|
|
onClick={handleClick}
|