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
2a3ed733
Commit
2a3ed733
authored
Aug 29, 2018
by
Gijs Hendriksen
Browse files
Merge branch 'use-cardsection-in-profile' into 'master'
Use CardSection in Profile See merge request
!184
parents
33122a37
8a51160f
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/ui/components/cardSection/style/CardSection.js
View file @
2a3ed733
...
...
@@ -22,8 +22,8 @@ const styles = StyleSheet.create({
},
card
:
{
backgroundColor
:
Colors
.
white
,
elevation
:
2
,
android
:
{
elevation
:
2
,
borderRadius
:
2
,
},
ios
:
{
...
...
app/ui/screens/user/Profile.js
View file @
2a3ed733
...
...
@@ -18,12 +18,12 @@ import { back } from '../../../actions/navigation';
import
{
STATUSBAR_HEIGHT
}
from
'
../../components/standardHeader/style/StandardHeader
'
;
import
styles
,
{
HEADER_MIN_HEIGHT
,
HEADER_MAX_HEIGHT
,
HEADER_SCROLL_DISTANCE
}
from
'
./style/Profile
'
;
import
CardSection
from
'
../../components/cardSection/CardSection
'
;
const
getDescription
=
(
profile
,
t
)
=>
([
<
Text
style
=
{[
styles
.
sectionHeader
,
styles
.
marginTop
]}
key
=
"
title
"
>
{
`
${
t
(
'
About
'
)}
${
profile
.
display_name
}
`
}
<
/Text>
,
<
View
style
=
{
styles
.
card
}
key
=
"
content
"
>
const
getDescription
=
(
profile
,
t
)
=>
(
<
CardSection
sectionHeader
=
{
`
${
t
(
'
About
'
)}
${
profile
.
display_name
}
`
}
>
<
Text
style
=
{[
styles
.
data
,
...
...
@@ -33,8 +33,8 @@ const getDescription = (profile, t) => ([
>
{
profile
.
profile_description
||
t
(
'
This member has not written a description yet.
'
)}
<
/Text
>
<
/
View>
,
]
);
<
/
CardSection
>
);
const
getPersonalInfo
=
(
profile
,
t
)
=>
{
const
profileInfo
=
{
...
...
@@ -67,11 +67,8 @@ const getPersonalInfo = (profile, t) => {
}).
filter
(
n
=>
n
);
if
(
profileData
)
{
return
[
<
Text
style
=
{
styles
.
sectionHeader
}
key
=
"
title
"
>
{
t
(
'
Personal information
'
)}
<
/Text>
,
<
View
style
=
{
styles
.
card
}
key
=
"
content
"
>
return
(
<
CardSection
sectionHeader
=
{
t
(
'
Personal information
'
)}
>
{
profileData
.
map
((
item
,
i
)
=>
(
<
View
style
=
{[
styles
.
item
,
i
!==
0
&&
styles
.
borderTop
]}
key
=
{
item
.
title
}
>
<
Text
style
=
{
styles
.
description
}
>
...
...
@@ -85,19 +82,18 @@ const getPersonalInfo = (profile, t) => {
<
/Text
>
<
/View
>
))}
<
/
View>
,
]
;
<
/
CardSection
>
)
;
}
return
<
View
/>
;
};
const
getAchievements
=
(
profile
,
t
)
=>
{
if
(
profile
.
achievements
.
length
)
{
return
[
<
Text
style
=
{
styles
.
sectionHeader
}
key
=
"
title
"
>
{
t
(
'
Achievements for Thalia
'
)}
<
/Text>
,
<
View
style
=
{
styles
.
card
}
key
=
"
content
"
>
return
(
<
CardSection
sectionHeader
=
{
t
(
'
Achievements for Thalia
'
)}
>
{
profile
.
achievements
.
map
((
achievement
,
i
)
=>
(
<
View
style
=
{[
styles
.
item
,
i
!==
0
&&
styles
.
borderTop
]}
key
=
{
achievement
.
name
}
>
<
Text
style
=
{
styles
.
description
}
>
...
...
@@ -124,8 +120,8 @@ const getAchievements = (profile, t) => {
})}
<
/View
>
))}
<
/
View>
,
]
;
<
/
CardSection
>
)
;
}
return
<
View
/>
;
};
...
...
app/ui/screens/user/style/Profile.js
View file @
2a3ed733
...
...
@@ -11,23 +11,6 @@ const styles = StyleSheet.create({
backgroundColor
:
Colors
.
background
,
flex
:
1
,
},
card
:
{
backgroundColor
:
Colors
.
white
,
marginLeft
:
8
,
marginRight
:
8
,
marginTop
:
10
,
marginBottom
:
10
,
ios
:
{
borderRadius
:
4
,
borderColor
:
Colors
.
lightGray
,
borderStyle
:
'
solid
'
,
borderWidth
:
0.5
,
},
android
:
{
elevation
:
2
,
borderRadius
:
2
,
},
},
profileText
:
{
ios
:
{
borderRadius
:
4
,
...
...
@@ -67,22 +50,6 @@ const styles = StyleSheet.create({
url
:
{
textDecorationLine
:
'
underline
'
,
},
sectionHeader
:
{
backgroundColor
:
Colors
.
background
,
fontSize
:
14
,
color
:
Colors
.
textColour
,
marginLeft
:
18
,
android
:
{
fontFamily
:
'
sans-serif-medium
'
,
},
ios
:
{
fontFamily
:
'
System
'
,
fontWeight
:
'
600
'
,
},
},
marginTop
:
{
marginTop
:
10
,
},
italics
:
{
fontStyle
:
'
italic
'
,
},
...
...
@@ -113,6 +80,8 @@ const styles = StyleSheet.create({
},
content
:
{
marginTop
:
HEADER_MAX_HEIGHT
,
padding
:
8
,
paddingTop
:
0
,
},
icon
:
{
fontSize
:
24
,
...
...
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