Skip to content

Commit

Permalink
photo dropdown listing
Browse files Browse the repository at this point in the history
  • Loading branch information
Shiminc committed Jun 17, 2024
1 parent c34c306 commit 1083853
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
24 changes: 24 additions & 0 deletions frontend/src/components/PhotoSelection.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {useState} from 'react'

/*
Display a drop-down list of photos to be shown.
*/
function PhotoSelection (props) {


let listDisplayed = props.data.map(item =>
<option key={item.id} value={item}>{item}</option>);


return(
<>
<select
name="photo"
id="photo"
>
<option/>
{listDisplayed}</select>
</>
)
}
export default PhotoSelection
14 changes: 5 additions & 9 deletions frontend/src/components/ShowList.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useState} from 'react'

import PhotoSelection from './PhotoSelection'
/*
Display a drop-down list of sessions for navigation.
*/
Expand All @@ -25,16 +25,12 @@ function ShowList(props) {
fetch(url)
.then(response => response.json())
.then(data => setPhotoFilenames(data));
}

function PhotoList() {
console.log(photoFilenames);
return (
<ul>
</ul>
)

}



return (
<>
<h1>Photo Selection</h1>
Expand All @@ -45,7 +41,7 @@ function ShowList(props) {
>
<option/>
{listDisplayed}</select>
<PhotoList/>
<PhotoSelection data={photoFilenames}/>
</>
)

Expand Down

0 comments on commit 1083853

Please sign in to comment.