overleaf/services/web/frontend/js/features/share-project-modal/components/share-modal-body.js
Miguel Serrano b7802674d5 Merge pull request #4245 from overleaf/msm-extract-project-context
React `project-context`

GitOrigin-RevId: 6a23437d6e6a328ff5854622ff903d348db1f8b8
2021-06-26 02:05:49 +00:00

37 lines
1 KiB
JavaScript

import { 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'
import { useProjectContext } from '../../../shared/context/project-context'
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 />}
</>
)
}