diff --git a/src/App.js b/src/App.js index c6352c53..4cea5913 100644 --- a/src/App.js +++ b/src/App.js @@ -232,6 +232,22 @@ export default function App() { forceUpdate()}} /> } Hide colored backgrounds? + + { localStorage.getItem('expandcards') ? + { + localStorage.removeItem('expandcards'); + forceUpdate()}} /> : + { + localStorage.setItem('expandcards', 'true') + forceUpdate()}} /> } + Expand member cards on default? + diff --git a/src/Components/MemberCard.js b/src/Components/MemberCard.js index d9b8d8d6..71086e20 100644 --- a/src/Components/MemberCard.js +++ b/src/Components/MemberCard.js @@ -219,31 +219,8 @@ export default function MemberCard(props) { document.body.removeChild(textField); } - return ( - memberDeleted ? Member Deleted : - - -
{ member.visibility === 'public' ? - Copy public link - - }> copyLink()}> : - } - { localStorage.getItem('pagesonly') ? - {member.name} ({member.id}) - : {member.name} ({member.id})}
- { member.avatar_url ? } className="avatar" modal> - {close => ( -
close()}> -
- -
-
- )} -
: - } -
- + function renderCard() { + return ( { errorAlert ? Something went wrong, please try logging in and out again. : "" } { editMode ? @@ -414,7 +391,36 @@ export default function MemberCard(props) { { localStorage.getItem('twemoji') ?

:

} { proxyView ? "" : privacyMode ? "" : privacyView ? "" : <> setEditMode(true)}>Edit View page } }
-
+ ) + } + + return ( + memberDeleted ? Member Deleted : + + +
{ member.visibility === 'public' ? + Copy public link + + }> copyLink()}> : + } + { localStorage.getItem('pagesonly') ? + {member.name} ({member.id}) + : {member.name} ({member.id})}
+ { member.avatar_url ? } className="avatar" modal> + {close => ( +
close()}> +
+ +
+
+ )} +
: + } +
+ {localStorage.getItem("expandcards") ? renderCard() : + {renderCard()} + }
) diff --git a/src/Components/Memberlist.js b/src/Components/Memberlist.js index 61e07326..6ca8ffb0 100644 --- a/src/Components/Memberlist.js +++ b/src/Components/Memberlist.js @@ -47,7 +47,7 @@ export default function Memberlist() { const fetchMembers = useCallback( () => { setIsLoading(true); setIsError(false); - setMembersPerPage(25); + setMembersPerPage(localStorage.getItem("expandcards") ? 10 : 25); fetch(`${API_URL}s/${userId}/members`,{ method: 'GET', @@ -135,7 +135,7 @@ export default function Memberlist() { sortMembers = currentMembers.sort((a, b) => a.created.localeCompare(b.created)).slice(indexOfFirstMember, indexOfLastMember); } - const memberList = sortMembers.map((member) => + const memberList = sortMembers.map((member) => setMembers(members.map(member => member.id === memberEdit.id ? Object.assign(member, memberEdit) : member))} @@ -179,7 +179,7 @@ export default function Memberlist() { - { + { setMembersPerPage(e.target.value); setCurrentPage(1); }}> diff --git a/src/Components/ProfileCard.js b/src/Components/ProfileCard.js index dd4ad348..dc597f4a 100644 --- a/src/Components/ProfileCard.js +++ b/src/Components/ProfileCard.js @@ -78,29 +78,8 @@ export default function MemberCard(props) { document.body.removeChild(textField); } - return ( - - -
- Copy link - - }> copyLink()}> - { localStorage.getItem('pagesonly') ? - {member.name} ({member.id}) - : {member.name} ({member.id})}
- { member.avatar_url ? } className="avatar" modal> - {close => ( -
close()}> -
- -
-
- )} -
: - } -
- + function renderCard() { + return ( ID: {member.id} @@ -123,7 +102,34 @@ export default function MemberCard(props) {

Description:

{ localStorage.getItem('twemoji') ?

:

} View page
-
+ ) + } + + return ( + + +
+ Copy link + + }> copyLink()}> + { localStorage.getItem('pagesonly') ? + {member.name} ({member.id}) + : {member.name} ({member.id})}
+ { member.avatar_url ? } className="avatar" modal> + {close => ( +
close()}> +
+ +
+
+ )} +
: + } +
+ {localStorage.getItem("expandcards") ? renderCard() : + {renderCard()} + }
) diff --git a/src/Components/ProfileList.js b/src/Components/ProfileList.js index 50b7d6dc..5f9537d4 100644 --- a/src/Components/ProfileList.js +++ b/src/Components/ProfileList.js @@ -29,7 +29,7 @@ export default function Memberlist() { const fetchMembers = useCallback( () => { setIsLoading(true); setIsError(false); - setMembersPerPage(25); + setMembersPerPage(localStorage.getItem("expandcards") ? 10 : 25); fetch(`${API_URL}s/${sysID}/members`,{ method: 'GET', @@ -102,7 +102,7 @@ export default function Memberlist() { sortMembers = currentMembers.sort((a, b) => a.id.localeCompare(b.id)).slice(indexOfFirstMember, indexOfLastMember); } - const memberList = sortMembers.map((member) => + const memberList = sortMembers.map((member) => @@ -118,7 +118,7 @@ export default function Memberlist() { - { + { setMembersPerPage(e.target.value); setCurrentPage(1); }}>