@@ -11,13 +11,13 @@ import TextField from '@mui/material/TextField';
1111import MenuItem from '@mui/material/MenuItem' ;
1212import Typography from '@mui/material/Typography' ;
1313import { Search as SearchIcon } from '@mui/icons-material' ;
14- import { Collapse , IconButton , InputAdornment } from '@mui/material' ;
14+ import { Collapse , InputAdornment } from '@mui/material' ;
1515import ReceivedRequestCard from '../components/received_request_card/ReceivedRequestCard' ;
1616import { getFeedbackRequestsByRecipient } from '../api/feedback' ;
1717import './ReceivedRequestsPage.css' ;
1818import { UPDATE_TOAST } from '../context/actions' ;
1919import Divider from '@mui/material/Divider' ;
20- import ExpandMoreIcon from '@mui/icons-material /ExpandMore' ;
20+ import ExpandMore from '../components/expand-more /ExpandMore' ;
2121import SkeletonLoader from '../components/skeleton_loader/SkeletonLoader' ;
2222
2323const PREFIX = 'ReceivedRequestsPage' ;
@@ -61,16 +61,6 @@ const Root = styled('div')({
6161 color : 'gray' ,
6262 marginTop : '4em' ,
6363 textAlign : 'center'
64- } ,
65- [ `& .${ classes . expandClose } ` ] : {
66- transform : 'rotate(0deg)' ,
67- marginLeft : 'auto' ,
68- transition : 'transform 0.1s linear'
69- } ,
70- [ `& .${ classes . expandOpen } ` ] : {
71- transform : 'rotate(180deg)' ,
72- transition : 'transform 0.1s linear' ,
73- marginLeft : 'auto'
7464 }
7565} ) ;
7666
@@ -264,16 +254,12 @@ const ReceivedRequestsPage = () => {
264254 </ div >
265255 < div className = "request-section-header" >
266256 < Typography variant = "h5" > Received Requests</ Typography >
267- < IconButton
257+ < ExpandMore
258+ expand = { receivedRequestsExpanded }
268259 onClick = { ( ) => setReceivedRequestsExpanded ( ! receivedRequestsExpanded ) }
260+ aria-expanded = { receivedRequestsExpanded }
269261 aria-label = "show more"
270- className = {
271- receivedRequestsExpanded ? classes . expandOpen : classes . expandClose
272- }
273- size = "large"
274- >
275- < ExpandMoreIcon />
276- </ IconButton >
262+ />
277263 </ div >
278264 < Divider />
279265 < Collapse in = { ! receivedRequestsExpanded } timeout = "auto" unmountOnExit >
@@ -309,18 +295,14 @@ const ReceivedRequestsPage = () => {
309295 </ Collapse >
310296 < div className = "request-section-header" >
311297 < Typography variant = "h5" > Submitted Requests</ Typography >
312- < IconButton
298+ < ExpandMore
299+ expand = { submittedRequestsExpanded }
313300 onClick = { ( ) =>
314301 setSubmittedRequestsExpanded ( ! submittedRequestsExpanded )
315302 }
303+ aria-expanded = { submittedRequestsExpanded }
316304 aria-label = "show more"
317- className = {
318- submittedRequestsExpanded ? classes . expandOpen : classes . expandClose
319- }
320- size = "large"
321- >
322- < ExpandMoreIcon />
323- </ IconButton >
305+ />
324306 </ div >
325307 < Divider />
326308 < Collapse in = { ! submittedRequestsExpanded } timeout = "auto" unmountOnExit >
@@ -366,16 +348,12 @@ const ReceivedRequestsPage = () => {
366348 </ Collapse >
367349 < div className = "request-section-header" >
368350 < Typography variant = "h5" > Canceled Requests</ Typography >
369- < IconButton
351+ < ExpandMore
352+ expand = { canceledRequestsExpanded }
370353 onClick = { ( ) => setCanceledRequestsExpanded ( ! canceledRequestsExpanded ) }
354+ aria-expanded = { canceledRequestsExpanded }
371355 aria-label = "show more"
372- className = {
373- canceledRequestsExpanded ? classes . expandOpen : classes . expandClose
374- }
375- size = "large"
376- >
377- < ExpandMoreIcon />
378- </ IconButton >
356+ />
379357 </ div >
380358 < Divider />
381359 < Collapse in = { ! canceledRequestsExpanded } timeout = "auto" unmountOnExit >
0 commit comments