Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
ThaliApp
Commits
8c315b9c
Commit
8c315b9c
authored
Dec 12, 2018
by
Gijs Hendriksen
Browse files
Added societies to the profile screen
parent
e9e97b21
Changes
5
Hide whitespace changes
Inline
Side-by-side
__tests__/assets/locales/__snapshots__/index.js.spec.js.snap
View file @
8c315b9c
...
...
@@ -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.",
...
...
__tests__/reducers/__snapshots__/profile.spec.js.snap
View file @
8c315b9c
...
...
@@ -18,6 +18,7 @@ Object {
"pk": -1,
"profile_description": "",
"programme": "",
"societies": Array [],
"starting_year": -1,
"website": "",
},
...
...
app/assets/locales/nl/app/ui/screens/profile/ProfileScreen.json
View file @
8c315b9c
...
...
@@ -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"
}
app/reducers/profile.js
View file @
8c315b9c
...
...
@@ -20,6 +20,7 @@ const initialState = {
website
:
''
,
membership_type
:
''
,
achievements
:
[],
societies
:
[],
},
success
:
false
,
hasLoaded
:
false
,
...
...
app/ui/screens/profile/ProfileScreen.js
View file @
8c315b9c
...
...
@@ -98,13 +98,13 @@ const getPersonalInfo = (profile, t) => {
return
<
View
/>
;
};
const
get
Achievements
=
(
profile
,
t
)
=>
{
if
(
profile
.
achievement
s
.
length
)
{
const
get
Memberships
=
(
memberships
,
sectionHeader
,
t
)
=>
{
if
(
membership
s
.
length
)
{
return
(
<
CardSection
sectionHeader
=
{
t
(
'
Achievements for Thalia
'
)
}
sectionHeader
=
{
sectionHeader
}
>
{
profile
.
achievement
s
.
map
((
achievement
,
i
)
=>
(
{
membership
s
.
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
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment