2021-03-12 05:23:46 -05:00
|
|
|
import { Col, Row } from 'react-bootstrap'
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
import { Trans } from 'react-i18next'
|
2021-06-25 04:13:17 -04:00
|
|
|
import { useProjectContext } from '../../../shared/context/project-context'
|
2021-03-12 05:23:46 -05:00
|
|
|
|
|
|
|
export default function SendInvitesNotice() {
|
2022-01-10 10:47:10 -05:00
|
|
|
const { publicAccessLevel } = useProjectContext()
|
2021-03-12 05:23:46 -05:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Row className="public-access-level public-access-level--notice">
|
|
|
|
<Col xs={12} className="text-center">
|
2022-01-10 10:47:10 -05:00
|
|
|
<AccessLevel level={publicAccessLevel} />
|
2021-03-12 05:23:46 -05:00
|
|
|
</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 = {
|
2021-04-27 03:52:58 -04:00
|
|
|
level: PropTypes.string,
|
2021-03-12 05:23:46 -05:00
|
|
|
}
|