diff --git a/frontend/src/components/dashboard/CaseCard.tsx b/frontend/src/components/dashboard/CaseCard.tsx index 03bb15cfa..06948e497 100644 --- a/frontend/src/components/dashboard/CaseCard.tsx +++ b/frontend/src/components/dashboard/CaseCard.tsx @@ -137,6 +137,8 @@ const CaseCard = ({ caseId={caseId} status={caseTag} referringWorkerName={referringWorker} + referralDate={date} + familyName={familyName} intakeNotes={intakeMeetingNotes} isOpen={isOpenStatusModal} onClick={onClickStatusUpdate} diff --git a/frontend/src/components/dashboard/FilteredSection.tsx b/frontend/src/components/dashboard/FilteredSection.tsx index 915613a00..b10314a21 100644 --- a/frontend/src/components/dashboard/FilteredSection.tsx +++ b/frontend/src/components/dashboard/FilteredSection.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useContext } from "react"; import { useHistory } from "react-router-dom"; import { Box, @@ -11,15 +11,15 @@ import { Center, } from "@chakra-ui/react"; import { ArrowRight } from "react-feather"; -import CaseCard, { CaseCardProps } from "./CaseCard"; +import CaseCard from "./CaseCard"; +import CasesContext from "../../contexts/CasesContext"; +import { CasesContextType } from "../../types/CasesContextTypes"; const FilteredSection = ({ status, - cases, showViewAll = true, }: { status: string; - cases: CaseCardProps[]; showViewAll?: boolean; }): React.ReactElement => { const history = useHistory(); @@ -27,10 +27,12 @@ const FilteredSection = ({ history.push(`/cases/${status.toLowerCase()}`); }; + const cases = useContext(CasesContext); + const groupedCases = cases.reduce( (acc, _, index) => index % 4 === 0 ? [...acc, cases.slice(index, index + 4)] : acc, - [] as CaseCardProps[][], + [] as CasesContextType[], ); return ( @@ -69,12 +71,18 @@ const FilteredSection = ({ {row.map((caseData) => ( ))} @@ -84,12 +92,18 @@ const FilteredSection = ({ .slice(0, 4) .map((caseData) => ( ))} diff --git a/frontend/src/components/dashboard/StatusModal.tsx b/frontend/src/components/dashboard/StatusModal.tsx index 50cc62335..9e1d8fca5 100644 --- a/frontend/src/components/dashboard/StatusModal.tsx +++ b/frontend/src/components/dashboard/StatusModal.tsx @@ -31,6 +31,8 @@ export type StatusModalProps = { goToIntake: () => void; referringWorkerName: string; intakeNotes: string; + referralDate: string; + familyName: string; }; const StatusModal = ({ @@ -43,6 +45,8 @@ const StatusModal = ({ goToIntake, referringWorkerName, intakeNotes, + referralDate, + familyName, }: StatusModalProps): React.ReactElement => { const [selectedOption, setSelectedOption] = useState(status); const [workerName, setWorkerName] = useState(referringWorkerName); @@ -124,8 +128,8 @@ const StatusModal = ({ Case Submission {/* TODO: Need to be changed for dynamic values */} - Date: XXX - Family Name: XXX + Date: {referralDate} + Family Name: {familyName}