diff --git a/src/pages/RequestAidPage.tsx b/src/pages/RequestAidPage.tsx index d013adb..524214a 100644 --- a/src/pages/RequestAidPage.tsx +++ b/src/pages/RequestAidPage.tsx @@ -1,28 +1,49 @@ +import getFormStatus from '@api/get-form-status'; +import Loading from '@components/Loading'; import RequestAidForm from '@forms/RequestAidForm/index'; +import { useContext } from 'react'; import { Container } from 'react-bootstrap'; +import RequestFormStatusContext from '../contexts/RequestFormStatusContext'; -const RequestAidPage = () => ( - - {/* */} -

Request Aid Form

-

- Due to an overwhelming response and limited volunteer capacity, we - have temporarily taken down the request aid form. We want to ensure - that each request receives the attention and support it deserves, - and for that, we need more helping hands. We invite compassionate - individuals who share our mission to step forward and become a part - of our volunteer team. By dedicating your time and skills, you can - make a tangible impact on the lives of those in need. Whether you - only have a couple hours to spare each month or more, your - contribution can make a significant difference in our collective - effort to support the community. -
-
- - support@communalists.org - -

-
-); +const RequestAidPage = () => { + const { requestFormStatus, hasFetchedRequestFormStatus } = useContext( + RequestFormStatusContext + ); + + if (!hasFetchedRequestFormStatus) { + return ; + } + + return ( + + {requestFormStatus ? ( + + ) : ( + <> +

Request Aid Form

+

+ Due to an overwhelming response and limited volunteer + capacity, we have temporarily taken down the request aid + form. We want to ensure that each request receives the + attention and support it deserves, and for that, we need + more helping hands. We invite compassionate individuals + who share our mission to step forward and become a part + of our volunteer team. By dedicating your time and + skills, you can make a tangible impact on the lives of + those in need. Whether you only have a couple hours to + spare each month or more, your contribution can make a + significant difference in our collective effort to + support the community. +
+
+ + support@communalists.org + +

+ + )} +
+ ); +}; export default RequestAidPage;