diff --git a/components/Sidebar.js b/components/Sidebar.js index 98990dd..6e6d0af 100644 --- a/components/Sidebar.js +++ b/components/Sidebar.js @@ -49,7 +49,7 @@ class SideBar extends React.PureComponent { icon: "home", }, { - name: "AMICALE", + name: i18n.t('sidenav.divider4'), route: "Divider4" }, { diff --git a/screens/Amicale/ProfileScreen.js b/screens/Amicale/ProfileScreen.js index 3defbb8..5d69db4 100644 --- a/screens/Amicale/ProfileScreen.js +++ b/screens/Amicale/ProfileScreen.js @@ -101,22 +101,10 @@ class ProfileScreen extends React.Component { {i18n.t("profileScreen.personalInformation")} - } - /> - } - /> - } - /> - } - /> + {this.getPersonalListItem(this.data.birthday, "cake-variant")} + {this.getPersonalListItem(this.data.phone, "phone")} + {this.getPersonalListItem(this.data.email, "email")} + {this.getPersonalListItem(this.data.branch, "school")} @@ -208,12 +196,36 @@ class ProfileScreen extends React.Component { ); } + isFieldAvailable(field: ?string) { + return field !== null; + } + getFieldValue(field: ?string) { - return field !== null + return this.isFieldAvailable(field) ? field : i18n.t("profileScreen.noData"); } + getFieldColor(field: ?string) { + return this.isFieldAvailable(field) + ? this.colors.text + : this.colors.textDisabled; + } + + getPersonalListItem(field: ?string, icon: string) { + return ( + } + titleStyle={{color: this.getFieldColor(field)}} + /> + ); + } + render() { return (