remove unused useEffect hook

This commit is contained in:
Spectralitree 2021-08-08 12:16:56 +02:00
parent 7c3bd6eaec
commit 3fea63302d
2 changed files with 3 additions and 13 deletions

View File

@ -1,4 +1,4 @@
import React, { useEffect } from 'react'; import React from 'react';
import * as BS from 'react-bootstrap'; import * as BS from 'react-bootstrap';
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import MemberPage from '../Components/Private/MemberPage.js' import MemberPage from '../Components/Private/MemberPage.js'
@ -11,11 +11,6 @@ export default function MemberPages(props) {
const memberpage = memberpages.map((member) => <MemberPage key={member.id} member={member} edit={props.edit}/>) const memberpage = memberpages.map((member) => <MemberPage key={member.id} member={member} edit={props.edit}/>)
const noMatch = memberpages.length === 0; const noMatch = memberpages.length === 0;
useEffect (() => {
if (memberpages.length === 0) {
}
}, [memberpages])
if (noMatch) return ( if (noMatch) return (
<BS.Alert variant="danger">You do not have a member with the ID '{memberID}' in your system. Please check the ID again.</BS.Alert> <BS.Alert variant="danger">You do not have a member with the ID '{memberID}' in your system. Please check the ID again.</BS.Alert>
) )

View File

@ -1,4 +1,4 @@
import React, { useEffect } from 'react'; import React from 'react';
import * as BS from 'react-bootstrap'; import * as BS from 'react-bootstrap';
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import ProfilePage from '../Components/Public/ProfilePage.js' import ProfilePage from '../Components/Public/ProfilePage.js'
@ -7,14 +7,9 @@ export default function MemberPages(props) {
const { memberID } = useParams(); const { memberID } = useParams();
const memberpages = props.members.filter((member) => member.id === memberID) const memberpages = props.members.filter((member) => member.id === memberID)
const memberpage = memberpages.map((member) => <ProfilePage key={member.id} member={member}/>) const memberpage = memberpages.map((member) => <ProfilePage key={member.id} member={member} list={true}/>)
const noMatch = memberpages.length === 0; const noMatch = memberpages.length === 0;
useEffect (() => {
if (memberpages.length === 0) {
}
}, [memberpages])
if (noMatch) return ( if (noMatch) return (
<BS.Alert variant="danger">This system does not have a member with the ID '{memberID}', or the member's visibility is set to private.</BS.Alert> <BS.Alert variant="danger">This system does not have a member with the ID '{memberID}', or the member's visibility is set to private.</BS.Alert>
) )