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: Adjust profile screen padding, typography and add divider #456

Merged
merged 2 commits into from
Nov 10, 2023
Merged
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
31 changes: 21 additions & 10 deletions src/screens/ProfileScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { ScrollView, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { Text } from 'react-native-paper';
import { Divider, Text } from 'react-native-paper';
import { useUser } from '../hooks/useUser';
import { tID } from '../common/testID';
import { t } from 'i18next';
Expand All @@ -11,6 +11,7 @@
import { useActiveProject, useMe } from '../hooks';

export const FhirProfileView = () => {
const { styles } = useStyles(defaultStyles);
const { isLoading, data } = useMe();

const subject = data?.[0].subject;
Expand All @@ -35,7 +36,7 @@
const address = subject.address?.[0];

return (
<>
<View style={styles.fieldsContainer}>
<Field
label={t('fhir-profile-first-name', 'First Name')}
value={name?.given?.[0]}
Expand All @@ -60,13 +61,13 @@
/>
<Field
label={t('fhir-profile-mobile-number', 'Mobile Number')}
value={subject.telecom?.find((t) => t.system === 'phone')?.value}

Check warning on line 64 in src/screens/ProfileScreen.tsx

View workflow job for this annotation

GitHub Actions / main

't' is already declared in the upper scope on line 7 column 10
/>
<Field
label={t('fhir-profile-email', 'Email Address')}
value={subject.telecom?.find((t) => t.system === 'email')?.value}

Check warning on line 68 in src/screens/ProfileScreen.tsx

View workflow job for this annotation

GitHub Actions / main

't' is already declared in the upper scope on line 7 column 10
/>
</>
</View>
);
};
export const ProfileScreen = () => {
Expand Down Expand Up @@ -127,12 +128,9 @@

return (
<View style={styles.fieldView} testID={tID(label)}>
<Text variant="labelMedium" style={styles.fieldLabelText}>
{label}
</Text>
<Text variant="bodyLarge" style={styles.fieldValueText}>
{value}
</Text>
<Text style={styles.fieldLabelText}>{label}</Text>
<Text style={styles.fieldValueText}>{value}</Text>
<Divider style={styles.dividerView} />
</View>
);
};
Expand All @@ -141,15 +139,28 @@
container: {
marginHorizontal: 24,
},
fieldsContainer: {
marginHorizontal: 8,
marginVertical: 12,
},
fieldView: {
margin: 12,
backgroundColor: theme.colors.surface,
gap: 4,
marginHorizontal: 12,
marginTop: 12,
marginBottom: 4,
},
fieldLabelText: {
color: theme.colors.tertiary,
fontSize: 16,
},
fieldValueText: {
color: theme.colors.onBackground,
fontSize: 18,
},
dividerView: {
color: theme.colors.tertiary,
marginTop: 10,
},
}));

Expand Down
Loading