Skip to content

Commit

Permalink
reset and pause buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
cprice11 committed Oct 9, 2024
1 parent 8f1d59f commit ec205fa
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions experiences/bus-bunching/controls/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ const ControlsComponent = () => {
[sendMessage]
)

const restart = useCallback(
async (event, value) => {
await sendMessage({ type: "restart", value: value })
},
[sendMessage]
)

const pause = useCallback(
async (event, value) => {
await sendMessage({ type: "numStops", value: value })
},
[sendMessage]
)

return (
<div css={containerStyle}>
<p>
Expand All @@ -54,6 +68,18 @@ const ControlsComponent = () => {
marks
defaultValue={5}
/>
<Box>
<Button
variant="contained"
color="primary"
onClick={restart}
>
Restart
</Button>
</Box>
<Box>
{/* // PAUSE BUTTONS HERE */}
</Box>
</div>
)
}
Expand Down

0 comments on commit ec205fa

Please sign in to comment.