Files
overleaf/services/web/frontend/js/features/share-project-modal/components/view-only-access-modal-content.tsx
Rebeka Dekany 19b38340ac Consistent usage of the modal header close button (#28681)
* Convert OLModal to named exports only

* Make closeButton the default for OLModalHeader

* Set `closeButton={false}` for modal that is not dismissible

* Fix duplicated imports

* Remove another unnecessary `closeButton` prop

* Fix import

---------

Co-authored-by: Antoine Clausse <antoine.clausse@overleaf.com>
GitOrigin-RevId: ddd7be6e59a966ac634683d2494d6e9d2c3732e6
2025-09-30 08:05:24 +00:00

61 lines
1.5 KiB
TypeScript

import { useTranslation } from 'react-i18next'
import { sendMB } from '@/infrastructure/event-tracking'
import OLButton from '@/shared/components/ol/ol-button'
import {
OLModalBody,
OLModalFooter,
OLModalHeader,
OLModalTitle,
} from '@/shared/components/ol/ol-modal'
type ViewOnlyAccessModalContentProps = {
handleHide: () => void
}
export default function ViewOnlyAccessModalContent({
handleHide,
}: ViewOnlyAccessModalContentProps) {
const { t } = useTranslation()
return (
<>
<OLModalHeader>
<OLModalTitle>{t('view_only_access')}</OLModalTitle>
</OLModalHeader>
<OLModalBody>
<p>{t('this_project_already_has_maximum_collaborators')}</p>
<p>{t('please_ask_the_project_owner_to_upgrade_more_collaborators')}</p>
</OLModalBody>
<OLModalFooter>
<OLButton
variant="secondary"
href="/blog/changes-to-project-sharing"
target="_blank"
rel="noreferrer"
onClick={() => {
sendMB('notification-click', {
name: 'link-sharing-collaborator-limit',
button: 'learn',
})
}}
>
{t('learn_more')}
</OLButton>
<OLButton
variant="primary"
onClick={() => {
sendMB('notification-click', {
name: 'link-sharing-collaborator-limit',
button: 'ok',
})
handleHide()
}}
>
{t('ok')}
</OLButton>
</OLModalFooter>
</>
)
}