Skip to content

Commit

Permalink
feat: timeline change widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Apr 6, 2022
1 parent 561ce16 commit dcc9186
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/timeline/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ export default function Timeline() {
// setVideoDur(store.video.duration);
}, [store.widgetList]);

console.log(videoDur);
console.log(layout);
console.log(widgetArr);
// console.log(videoDur);
// console.log(layout);
// console.log(widgetArr);

const formatTime = (time: any) => {
if (typeof time == "number") {
Expand Down Expand Up @@ -126,6 +126,12 @@ export default function Timeline() {
});
setIsModalVisible(false);
};
const changeStoreCurrentId = (id: number) => {
setStore({
...store,
currentWidgetId: id,
});
};
return (
<div className="timeline-container">
<div className="timeline-container-des">
Expand Down Expand Up @@ -202,10 +208,16 @@ export default function Timeline() {
props: widget.id,
});
}}
onClick={() => {
changeStoreCurrentId(widget.id);
}}
title={`start:${formatTime(
widget.start
)} - end:${formatTime(widget.end)}`}
className="current timeline-container-des-part-widget"
className={
"timeline-container-des-part-widget" +
(store.currentWidgetId == widget.id ? " current" : "")
}
key={String(widget.id)}
>
<p>{widget.name}</p>
Expand Down

0 comments on commit dcc9186

Please sign in to comment.