@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
22import CheckInButtons from '../components/presentational/CheckInButtons' ;
33import CreateNewProfileButton from '../components/presentational/CreateNewProfileButton' ;
44import { REACT_APP_CUSTOM_REQUEST_HEADER as headerToSend } from '../utils/globalSettings' ;
5- import { CircularProgress , Box , Typography } from '@mui/material' ;
5+ import { CircularProgress , Box , Typography , Select , MenuItem , FormControl , InputLabel } from '@mui/material' ;
66
77import '../sass/Home.scss' ;
88
@@ -25,12 +25,13 @@ const h4sx = {
2525 fontSize : { xs : '1.8rem' } ,
2626}
2727
28+
2829const Home = ( ) => {
2930 const [ events , setEvents ] = useState ( null ) ;
3031 const [ selectedEvent , setSelectedEvent ] = useState ( '' ) ;
3132
3233 const handleEventChange = ( e ) => {
33- setSelectedEvent ( e . currentTarget . value ) ;
34+ setSelectedEvent ( e . target . value ) ;
3435 } ;
3536
3637 // Fetching only events with checkInReady = true
@@ -61,6 +62,8 @@ const Home = () => {
6162 ) ;
6263 }
6364
65+
66+
6467 return (
6568 < Box className = "home" >
6669 < Box className = "home-headers" >
@@ -70,39 +73,43 @@ const Home = () => {
7073
7174 { events && events . length > 0 ? (
7275 < Box className = "meeting-select-container" >
73- < form
76+ < FormControl
7477 className = "form-select-meeting"
7578 autoComplete = "off"
7679 onSubmit = { ( e ) => e . preventDefault ( ) }
80+ variant = 'standard'
7781 >
7882 < Box className = "form-row" >
7983 < Box className = "form-input-select" >
80- < label htmlFor = { ' meeting-checkin' } >
84+ < InputLabel id = 'select- meeting-label' >
8185 Select a meeting to check-in:
82- </ label >
86+ </ InputLabel >
8387 < Box className = "radio-buttons" >
84- < select
85- name = { ' meeting-checkin' }
88+ < Select
89+ labelId = 'select- meeting-label'
8690 className = "select-meeting-dropdown"
91+ value = { selectedEvent ? selectedEvent : "--SELECT ONE--" }
92+ renderValue = { ( selected ) => (
93+ < Typography sx = { { color : 'red' } } >
94+ { selectedEvent ? selectedEvent : "--SELECT ONE--" }
95+ </ Typography >
96+ ) }
8797 onChange = { handleEventChange }
88- required
89- defaultValue = "--SELECT ONE--"
9098 >
91- < option value = "--SELECT ONE--" disabled hidden >
92- --SELECT ONE--
93- </ option >
9499 { events . map ( ( event ) => {
95100 return (
96- < option key = { event . _id || 0 } value = { event . _id } >
97- { event ?. project ?. name + ' - ' + event . name }
98- </ option >
101+ < MenuItem key = { event . _id || 0 } value = { event . project ?. name + ' - ' + event . name } >
102+ < Typography >
103+ { event ?. project ?. name + ' - ' + event . name }
104+ </ Typography >
105+ </ MenuItem >
99106 ) ;
100107 } ) }
101- </ select >
108+ </ Select >
102109 </ Box >
103110 </ Box >
104111 </ Box >
105- </ form >
112+ </ FormControl >
106113 </ Box >
107114 ) :(
108115
0 commit comments