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
fc618195
Commit
fc618195
authored
Jun 14, 2017
by
Gijs Hendriksen
Browse files
Move regex outside of render function
parent
96a5d099
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/components/MemberView.js
View file @
fc618195
...
...
@@ -7,9 +7,10 @@ import { url } from '../url';
import
styles
from
'
./style/memberView
'
;
import
SquareView
from
'
./SquareView
'
;
const
regex
=
new
RegExp
(
`^(
${
url
}
/media/public)/(avatars/[^\\.]+)\\.(jpg|jpeg|png|gif)`
);
const
MemberView
=
(
props
)
=>
{
let
photo
=
props
.
member
.
photo
;
const
regex
=
new
RegExp
(
`^(
${
url
}
/media/public)/(avatars/[^\\.]+)\\.(jpg|jpeg|png|gif)`
);
const
matches
=
regex
.
exec
(
photo
);
if
(
matches
)
{
...
...
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