Merge pull request #18127 from overleaf/rd-bs-modal

[web] - Migrate the Modal to Bootstrap 5 on the Account Settings page

GitOrigin-RevId: 90799125f837742b4887eab762ca9ff84a67e70b
This commit is contained in:
Rebeka Dekany
2024-05-15 08:05:32 +00:00
committed by Copybot
parent 3ef06d57c6
commit ea826658a0
12 changed files with 259 additions and 47 deletions
@@ -1,12 +1,16 @@
import { useCallback, useState, ReactNode } from 'react'
import { useTranslation } from 'react-i18next'
import AccessibleModal from '../../../../shared/components/accessible-modal'
import { Modal } from 'react-bootstrap'
import BadgeWrapper from '@/features/ui/components/bootstrap-5/wrappers/badge-wrapper'
import getMeta from '../../../../utils/meta'
import { sendMB } from '../../../../infrastructure/event-tracking'
import ButtonWrapper from '@/features/ui/components/bootstrap-5/wrappers/button-wrapper'
import { bsVersion } from '@/features/utils/bootstrap-5'
import OLModal, {
OLModalBody,
OLModalFooter,
OLModalHeader,
OLModalTitle,
} from '@/features/ui/components/bootstrap-5/wrappers/ol-modal'
function trackUpgradeClick(integration: string) {
sendMB('settings-upgrade-click', { integration })
@@ -201,16 +205,16 @@ function UnlinkConfirmationModal({
}
return (
<AccessibleModal show={show} onHide={handleHide}>
<Modal.Header closeButton>
<Modal.Title>{title}</Modal.Title>
</Modal.Header>
<OLModal show={show} onHide={handleHide}>
<OLModalHeader closeButton>
<OLModalTitle>{title}</OLModalTitle>
</OLModalHeader>
<Modal.Body className="modal-body-share">
<OLModalBody>
<p>{content}</p>
</Modal.Body>
</OLModalBody>
<Modal.Footer>
<OLModalFooter>
<form action={unlinkPath} method="POST" className="form-inline">
<input type="hidden" name="_csrf" value={getMeta('ol-csrfToken')} />
<ButtonWrapper
@@ -232,7 +236,7 @@ function UnlinkConfirmationModal({
{t('unlink')}
</ButtonWrapper>
</form>
</Modal.Footer>
</AccessibleModal>
</OLModalFooter>
</OLModal>
)
}
@@ -1,14 +1,18 @@
import { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { Modal } from 'react-bootstrap'
import { FetchError } from '../../../../infrastructure/fetch-json'
import AccessibleModal from '../../../../shared/components/accessible-modal'
import IEEELogo from '../../../../shared/svgs/ieee-logo'
import GoogleLogo from '../../../../shared/svgs/google-logo'
import OrcidLogo from '../../../../shared/svgs/orcid-logo'
import LinkingStatus from './status'
import ButtonWrapper from '@/features/ui/components/bootstrap-5/wrappers/button-wrapper'
import { bsVersion } from '@/features/utils/bootstrap-5'
import OLModal, {
OLModalBody,
OLModalFooter,
OLModalHeader,
OLModalTitle,
} from '@/features/ui/components/bootstrap-5/wrappers/ol-modal'
const providerLogos: { readonly [p: string]: JSX.Element } = {
collabratec: <IEEELogo />,
@@ -165,18 +169,18 @@ function UnlinkConfirmModal({
const { t } = useTranslation()
return (
<AccessibleModal show={show} onHide={handleHide}>
<Modal.Header closeButton>
<Modal.Title>
<OLModal show={show} onHide={handleHide}>
<OLModalHeader closeButton>
<OLModalTitle>
{t('unlink_provider_account_title', { provider: title })}
</Modal.Title>
</Modal.Header>
</OLModalTitle>
</OLModalHeader>
<Modal.Body className="modal-body-share">
<OLModalBody>
<p>{t('unlink_provider_account_warning', { provider: title })}</p>
</Modal.Body>
</OLModalBody>
<Modal.Footer>
<OLModalFooter>
<ButtonWrapper
variant="secondary"
onClick={handleHide}
@@ -194,7 +198,7 @@ function UnlinkConfirmModal({
>
{t('unlink')}
</ButtonWrapper>
</Modal.Footer>
</AccessibleModal>
</OLModalFooter>
</OLModal>
)
}