@@ -26,9 +26,12 @@ import {
26
26
} from "@chakra-ui/react" ;
27
27
import * as TABLE_LIBRARY_TYPES from "@table-library/react-table-library/types/table" ;
28
28
import React , { useContext , useEffect , useState } from "react" ;
29
- import { BsFilter } from "react-icons/bs" ;
29
+ import { BsFilter , BsReplyAll } from "react-icons/bs" ;
30
30
import { FiFilter } from "react-icons/fi" ;
31
31
32
+ import { useNavigate } from "react-router-dom" ;
33
+
34
+ import { ADMIN_MEAL_REQUESTS_PAGE } from "../../constants/Routes" ;
32
35
import AuthContext from "../../contexts/AuthContext" ;
33
36
import {
34
37
MealRequest ,
@@ -478,6 +481,7 @@ const AdminListView = ({
478
481
const [ mealRequestId , setMealRequestId ] = useState < string > ( "" ) ;
479
482
const [ isUpcoming , setIsUpcoming ] = useState < boolean > ( false ) ;
480
483
const [ shouldReload , setShouldReload ] = useState ( false ) ;
484
+ const navigate = useNavigate ( ) ;
481
485
482
486
const handleExpand = ( item : TABLE_LIBRARY_TYPES . TableNode ) => ( ) => {
483
487
if ( item . pending ) return ;
@@ -631,7 +635,6 @@ const AdminListView = ({
631
635
632
636
useEffect ( ( ) => {
633
637
if ( shouldReload ) {
634
- // console.log("Doing a reload! ", shouldReload);
635
638
reloadMealRequests ( ) ;
636
639
setShouldReload ( false ) ;
637
640
}
@@ -641,7 +644,7 @@ const AdminListView = ({
641
644
useEffect ( ( ) => {
642
645
reloadMealRequests ( ) ;
643
646
// eslint-disable-next-line react-hooks/exhaustive-deps
644
- } , [ filter , sort , currentPage , authenticatedUser ] ) ;
647
+ } , [ filter , sort , currentPage , authenticatedUser , aspId , donorId ] ) ;
645
648
646
649
const COLUMNS = [
647
650
{
@@ -887,6 +890,31 @@ const AdminListView = ({
887
890
return (
888
891
< Box mt = "24px" width = "80%" >
889
892
< Flex gap = "10px" marginBottom = "20px" justifyContent = "flex-end" >
893
+ { aspId || donorId ?
894
+ < Menu >
895
+ < MenuButton
896
+ as = { ChakraButton }
897
+ _hover = { { backgroundColor : "gray.200" } }
898
+ padding = "6px 10px"
899
+ borderRadius = "3px"
900
+ fontSize = "14px"
901
+ border = "solid 1px #E2E8F0"
902
+ boxShadow = "lg"
903
+ backgroundColor = "white"
904
+ color = "black"
905
+ minWidth = "75px"
906
+ onClick = { ( ) => {
907
+ navigate ( ADMIN_MEAL_REQUESTS_PAGE , { replace : false } ) ;
908
+ } }
909
+ >
910
+ < Flex gap = "2px" >
911
+ < BsReplyAll />
912
+ < Text >
913
+ View All Meal Requests
914
+ </ Text >
915
+ </ Flex >
916
+ </ MenuButton >
917
+ </ Menu > : null }
890
918
< Menu >
891
919
< MenuButton
892
920
as = { ChakraButton }
0 commit comments