overleaf/services/web/frontend/js/features/settings/components/leave-section.tsx
Timothée Alby b289afe23c Merge pull request #7725 from overleaf/ta-settings-fixes
[SettingsPage] Misc Fixes

GitOrigin-RevId: 56f58d2bb5830f7e0584a83c98efc9989ae2bd42
2022-04-26 08:04:18 +00:00

29 lines
695 B
TypeScript

import { useState, useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import LeaveModal from './leave/modal'
function LeaveSection() {
const { t } = useTranslation()
const [isModalOpen, setIsModalOpen] = useState(false)
const handleClose = useCallback(() => {
setIsModalOpen(false)
}, [])
const handleOpen = useCallback(() => {
setIsModalOpen(true)
}, [])
return (
<>
{t('need_to_leave')}{' '}
<button className="btn btn-inline-link btn-danger" onClick={handleOpen}>
{t('delete_your_account')}
</button>
<LeaveModal isOpen={isModalOpen} handleClose={handleClose} />
</>
)
}
export default LeaveSection