Skip to content

Commit

Permalink
Markers on vertical list are now clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
bananu7 committed Apr 2, 2024
1 parent 0ca91b8 commit 38682e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/Player.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
justify-items: center;
align-items: center;

cursor: pointer;
height: 40px;
list-style-type: none;
border-radius: 3px;
Expand Down
10 changes: 8 additions & 2 deletions src/components/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ export function Player(props: PlayerProps) {
const masterChannelController = props.audioSystem.getMasterChannelController();
const fxChannelController = props.audioSystem.getFxChannelController();

const setProjectTime = (t) => props.audioSystem.update({ position: t});

Check failure on line 93 in src/components/Player.tsx

View workflow job for this annotation

GitHub Actions / tsc

Parameter 't' implicitly has an 'any' type.

return (
<div className="player">
<div style={{display:'flex', height: "780px"}}>
Expand All @@ -108,7 +110,11 @@ export function Player(props: PlayerProps) {
<Transport audioSystem={props.audioSystem} />
<div className="markerList" style={{flexGrow: 1}}>
<ul>
{markers.map(m => <li key={m}><div className="dot"/>{formatProjectTime(m)}</li>)}
{markers.map(m =>
<li key={m} onClick={() => setProjectTime(m)}>
<div className="dot"/>{formatProjectTime(m)}
</li>
)}
</ul>
</div>
</div>
Expand All @@ -118,7 +124,7 @@ export function Player(props: PlayerProps) {
markers={markers}
projectTime={displayedProjectTime}
projectLength={2 * 60 * 60}
setProjectTime={(t) => props.audioSystem.update({ position: t})}
setProjectTime={setProjectTime}
/>
</div>
);
Expand Down

0 comments on commit 38682e9

Please sign in to comment.