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
883d012f
Commit
883d012f
authored
Jun 14, 2017
by
Gijs Hendriksen
Browse files
Change profile image url to thumbnail url for MemberView
parent
1587949f
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/components/MemberView.js
View file @
883d012f
...
...
@@ -3,17 +3,28 @@ import PropTypes from 'prop-types';
import
{
Image
,
Text
,
ViewPropTypes
,
StyleSheet
}
from
'
react-native
'
;
import
LinearGradient
from
'
react-native-linear-gradient
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
url
}
from
'
../url
'
;
import
styles
from
'
./style/memberView
'
;
import
SquareView
from
'
./SquareView
'
;
const
MemberView
=
props
=>
(
<
SquareView
style
=
{
props
.
style
}
>
<
Image
style
=
{
styles
.
image
}
source
=
{{
uri
:
props
.
member
.
photo
}}
>
<
LinearGradient
colors
=
{[
'
#55000000
'
,
'
#000000
'
]}
style
=
{
styles
.
overlayGradient
}
/
>
<
Text
style
=
{
styles
.
nameText
}
>
{
props
.
member
.
name
}
<
/Text
>
<
/Image
>
<
/SquareView
>
const
MemberView
=
(
props
)
=>
{
let
photo
=
props
.
member
.
photo
;
const
regex
=
new
RegExp
(
`^(
${
url
}
/media/public)/(avatars/[^\\.]+)\\.(jpg|jpeg)`
);
const
matches
=
regex
.
exec
(
photo
);
if
(
matches
)
{
photo
=
`
${
matches
[
1
]}
/thumbnails/220x220_1/
${
matches
[
2
]}
.
${
matches
[
3
]}
`
;
}
return
(
<
SquareView
style
=
{
props
.
style
}
>
<
Image
style
=
{
styles
.
image
}
source
=
{{
uri
:
photo
}}
>
<
LinearGradient
colors
=
{[
'
#55000000
'
,
'
#000000
'
]}
style
=
{
styles
.
overlayGradient
}
/
>
<
Text
style
=
{
styles
.
nameText
}
>
{
props
.
member
.
name
}
<
/Text
>
<
/Image
>
<
/SquareView
>
);
};
MemberView
.
propTypes
=
{
member
:
PropTypes
.
shape
({
...
...
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