overleaf/services/web/frontend/js/features/share-project-modal/components/share-modal-body.js
Alf Eaton d9576189a3 Merge pull request #3636 from overleaf/ae-share-modal-split
Migrate Share modal to React

GitOrigin-RevId: 96a52df6ffd751cfcca2bbb68eb9e7a6dc31ff28
2021-03-13 03:05:10 +00:00

40 lines
998 B
JavaScript

import React from 'react'
import {
useProjectContext,
useShareProjectContext
} from './share-project-modal'
import EditMember from './edit-member'
import LinkSharing from './link-sharing'
import Invite from './invite'
import SendInvites from './send-invites'
import ViewMember from './view-member'
import OwnerInfo from './owner-info'
import SendInvitesNotice from './send-invites-notice'
export default function ShareModalBody() {
const { isAdmin } = useShareProjectContext()
const project = useProjectContext()
return (
<>
{isAdmin && <LinkSharing />}
<OwnerInfo />
{project.members.map(member =>
isAdmin ? (
<EditMember key={member._id} member={member} />
) : (
<ViewMember key={member._id} member={member} />
)
)}
{project.invites.map(invite => (
<Invite key={invite._id} invite={invite} isAdmin={isAdmin} />
))}
{isAdmin ? <SendInvites /> : <SendInvitesNotice />}
</>
)
}