Skip to content

Commit

Permalink
fix: Pinned Form Translation bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgiegerich94 committed Jun 17, 2021
1 parent 1be9d71 commit 746de57
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 48 deletions.
49 changes: 7 additions & 42 deletions components/Cards/SmallCardsCarousel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import {
Card, Text
} from 'react-native-paper';

import MedEvalSVG from '../../../assets/icons/Heart-Icon.svg';
import EnvSVG from '../../../assets/icons/Home-icon.svg';
import NewRecordSVG from '../../../assets/icons/New-Record-icon.svg';
import I18n from '../../../modules/i18n';
import { theme } from '../../../modules/theme';

Expand Down Expand Up @@ -49,47 +46,15 @@ const SmallCardsCarousel = ({
}}
onLongPress={pinForm ? () => pinForm(form) : null}
>
{form.tag === 'id' && (
<View style={styles.cardContainer}>
<NewRecordSVG height={40} style={styles.svg} />
<View style={styles.textContainer}>
<Text style={styles.text}>
{I18n.t('cards.smallCards.residentID')}
</Text>
</View>
<View style={styles.cardContainer}>
<form.image height={40} style={styles.svg} />
<View style={styles.textContainer}>
<Text style={styles.text}>
{I18n.t(form.name)}
</Text>
</View>
)}
</View>

{form.tag === 'env' && (
<View style={styles.cardContainer}>
<EnvSVG height={40} style={styles.svg} />
<View style={styles.textContainer}>
<Text style={styles.text}>
{`${I18n.t('cards.smallCards.environmental')} ${I18n.t('cards.smallCards.history')}`}
</Text>
</View>
</View>
)}
{form.tag === 'med-eval' && (
<View style={styles.cardContainer}>
<MedEvalSVG height={40} style={styles.svg} />
<View style={styles.textContainer}>
<Text style={styles.text}>
{`${I18n.t('cards.smallCards.medical')} ${I18n.t('cards.smallCards.evaluation')}`}
</Text>
</View>
</View>
)}
{form.tag === 'vitals' && (
<View style={styles.cardContainer}>
<NewRecordSVG height={40} style={styles.svg} />
<View style={styles.textContainer}>
<Text style={styles.text}>
{I18n.t('cards.smallCards.vitals')}
</Text>
</View>
</View>
)}
</Card>
))}
</ScrollView>
Expand Down
9 changes: 7 additions & 2 deletions domains/DataCollection/FormGallery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const FormGallery = (props) => {
navigateToCustomForm, customForms, refreshCustomForms,
pinnedForms, pinForm, removePinnedForm
} = props;

return (
<View>
<View key="pinnedForms" style={layout.screenRow}>
Expand All @@ -36,10 +37,14 @@ const FormGallery = (props) => {
}}
onLongPress={() => removePinnedForm(form)}
>

<View style={styles.cardContainer}>
{form.image !== undefined && (
<form.image height={40} style={styles.svg} />
)}
<View style={styles.textContainer}>
<Text style={styles.text}>
{form.name}
{ form.customForm === false ? I18n.t(form.name) : form.name}
</Text>
</View>
</View>
Expand Down Expand Up @@ -125,4 +130,4 @@ const FormGallery = (props) => {
</View>
);
};
export default FormGallery;
export default FormGallery;
18 changes: 14 additions & 4 deletions domains/DataCollection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
import ComingSoonSVG from '../../assets/graphics/static/Adventurer.svg';
import FindRecordSVG from '../../assets/graphics/static/Find-Record-Icon.svg';
import ResearchSVG from '../../assets/graphics/static/Research.svg';
import MedEvalSVG from '../../assets/icons/Heart-Icon.svg';
import EnvSVG from '../../assets/icons/Home-icon.svg';
import NewRecordSVG from '../../assets/icons/New-Record-icon.svg';
import FindResidents from '../../components/FindResidents';
import Header from '../../components/Header';
Expand All @@ -27,10 +29,18 @@ import Forms from './Forms';
import styles from './index.styles';

const puenteForms = [
{ tag: 'id', name: 'Resident ID' },
{ tag: 'env', name: 'Environmental Health' },
{ tag: 'med-eval', name: 'Medical Evaluation' },
{ tag: 'vitals', name: 'Vitals' }
{
tag: 'id', name: 'puenteForms.ResidentID', customForm: false, image: NewRecordSVG
},
{
tag: 'env', name: 'puenteForms.EnvironmentalHealth', customForm: false, image: EnvSVG
},
{
tag: 'med-eval', name: 'puenteForms.MedicalEvaluation', customForm: false, image: MedEvalSVG
},
{
tag: 'vitals', name: 'puenteForms.Vitals', customForm: false, image: NewRecordSVG
}
];

const DataCollection = ({ navigation }) => {
Expand Down
6 changes: 6 additions & 0 deletions modules/i18n/english/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -519,5 +519,11 @@
},
"assetFormSelect": {
"supAssetForms": "Supplementary Asset Forms"
},
"puenteForms":{
"ResidentID": "Resident ID",
"EnvironmentalHealth": "Environmental Health",
"MedicalEvaluation": "Medical Evaluation",
"Vitals": "Vitals"
}
}
6 changes: 6 additions & 0 deletions modules/i18n/spanish/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -519,5 +519,11 @@
},
"assetFormSelect": {
"supAssetForms": "Formularios de activos suplementarios"
},
"puenteForms":{
"ResidentID": "Identificación de residente",
"EnvironmentalHealth": "Salud Ambiental",
"MedicalEvaluation": "Evaluación Médica",
"Vitals": "Partes vitales"
}
}

0 comments on commit 746de57

Please sign in to comment.