Commit 8c315b9c authored by Gijs Hendriksen's avatar Gijs Hendriksen
Browse files

Added societies to the profile screen

parent e9e97b21
......@@ -112,6 +112,7 @@ Object {
"Computing science": "Informatica",
"Information sciences": "Informatiekunde",
"Personal information": "Persoonlijke gegevens",
"Societies": "Gezelschappen",
"Sorry! We couldn't load any data.": "Sorry! We konden geen gegevens laden.",
"Study programme": "Studie",
"This member has not written a description yet.": "Dit lid heeft nog geen beschrijving geschreven.",
......
......@@ -18,6 +18,7 @@ Object {
"pk": -1,
"profile_description": "",
"programme": "",
"societies": Array [],
"starting_year": -1,
"website": "",
},
......
......@@ -11,5 +11,6 @@
"Achievements for Thalia": "Verdiensten voor Thalia",
"today": "heden",
"Chair": "Voorzitter",
"Sorry! We couldn't load any data.": "Sorry! We konden geen gegevens laden."
"Sorry! We couldn't load any data.": "Sorry! We konden geen gegevens laden.",
"Societies": "Gezelschappen"
}
......@@ -20,6 +20,7 @@ const initialState = {
website: '',
membership_type: '',
achievements: [],
societies: [],
},
success: false,
hasLoaded: false,
......
......@@ -98,13 +98,13 @@ const getPersonalInfo = (profile, t) => {
return <View />;
};
const getAchievements = (profile, t) => {
if (profile.achievements.length) {
const getMemberships = (memberships, sectionHeader, t) => {
if (memberships.length) {
return (
<CardSection
sectionHeader={t('Achievements for Thalia')}
sectionHeader={sectionHeader}
>
{profile.achievements.map((achievement, i) => (
{memberships.map((achievement, i) => (
<View style={[styles.item, i !== 0 && styles.borderTop]} key={achievement.name}>
<Text style={styles.description}>
{achievement.name}
......@@ -278,7 +278,8 @@ class ProfileScreen extends Component {
<View style={styles.content}>
{getDescription(this.props.profile, this.props.t)}
{getPersonalInfo(this.props.profile, this.props.t)}
{getAchievements(this.props.profile, this.props.t)}
{getMemberships(this.props.profile.achievements, this.props.t('Achievements for Thalia'), this.props.t)}
{getMemberships(this.props.profile.societies, this.props.t('Societies'), this.props.t)}
</View>
</ScrollView>
{this.getAppbar()}
......@@ -314,6 +315,16 @@ ProfileScreen.propTypes = {
role: PropTypes.string,
})),
})).isRequired,
societies: PropTypes.arrayOf(PropTypes.shape({
name: PropTypes.string.isRequired,
earliest: PropTypes.string,
periods: PropTypes.arrayOf(PropTypes.shape({
chair: PropTypes.bool.isRequired,
until: PropTypes.string,
since: PropTypes.string.isRequired,
role: PropTypes.string,
})),
})).isRequired,
}).isRequired,
success: PropTypes.bool.isRequired,
hasLoaded: PropTypes.bool.isRequired,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment