Skip to content

Commit 5dad326

Browse files
completed Dropdown.tsx. TravelContainer in progress
1 parent c0f2712 commit 5dad326

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/app/components/Dropdown.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@ import React from 'react';
22
import Select from 'react-select';
33
import { DropdownProps } from '../FrontendTypes'
44

5+
/*
6+
Allows the user to change the speed of the time-travel based on the selected dropdown value
7+
Component is created in the TravelContainer.tsx
8+
*/
9+
510
const Dropdown = (props: DropdownProps): JSX.Element => {
611
const { speeds, setSpeed, selectedSpeed } = props;
712
return (
813
<Select
914
className='react-select-container'
1015
classNamePrefix='react-select'
11-
value={selectedSpeed}
12-
onChange={setSpeed}
13-
options={speeds}
16+
value={selectedSpeed} // the text displayed will be based on the currently selected speed
17+
onChange={setSpeed} // allows the speed to change upon selection
18+
options={speeds} // custom speed options that are visible to the user
1419
menuPlacement='top'
1520
/>
1621
);

src/app/containers/TravelContainer.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ import {
1313
import { useStoreContext } from '../store';
1414
import { TravelContainerProps } from '../FrontendTypes';
1515

16+
/*
17+
This container renders the time-travel play button, seek bar, playback controls, and the playback speed dropdown, located towards the bottom of the application, above the locked, download, upload, and tutorial buttons
18+
*/
19+
20+
//
1621
const speeds: {
1722
value: number;
1823
label: string;

0 commit comments

Comments
 (0)