overleaf/services/web/frontend/js/features/share-project-modal/components/send-invites-notice.js
Timothée Alby 6319455e91 Merge pull request #6236 from overleaf/ta-project-context-strict
Strict Project Context

GitOrigin-RevId: a0f7f2b3dcb29fbd0102dcb920cf5424a921d583
2022-01-11 09:05:03 +00:00

32 lines
809 B
JavaScript

import { Col, Row } from 'react-bootstrap'
import PropTypes from 'prop-types'
import { Trans } from 'react-i18next'
import { useProjectContext } from '../../../shared/context/project-context'
export default function SendInvitesNotice() {
const { publicAccessLevel } = useProjectContext()
return (
<Row className="public-access-level public-access-level--notice">
<Col xs={12} className="text-center">
<AccessLevel level={publicAccessLevel} />
</Col>
</Row>
)
}
function AccessLevel({ level }) {
switch (level) {
case 'private':
return <Trans i18nKey="to_add_more_collaborators" />
case 'tokenBased':
return <Trans i18nKey="to_change_access_permissions" />
default:
return null
}
}
AccessLevel.propTypes = {
level: PropTypes.string,
}