@@ -10,19 +10,20 @@ import { useState } from 'react';
1010import CheckBoxIcon from '@mui/icons-material/CheckBox' ;
1111import CheckBoxOutlineBlankIcon from '@mui/icons-material/CheckBoxOutlineBlank' ;
1212import { routes } from '../../../utils/routes' ;
13+ import { DesignReview , wbsPipe } from 'shared' ;
1314
1415interface DesignReviewDetailPageProps {
15- name : string ;
16+ designReview : DesignReview ;
1617}
1718
18- const DesignReviewDetailPage : React . FC < DesignReviewDetailPageProps > = ( { name } ) => {
19+ const DesignReviewDetailPage : React . FC < DesignReviewDetailPageProps > = ( { designReview , designReview : { teamType } } ) => {
1920 const theme = useTheme ( ) ;
2021 const { isLoading : allUsersIsLoading , isError : allUsersIsError , error : allUsersError , data : allUsers } = useAllUsers ( ) ;
2122 const [ requiredUsers , setRequiredUsers ] = useState ( [ ] . map ( userToAutocompleteOption ) ) ;
2223 const [ optionalUsers , setOptionalUsers ] = useState ( [ ] . map ( userToAutocompleteOption ) ) ;
2324 if ( allUsersIsError ) return < ErrorPage message = { allUsersError ?. message } /> ;
2425 if ( allUsersIsLoading || ! allUsers ) return < LoadingIndicator /> ;
25-
26+ const designReviewName = ` ${ wbsPipe ( designReview . wbsNum ) } - ${ designReview . wbsName } ` ;
2627 const users = allUsers . map ( userToAutocompleteOption ) ;
2728
2829 return (
@@ -52,7 +53,7 @@ const DesignReviewDetailPage: React.FC<DesignReviewDetailPageProps> = ({ name })
5253 </ Grid >
5354 < Grid item xs = { 3 } >
5455 < Box sx = { { padding : 1.5 , fontSize : '1.2em' , backgroundColor : 'grey' , borderRadius : 3 , textAlign : 'center' } } >
55- { name }
56+ { designReviewName }
5657 </ Box >
5758 </ Grid >
5859 < Grid item xs = { 1 } >
@@ -74,7 +75,7 @@ const DesignReviewDetailPage: React.FC<DesignReviewDetailPageProps> = ({ name })
7475 < Grid item xs = { 3 } >
7576 < Box sx = { { padding : 1 , backgroundColor : 'grey' , borderRadius : 3 , textAlign : 'center' } } >
7677 < Autocomplete
77- isOptionEqualToValue = { ( option , value ) => option . id === value . id } // What is this for
78+ isOptionEqualToValue = { ( option , value ) => option . id === value . id }
7879 multiple
7980 disableCloseOnSelect
8081 limitTags = { 1 }
@@ -120,7 +121,7 @@ const DesignReviewDetailPage: React.FC<DesignReviewDetailPageProps> = ({ name })
120121 < Grid item xs = { 3 } >
121122 < Box sx = { { padding : 1 , backgroundColor : 'grey' , borderRadius : 3 , textAlign : 'center' } } >
122123 < Autocomplete
123- isOptionEqualToValue = { ( option , value ) => option . id === value . id } // What is this for
124+ isOptionEqualToValue = { ( option , value ) => option . id === value . id }
124125 multiple
125126 disableCloseOnSelect
126127 limitTags = { 1 }
0 commit comments