mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #20514 from overleaf/tm-pending-editor-sorting
Sort members in share modal list by editors > pending > viewers GitOrigin-RevId: 7e2e3acb69ffaddbddc7bacfe3258e149c717aeb
This commit is contained in:
parent
267109aa9a
commit
5ebeab3d42
1 changed files with 11 additions and 1 deletions
|
@ -72,6 +72,16 @@ export default function ShareModalBody() {
|
||||||
)
|
)
|
||||||
}, [features, isProjectOwner, members])
|
}, [features, isProjectOwner, members])
|
||||||
|
|
||||||
|
const sortedMembers = useMemo(() => {
|
||||||
|
return [
|
||||||
|
...members.filter(member => member.privileges === 'readAndWrite'),
|
||||||
|
...members.filter(member => member.pendingEditor),
|
||||||
|
...members.filter(
|
||||||
|
member => !member.pendingEditor && member.privileges !== 'readAndWrite'
|
||||||
|
),
|
||||||
|
]
|
||||||
|
}, [members])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{isProjectOwner ? (
|
{isProjectOwner ? (
|
||||||
|
@ -88,7 +98,7 @@ export default function ShareModalBody() {
|
||||||
|
|
||||||
<OwnerInfo />
|
<OwnerInfo />
|
||||||
|
|
||||||
{members.map(member =>
|
{sortedMembers.map(member =>
|
||||||
isProjectOwner ? (
|
isProjectOwner ? (
|
||||||
<EditMember
|
<EditMember
|
||||||
key={member._id}
|
key={member._id}
|
||||||
|
|
Loading…
Reference in a new issue