Skip to content

Commit

Permalink
Merge branch 'how-to-become' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
vpsx committed Nov 27, 2023
2 parents 4c6f31b + 1fa6f98 commit 1adfbae
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
11 changes: 11 additions & 0 deletions packages/client/src/gql.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ export const GET_UPCOMING_ONGOING = gql`
}
}
`;
export const GET_HOWTOBECOME = gql`
query GetHowToBecomeARestorePatient {
howToBecomeARestorePatient {
data {
attributes {
Body
}
}
}
}
`;
export const GET_TEAM_CATEGORIES_AND_MEMBERS = gql`
{
teamCategories {
Expand Down
20 changes: 18 additions & 2 deletions packages/client/src/pages/TreatmentsServices.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import determinantsVennImg from '../assets/treatments_and_services/determinants_
import ptsdCurveImg from '../assets/treatments_and_services/ptsd-curve.svg';

import { useQuery } from '@apollo/client';
import { GET_UPCOMING_ONGOING } from '../gql.jsx';
import { GET_TREATMENTS_CARDGRID } from '../gql.jsx';
import { GET_UPCOMING_ONGOING, GET_HOWTOBECOME, GET_TREATMENTS_CARDGRID } from '../gql.jsx';
import ReactMarkdown from 'react-markdown';
import { prependStrapiURL } from '../utils.jsx';

Expand Down Expand Up @@ -576,6 +575,21 @@ function TreatmentsAndServices() {
);
}

function HowToBecomeARestorePatient() {
const { loading, error, data } = useQuery(GET_HOWTOBECOME);
if (loading) return <p>Loading...</p>;
if (error) return <p>Error : {error.message}</p>;

return (
<>
<Typography variant="h4">How to Become a RESTORE Patient</Typography>
<Paper sx={{ margin: '1rem 0', padding: '1rem', border: 'solid', borderRadius: '0.5em' }}>
<ReactMarkdown>{data.howToBecomeARestorePatient.data.attributes.Body}</ReactMarkdown>
</Paper>
</>
);
}

export default function Services() {
const { hash } = useLocation();
const [tabValue, setTabValue] = useState(hash || '#Services-to-the-health-system');
Expand Down Expand Up @@ -653,6 +667,8 @@ export default function Services() {
<TreatmentsAndServices />
<br />
<ScopeOfClinicalFocus />
<br />
<HowToBecomeARestorePatient />
</>
)}
</>
Expand Down

0 comments on commit 1adfbae

Please sign in to comment.