overleaf/services/web/frontend/js/features/share-project-modal/components/send-invites-notice.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

32 lines
802 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 project = useProjectContext()
return (
<Row className="public-access-level public-access-level--notice">
<Col xs={12} className="text-center">
<AccessLevel level={project.publicAccesLevel} />
</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,
}