Commit fc618195 authored by Gijs Hendriksen's avatar Gijs Hendriksen
Browse files

Move regex outside of render function

parent 96a5d099
......@@ -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) {
......
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