From 37896f6960f8145a13e2943fbb0cde52da430d30 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 11 Mar 2021 14:38:02 +0100 Subject: move sidebar and timeline out of align folder --- .../editor/timeline/components/cursor.component.js | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 animism-align/frontend/app/views/editor/timeline/components/cursor.component.js (limited to 'animism-align/frontend/app/views/editor/timeline/components/cursor.component.js') diff --git a/animism-align/frontend/app/views/editor/timeline/components/cursor.component.js b/animism-align/frontend/app/views/editor/timeline/components/cursor.component.js new file mode 100644 index 0000000..4a94100 --- /dev/null +++ b/animism-align/frontend/app/views/editor/timeline/components/cursor.component.js @@ -0,0 +1,26 @@ +import React, { Component } from 'react' + +import { ZOOM_STEPS } from 'app/constants' +import { timestamp } from 'app/utils' + +const Cursor = ({ timeline, annotation }) => { + const { start_ts, zoom, cursor_ts, duration } = timeline + const ts = annotation.start_ts || cursor_ts + const secondsPerPixel = ZOOM_STEPS[zoom] * 0.1 + const y = (ts - start_ts) / secondsPerPixel + return ( +
+
+
+ {timestamp(ts, 1)} +
+
+ ) +} + +export default Cursor \ No newline at end of file -- cgit v1.2.3-70-g09d2