Skip to content

Commit

Permalink
Merge pull request #126 from sledilnik/pediatrician
Browse files Browse the repository at this point in the history
Add pediatrician to doctor type selection
  • Loading branch information
lukarenko authored Dec 22, 2021
2 parents 6325308 + 472edcf commit 320b43c
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 19 deletions.
10 changes: 6 additions & 4 deletions src/components/DoctorCard/Shared/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ export const DoubleChip = function DoubleChip({ type, ageGroup }) {
<Icons.Icon name={typeIcon} className="icon" />
<span className="text">{t(`${drType}`)}</span>
</Styled.PageInfo.First>
<Styled.PageInfo.Second direction="row" component="span" spacing={1}>
<span className="text">{t(`${drAgeGroup}`)}</span>
<Icons.Icon name={ageGroupIcon} className="icon" />
</Styled.PageInfo.Second>
{type === 'den' && (
<Styled.PageInfo.Second direction="row" component="span" spacing={1}>
<span className="text">{t(`${drAgeGroup}`)}</span>
<Icons.Icon name={ageGroupIcon} className="icon" />
</Styled.PageInfo.Second>
)}
</Styled.PageInfo.DCWrapper>
);
};
2 changes: 2 additions & 0 deletions src/components/DoctorCard/dicts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const TypeTranslate = {
gp: 'generalPractitioner',
ped: 'pediatrician',
den: 'dentist',
gyn: 'gynecologist',
};
Expand All @@ -11,6 +12,7 @@ export const AgeGroupTranslate = {

export const TypeIconTranslate = {
gp: 'Family',
ped: 'Kids',
den: 'Dentist',
gyn: 'Gyno',
};
Expand Down
38 changes: 23 additions & 15 deletions src/components/Filters/ToggleDoctorType.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ function withToggleGroup(Component) {
useEffect(() => {
const typeTranslate = {
gp_adults: 'gp',
gp_youth: 'gp-y',
gp_youth: 'gp',
gp_students: 'gp',
ped_adults: 'ped',
ped_students: 'ped',
ped_youth: 'ped',
den_adults: 'den',
den_students: 'den-s',
den_youth: 'den-y',
Expand Down Expand Up @@ -57,11 +60,11 @@ function withToggleGroup(Component) {
iconNames={['FamilyDrWhite', 'Family']}
/>
<IconToggleButton
value="den"
aria-label="dentist"
value="ped"
aria-label="pediatrician"
accept={drType}
text={t('dentist')}
iconNames={['DentistWhite', 'Dentist']}
text={t('pediatrician')}
iconNames={['KidsWhite', 'Kids']}
/>
<IconToggleButton
value="gyn"
Expand All @@ -70,8 +73,15 @@ function withToggleGroup(Component) {
text={t('gynecologist')}
iconNames={['GynoWhite', 'Gyno']}
/>
<IconToggleButton
value="den"
aria-label="dentist"
accept={drType}
text={t('dentist')}
iconNames={['DentistWhite', 'Dentist']}
/>
</Component>
{drType !== 'gyn' && (
{drType === 'den' && (
<Component {...injectedPropsAgeGroup}>
<IconToggleButton
value="adults"
Expand All @@ -87,15 +97,13 @@ function withToggleGroup(Component) {
text={t('youth')}
iconNames={['KidsWhite', 'Kids']}
/>
{drType === 'den' && (
<IconToggleButton
value="students"
aria-label="students"
accept={ageGroup}
text={t('students')}
iconNames={['StudentsWhite', 'Students']}
/>
)}
<IconToggleButton
value="students"
aria-label="students"
accept={ageGroup}
text={t('students')}
iconNames={['StudentsWhite', 'Students']}
/>
</Component>
)}
</>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Filters/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import * as Styled from './styles';

const DoctorTypeIcons = {
gp: <Icons.Icon name="Family" />,
ped: <Icons.Icon name="Kids" />,
den: <Icons.Icon name="Dentist" />,
gyn: <Icons.Icon name="Gyno" />,
};
Expand All @@ -32,6 +33,7 @@ const AcceptsIcons = {

const DoctorTypeText = {
gp: 'generalPractitioner',
ped: 'pediatrician',
den: 'dentist',
gyn: 'gynecologist',
};
Expand Down
1 change: 1 addition & 0 deletions src/const/doctors.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const Provider = {

export const DoctorTypes = {
doctors: 'Splošni',
ped: 'Pediatri',
gyno: 'Ginekologi',
dentists: 'Zobozdravniki',
};
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"all": "all",
"generalPractitioner": "general practitioner",
"dentist": "dentist",
"pediatrician": "pediatrician",
"gynecologist": "gynecologist",
"adults": "adults",
"students": "students",
Expand Down
1 change: 1 addition & 0 deletions src/locales/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"all": "vsi",
"generalPractitioner": "družinski zdravnik",
"dentist": "zobozdravnik",
"pediatrician": "pediater",
"gynecologist": "ginekolog",
"adults": "odrasli",
"students": "študenti",
Expand Down

0 comments on commit 320b43c

Please sign in to comment.