2021-06-25 04:13:17 -04:00
|
|
|
import { useShareProjectContext } from './share-project-modal'
|
2021-03-12 05:23:46 -05:00
|
|
|
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'
|
2021-06-25 04:13:17 -04:00
|
|
|
import { useProjectContext } from '../../../shared/context/project-context'
|
2021-08-19 11:42:49 -04:00
|
|
|
import { useSplitTestContext } from '../../../shared/context/split-test-context'
|
|
|
|
import { Row } from 'react-bootstrap'
|
|
|
|
import PropTypes from 'prop-types'
|
2021-08-19 05:37:18 -04:00
|
|
|
import RecaptchaConditions from '../../../shared/components/recaptcha-conditions'
|
2021-03-12 05:23:46 -05:00
|
|
|
|
|
|
|
export default function ShareModalBody() {
|
|
|
|
const { isAdmin } = useShareProjectContext()
|
2021-08-19 11:42:49 -04:00
|
|
|
const { splitTestVariants } = useSplitTestContext({
|
|
|
|
splitTestVariants: PropTypes.object,
|
|
|
|
})
|
2021-03-12 05:23:46 -05:00
|
|
|
|
2022-01-10 10:47:10 -05:00
|
|
|
const { invites, members } = useProjectContext()
|
2021-03-12 05:23:46 -05:00
|
|
|
|
2021-08-19 11:42:49 -04:00
|
|
|
switch (splitTestVariants['project-share-modal-paywall']) {
|
|
|
|
case 'new-copy-top':
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{isAdmin ? (
|
|
|
|
<>
|
|
|
|
<SendInvites />
|
|
|
|
<Row className="public-access-level" />
|
|
|
|
</>
|
|
|
|
) : (
|
|
|
|
<SendInvitesNotice />
|
|
|
|
)}
|
|
|
|
|
|
|
|
<OwnerInfo />
|
|
|
|
|
2022-01-10 10:47:10 -05:00
|
|
|
{members.map(member =>
|
2021-08-19 11:42:49 -04:00
|
|
|
isAdmin ? (
|
|
|
|
<EditMember key={member._id} member={member} />
|
|
|
|
) : (
|
|
|
|
<ViewMember key={member._id} member={member} />
|
|
|
|
)
|
|
|
|
)}
|
|
|
|
|
2022-01-10 10:47:10 -05:00
|
|
|
{invites.map(invite => (
|
2021-08-19 11:42:49 -04:00
|
|
|
<Invite key={invite._id} invite={invite} isAdmin={isAdmin} />
|
|
|
|
))}
|
|
|
|
|
|
|
|
{isAdmin && (
|
|
|
|
<>
|
|
|
|
<br />
|
|
|
|
<LinkSharing />
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
|
|
|
|
{!window.ExposedSettings.recaptchaDisabled?.invite && (
|
|
|
|
<RecaptchaConditions />
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
case 'new-copy-middle':
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<OwnerInfo />
|
|
|
|
|
2022-01-10 10:47:10 -05:00
|
|
|
{members.map(member =>
|
2021-08-19 11:42:49 -04:00
|
|
|
isAdmin ? (
|
|
|
|
<EditMember key={member._id} member={member} />
|
|
|
|
) : (
|
|
|
|
<ViewMember key={member._id} member={member} />
|
|
|
|
)
|
|
|
|
)}
|
|
|
|
|
2022-01-10 10:47:10 -05:00
|
|
|
{invites.map(invite => (
|
2021-08-19 11:42:49 -04:00
|
|
|
<Invite key={invite._id} invite={invite} isAdmin={isAdmin} />
|
|
|
|
))}
|
|
|
|
|
|
|
|
{isAdmin ? <SendInvites /> : <SendInvitesNotice />}
|
|
|
|
|
|
|
|
{isAdmin && (
|
|
|
|
<>
|
|
|
|
<br />
|
|
|
|
<LinkSharing />
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
|
|
|
|
{!window.ExposedSettings.recaptchaDisabled?.invite && (
|
|
|
|
<RecaptchaConditions />
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
case 'new-copy-bottom':
|
|
|
|
case 'default':
|
|
|
|
default:
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{isAdmin && <LinkSharing />}
|
|
|
|
|
|
|
|
<OwnerInfo />
|
|
|
|
|
2022-01-10 10:47:10 -05:00
|
|
|
{members.map(member =>
|
2021-08-19 11:42:49 -04:00
|
|
|
isAdmin ? (
|
|
|
|
<EditMember key={member._id} member={member} />
|
|
|
|
) : (
|
|
|
|
<ViewMember key={member._id} member={member} />
|
|
|
|
)
|
|
|
|
)}
|
|
|
|
|
2022-01-10 10:47:10 -05:00
|
|
|
{invites.map(invite => (
|
2021-08-19 11:42:49 -04:00
|
|
|
<Invite key={invite._id} invite={invite} isAdmin={isAdmin} />
|
|
|
|
))}
|
|
|
|
|
|
|
|
{isAdmin ? <SendInvites /> : <SendInvitesNotice />}
|
|
|
|
|
|
|
|
{!window.ExposedSettings.recaptchaDisabled?.invite && (
|
|
|
|
<RecaptchaConditions />
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
2021-03-12 05:23:46 -05:00
|
|
|
}
|