From 82b529eb6a796e7a61ba7b74cb56e944b3e7ca6a Mon Sep 17 00:00:00 2001 From: Spectralitree Date: Wed, 13 Jan 2021 16:24:10 +0100 Subject: [PATCH] some tweaks --- src/Components/MemberPages.js | 6 +++--- src/Components/ProfilePages.js | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Components/MemberPages.js b/src/Components/MemberPages.js index 0d5378e9..f41af1de 100644 --- a/src/Components/MemberPages.js +++ b/src/Components/MemberPages.js @@ -1,18 +1,18 @@ -import React, { useState, useEffect } from 'react'; +import React, { useEffect } from 'react'; import * as BS from 'react-bootstrap'; import { useParams } from "react-router-dom"; import MemberPage from './MemberPage.js' export default function MemberPages(props) { const { memberID } = useParams(); - const [ noMatch, setNoMatch ] = useState(false); + const memberpages = props.members.filter((member) => member.id === memberID) const memberpage = memberpages.map((member) => ) + const noMatch = memberpages.length === 0; useEffect (() => { if (memberpages.length === 0) { - setNoMatch(true); } }, [memberpages]) diff --git a/src/Components/ProfilePages.js b/src/Components/ProfilePages.js index facdb2ec..321c08da 100644 --- a/src/Components/ProfilePages.js +++ b/src/Components/ProfilePages.js @@ -1,18 +1,17 @@ -import React, { useState, useEffect } from 'react'; +import React, { useEffect } from 'react'; import * as BS from 'react-bootstrap'; import { useParams } from "react-router-dom"; import ProfilePage from './ProfilePage.js' export default function MemberPages(props) { const { memberID } = useParams(); - const [ noMatch, setNoMatch ] = useState(false); const memberpages = props.members.filter((member) => member.id === memberID) const memberpage = memberpages.map((member) => ) + const noMatch = memberpages.length === 0; useEffect (() => { if (memberpages.length === 0) { - setNoMatch(true); } }, [memberpages])