Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🚧 show something when dr without inst_id #394

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,11 @@
},
"sozialmarie": {
"description": "The Doctors Tracker portal was created to bring the healthcare system closer to the patient. In Slovenia, we are facing a shortage of doctors at primary level. This leaves many patients without the basic right of access to a personal GP. In the Scientific association Tracker, we imported the data that was publicly available every 15 days in a spreadsheet that was not user friendly into our portal and allowed users to suggest corrections for faulty data in real time. This gave patients seeking primary care user-friendly and up-to-date information."
},
"drNoInstId": {
"title": "Error",
"p1": "We are very sorry, but we could not find the doctor you are looking for. Most likely we don't know his institution.",
"p2": "The doctor you are looking for is not in our database. Please check if the doctor is in the ZZZS database, as this is the basis for our data. If the doctor is present there, wait a few days for the changes to appear in our database. Otherwise, please contact",
"thanks": "Thank you for your understanding."
}
}
}
10 changes: 8 additions & 2 deletions src/locales/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@
"at": "ob"
},
"sozialmarie": {
"description": "Portal Zdravniki Sledilnik je bil ustvarjen z namenom približevanja osrkbe k pacientu. V Sloveniji se soočamo s pomankanjem zdravnikov na primarnem nivoju. Veliko pacientov je zaradi tega brez osnovne pravice dostopa do opredelitve osebnega zdravnika. V Znanstvenem društvu Sledilnik smo podatke, ki so se javno objavljali na 15 dni v nepregledni razpredelnici uvozili v naš portal ter omogočali uporabnikom, da podatke posodabljajo v realnem času. Tako smo pacientom, ki so iskali oskrbo na primarnem nivoju omogočili prijazno uporabniško informacijo ter ažurne informacije."
"description": "Portal Zdravniki Sledilnik je bil ustvarjen z namenom približevanja oskrbe k pacientu. V Sloveniji se soočamo s pomankanjem zdravnikov na primarnem nivoju. Veliko pacientov je zaradi tega brez osnovne pravice dostopa do opredelitve osebnega zdravnika. V Znanstvenem društvu Sledilnik smo podatke, ki so se javno objavljali na 15 dni v nepregledni razpredelnici uvozili v naš portal ter omogočali uporabnikom, da podatke posodabljajo v realnem času. Tako smo pacientom, ki so iskali oskrbo na primarnem nivoju omogočili prijazno uporabniško informacijo ter ažurne informacije."
},
"drNoInstId": {
"title": "Napaka",
"p1": "Se opravičujemo. Za tega zdravnika ne poznamo njegovo institucije zato ne moremo prikazati njegovih podatkov.",
"p2": "Ta zdravnik se ne nahaja v našem zajemu podatku. Prosimo preverite ali se zdravnik nahaja v bazi ZZZS, saj je ta baza osnova za naš zajem podatkov. V primeru, da je tam zdravnik prisoten počakajte nekaj dni, da se spremembe prikažejo pri nas. V nasprotnem primeru prosimo kontaktirajte",
"thanks": "Hvala za razumevanje!"
}
}
}
35 changes: 35 additions & 0 deletions src/pages/Doctor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useEffect, useState } from 'react';
import { useParams, Navigate } from 'react-router-dom';
import { t } from 'i18next';

import DoctorCard from 'components/DoctorCard';
import { Loader } from 'components/Shared';
Expand Down Expand Up @@ -28,6 +29,40 @@ const Doctor = function Doctor() {
}
}, [loading]);

if (!instId) {
return (
<>
<Styled.Main
id="main-content"
component="main"
style={{ minHeight: 'calc(100vh - 200px', fontSize: '0.875rem' }}
>
<div
style={{
maxWidth: '500px',
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
gap: '0.75rem',
flexGrow: 1,
}}
>
<h2>{t('drNoInstId.title')}</h2>
<p>{t('drNoInstId.p1')}</p>
<p>
{t('drNoInstId.p2')}{' '}
<a href="mailto:[email protected]">[email protected]</a>.
</p>
<p>{t('drNoInstId.thanks')}</p>
</div>
</Styled.Main>
<footer>
<FooterInfoCard isDrPage />
</footer>
</>
);
}

if (doctor) {
return (
<Styled.Main id="main-content" component="main">
Expand Down
8 changes: 7 additions & 1 deletion src/pages/styles/Doctor.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { styled } from '@mui/material/styles';
import MuiBox from '@mui/material/Box';

export const Main = styled(MuiBox)(() => ({
export const Main = styled(MuiBox)(({ theme }) => ({
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
Expand All @@ -10,4 +10,10 @@ export const Main = styled(MuiBox)(() => ({
'@media print': {
marginTop: '88px',
},

a: {
color: theme.customColors.links,
fontWeight: 'bold',
textDecoration: 'none',
},
}));
6 changes: 6 additions & 0 deletions src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ const Router = function Router() {
<IsWrongLanguage isValidLanguage={isValidLanguage} lng={langPath} Component={Faq} />
}
/>
<Route
path="/:lng/:type/:name"
element={
<IsWrongLanguage isValidLanguage={isValidLanguage} lng={langPath} Component={Doctor} />
}
/>
<Route
path="/:lng/:type/:name/:instId"
element={
Expand Down
Loading