mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
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:
+15
-11
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user