mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-10 06:39:01 +02:00
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
This commit is contained in:
+1
-1
@@ -89,7 +89,7 @@ export default function CloneProjectModalContent({
|
||||
|
||||
return (
|
||||
<>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('copy_project')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import React, { memo, useCallback, useState } from 'react'
|
||||
import CloneProjectModalContent from './clone-project-modal-content'
|
||||
import OLModal from '@/shared/components/ol/ol-modal'
|
||||
import { OLModal } from '@/shared/components/ol/ol-modal'
|
||||
import { ClonedProject } from '../../../../../types/project/dashboard/api'
|
||||
import { Tag } from '../../../../../app/src/Features/Tags/types'
|
||||
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ export default function DictionaryModalContent({
|
||||
|
||||
return (
|
||||
<>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('edit_dictionary')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import DictionaryModalContent from './dictionary-modal-content'
|
||||
import withErrorBoundary from '../../../infrastructure/error-boundary'
|
||||
import OLModal from '@/shared/components/ol/ol-modal'
|
||||
import { OLModal } from '@/shared/components/ol/ol-modal'
|
||||
|
||||
type DictionaryModalProps = {
|
||||
show?: boolean
|
||||
|
||||
+3
-2
@@ -3,7 +3,8 @@ import { useFileTreeActionable } from '../../contexts/file-tree-actionable'
|
||||
import FileTreeCreateFormProvider from '../../contexts/file-tree-create-form'
|
||||
import FileTreeModalCreateFileBody from '../file-tree-create/file-tree-modal-create-file-body'
|
||||
import FileTreeModalCreateFileFooter from '../file-tree-create/file-tree-modal-create-file-footer'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -22,7 +23,7 @@ export default function FileTreeModalCreateFile() {
|
||||
return (
|
||||
<FileTreeCreateFormProvider>
|
||||
<OLModal size="lg" onHide={cancel} show>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('add_files')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
+2
-1
@@ -4,7 +4,8 @@ import { useRefWithAutoFocus } from '../../../../shared/hooks/use-ref-with-auto-
|
||||
import { useFileTreeActionable } from '../../contexts/file-tree-actionable'
|
||||
import { DuplicateFilenameError } from '../../errors'
|
||||
import { isCleanFilename } from '../../util/safe-path'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import { useFileTreeActionable } from '../../contexts/file-tree-actionable'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
+2
-1
@@ -8,7 +8,8 @@ import {
|
||||
DuplicateFilenameError,
|
||||
DuplicateFilenameMoveError,
|
||||
} from '../../errors'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
+2
-1
@@ -5,7 +5,8 @@ import { useTranslation } from 'react-i18next'
|
||||
import { useLocation } from '@/shared/hooks/use-location'
|
||||
import { FetchError, postJSON } from '@/infrastructure/fetch-json'
|
||||
import { debugConsole } from '@/utils/debugging'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
+2
-1
@@ -5,7 +5,8 @@ import { useTranslation, Trans } from 'react-i18next'
|
||||
import { useLocation } from '@/shared/hooks/use-location'
|
||||
import { FetchError, postJSON } from '@/infrastructure/fetch-json'
|
||||
import { debugConsole } from '@/utils/debugging'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
+2
-1
@@ -8,7 +8,8 @@ import NotificationScrolledTo from '@/shared/components/notification-scrolled-to
|
||||
import { debugConsole } from '@/utils/debugging'
|
||||
import { GroupUserAlert } from '../../utils/types'
|
||||
import { useGroupMembersContext } from '../../context/group-members-context'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
+2
-1
@@ -3,7 +3,8 @@ import { useEffect, useState } from 'react'
|
||||
import OLForm from '@/shared/components/ol/ol-form'
|
||||
import OLFormGroup from '@/shared/components/ol/ol-form-group'
|
||||
import ModalError from './modal-error'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { forwardRef, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
+3
-2
@@ -1,6 +1,7 @@
|
||||
import { formatTime } from '@/features/utils/format-date'
|
||||
import { useMemo } from 'react'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -28,7 +29,7 @@ export function RestoreFileConfirmModal({
|
||||
|
||||
return (
|
||||
<OLModal show={show} onHide={onHide}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('restore_file_confirmation_title')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>
|
||||
|
||||
+3
-2
@@ -1,4 +1,5 @@
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -16,7 +17,7 @@ export function RestoreFileErrorModal({
|
||||
|
||||
return (
|
||||
<OLModal show onHide={resetErrorBoundary}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('restore_file_error_title')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>{t('restore_file_error_message')}</OLModalBody>
|
||||
|
||||
+3
-2
@@ -1,4 +1,5 @@
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -16,7 +17,7 @@ export function RestoreProjectErrorModal({
|
||||
|
||||
return (
|
||||
<OLModal show onHide={resetErrorBoundary}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>
|
||||
{t('an_error_occured_while_restoring_project')}
|
||||
</OLModalTitle>
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import HotkeysModalBottomText from './hotkeys-modal-bottom-text'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -29,7 +30,7 @@ export default function HotkeysModal({
|
||||
|
||||
return (
|
||||
<OLModal size="lg" onHide={handleHide} show={show} animation={animation}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('hotkeys')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
+3
-2
@@ -1,7 +1,8 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { memo, useEffect, useState } from 'react'
|
||||
import { useConnectionContext } from '@/features/ide-react/context/connection-context'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalHeader,
|
||||
OLModalTitle,
|
||||
@@ -55,7 +56,7 @@ function ForceDisconnected() {
|
||||
backdrop={false}
|
||||
keyboard={false}
|
||||
>
|
||||
<OLModalHeader>
|
||||
<OLModalHeader closeButton={false}>
|
||||
<OLModalTitle>{t('please_wait')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>
|
||||
|
||||
+3
-2
@@ -1,6 +1,7 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { memo } from 'react'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -32,7 +33,7 @@ function GenericConfirmModal({
|
||||
|
||||
return (
|
||||
<OLModal {...modalProps}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{title}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
+3
-2
@@ -1,6 +1,7 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { memo } from 'react'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -25,7 +26,7 @@ function GenericMessageModal({
|
||||
|
||||
return (
|
||||
<OLModal {...modalProps}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{title}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@ import { Trans, useTranslation } from 'react-i18next'
|
||||
import { memo, useState } from 'react'
|
||||
import { useLocation } from '@/shared/hooks/use-location'
|
||||
import OLButton from '@/shared/components/ol/ol-button'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -36,7 +37,7 @@ function OutOfSyncModal({ editorContent, show, onHide }: OutOfSyncModalProps) {
|
||||
backdrop={false}
|
||||
keyboard={false}
|
||||
>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('out_of_sync')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody className="modal-body-share">
|
||||
|
||||
+3
-2
@@ -1,4 +1,5 @@
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalHeader,
|
||||
OLModalTitle,
|
||||
@@ -37,7 +38,7 @@ const SettingsModal = () => {
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('settings')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody className="ide-settings-modal-body">
|
||||
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
import { useIdeRedesignSwitcherContext } from '@/features/ide-react/context/ide-redesign-switcher-context'
|
||||
import OLButton from '@/shared/components/ol/ol-button'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -50,7 +51,7 @@ export const IdeRedesignIntroModal: FC = () => {
|
||||
onHide={dismissTutorial}
|
||||
className="ide-redesign-switcher-modal"
|
||||
>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>
|
||||
{t('the_new_overleaf_editor_try_now_in_beta')}
|
||||
</OLModalTitle>
|
||||
@@ -99,7 +100,7 @@ export const IdeRedesignSwitcherModal = () => {
|
||||
onHide={onHide}
|
||||
className="ide-redesign-switcher-modal"
|
||||
>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>
|
||||
{enabled
|
||||
? t('beta_program_the_new_overleaf_editor')
|
||||
|
||||
+3
-2
@@ -9,7 +9,8 @@ import { createTag } from '../../util/api'
|
||||
import { MAX_TAG_LENGTH } from '../../util/tag'
|
||||
import { ColorPicker } from '../color-picker/color-picker'
|
||||
import { debugConsole } from '@/utils/debugging'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -80,7 +81,7 @@ export default function CreateTagModal({
|
||||
|
||||
return (
|
||||
<OLModal show animation onHide={onClose} id={id} backdrop="static">
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('create_new_tag')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
+3
-2
@@ -4,7 +4,8 @@ import { Tag } from '../../../../../../app/src/Features/Tags/types'
|
||||
import useAsync from '../../../../shared/hooks/use-async'
|
||||
import { deleteTag } from '../../util/api'
|
||||
import { debugConsole } from '@/utils/debugging'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -46,7 +47,7 @@ export default function DeleteTagModal({
|
||||
|
||||
return (
|
||||
<OLModal show animation onHide={onClose} id={id} backdrop="static">
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('delete_tag')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ import { editTag } from '../../util/api'
|
||||
import { getTagColor, MAX_TAG_LENGTH } from '../../util/tag'
|
||||
import { ColorPicker } from '../color-picker/color-picker'
|
||||
import { debugConsole } from '@/utils/debugging'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -88,7 +89,7 @@ export function EditTagModal({ id, tag, onEdit, onClose }: EditTagModalProps) {
|
||||
|
||||
return (
|
||||
<OLModal show animation onHide={onClose} id={id} backdrop="static">
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('edit_tag')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
+3
-2
@@ -8,7 +8,8 @@ import { Tag } from '../../../../../../app/src/Features/Tags/types'
|
||||
import { getTagColor } from '../../util/tag'
|
||||
import { ColorPicker } from '../color-picker/color-picker'
|
||||
import { debugConsole } from '@/utils/debugging'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -89,7 +90,7 @@ export function ManageTagModal({
|
||||
|
||||
return (
|
||||
<OLModal show animation onHide={onClose} id={id} backdrop="static">
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('edit_tag')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
+3
-2
@@ -7,7 +7,8 @@ import * as eventTracking from '../../../../infrastructure/event-tracking'
|
||||
import { isSmallDevice } from '../../../../infrastructure/event-tracking'
|
||||
import Notification from '@/shared/components/notification'
|
||||
import OLButton from '@/shared/components/ol/ol-button'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -79,7 +80,7 @@ function ProjectsActionModal({
|
||||
id="action-project-modal"
|
||||
backdrop="static"
|
||||
>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{title}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>
|
||||
|
||||
+3
-2
@@ -16,7 +16,8 @@ import { getUserFacingMessage } from '../../../../infrastructure/fetch-json'
|
||||
import { debugConsole } from '@/utils/debugging'
|
||||
import { isSmallDevice } from '../../../../infrastructure/event-tracking'
|
||||
import Notification from '@/shared/components/notification'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -104,7 +105,7 @@ function RenameProjectModal({
|
||||
id="rename-project-modal"
|
||||
backdrop="static"
|
||||
>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('rename_project')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import ModalContentNewProjectForm from './modal-content-new-project-form'
|
||||
import OLModal from '@/shared/components/ol/ol-modal'
|
||||
import { OLModal } from '@/shared/components/ol/ol-modal'
|
||||
|
||||
type BlankProjectModalProps = {
|
||||
onHide: () => void
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import OLModal from '@/shared/components/ol/ol-modal'
|
||||
import { OLModal } from '@/shared/components/ol/ol-modal'
|
||||
import ModalContentNewProjectForm from './modal-content-new-project-form'
|
||||
|
||||
type ExampleProjectModalProps = {
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ function ModalContentNewProjectForm({ onCancel, template = 'none' }: Props) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('new_project')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -94,7 +95,7 @@ function UploadProjectModal({ onHide, openProject }: UploadProjectModalProps) {
|
||||
id="upload-project-modal"
|
||||
backdrop="static"
|
||||
>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle as="h3">{t('upload_zipped_project')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>
|
||||
|
||||
+3
-2
@@ -2,7 +2,8 @@ import { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import bannerImage from '../../../images/brl-banner.png'
|
||||
import usePersistedState from '../../../../../shared/hooks/use-persisted-state'
|
||||
import * as eventTracking from '../../../../../infrastructure/event-tracking'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -90,7 +91,7 @@ export default function BRLBanner() {
|
||||
|
||||
return (
|
||||
<OLModal show={showModal} onHide={handleHide}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('latam_discount_modal_title')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>
|
||||
|
||||
+3
-2
@@ -3,7 +3,8 @@ import { useTranslation } from 'react-i18next'
|
||||
import bannerImage from '../../../images/inr-banner.png'
|
||||
import usePersistedState from '../../../../../shared/hooks/use-persisted-state'
|
||||
import * as eventTracking from '../../../../../infrastructure/event-tracking'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -88,7 +89,7 @@ export default function INRBanner() {
|
||||
|
||||
return (
|
||||
<OLModal show={showModal} onHide={handleHide} backdrop="static">
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('inr_discount_modal_title')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>
|
||||
|
||||
+3
-2
@@ -5,7 +5,8 @@ import clpBannerImage from '../../../images/clp-banner.png'
|
||||
import penBannerImage from '../../../images/pen-banner.png'
|
||||
import usePersistedState from '../../../../../shared/hooks/use-persisted-state'
|
||||
import * as eventTracking from '../../../../../infrastructure/event-tracking'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -133,7 +134,7 @@ export default function LATAMBanner() {
|
||||
|
||||
return (
|
||||
<OLModal show={showModal} onHide={handleHide} backdrop="static">
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('latam_discount_modal_title')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>
|
||||
|
||||
+3
-2
@@ -8,7 +8,8 @@ import { postJSON } from '../../../../../../infrastructure/fetch-json'
|
||||
import { isSmallDevice } from '../../../../../../infrastructure/event-tracking'
|
||||
import OLTooltip from '@/shared/components/ol/ol-tooltip'
|
||||
import OLButton from '@/shared/components/ol/ol-button'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -120,7 +121,7 @@ function CompileErrorModal({
|
||||
return (
|
||||
<>
|
||||
<OLModal show onHide={handleClose}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>
|
||||
{project.name}: {t('pdf_unavailable_for_download')}
|
||||
</OLModalTitle>
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
import { FC, memo } from 'react'
|
||||
import OLButton from '@/shared/components/ol/ol-button'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
+3
-2
@@ -5,7 +5,8 @@ import teaserVideo from '../images/teaser-track-changes.mp4'
|
||||
import teaserImage from '../images/teaser-track-changes.gif'
|
||||
import { startFreeTrial, upgradePlan } from '@/main/account-upgrade'
|
||||
import { memo } from 'react'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -31,7 +32,7 @@ function UpgradeTrackChangesModal({
|
||||
|
||||
return (
|
||||
<OLModal show={show} onHide={() => setShow(false)}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('upgrade_to_review')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody className="upgrade-track-changes-modal">
|
||||
|
||||
+3
-2
@@ -1,7 +1,8 @@
|
||||
import { useTranslation, Trans } from 'react-i18next'
|
||||
import { MergeAndOverride } from '../../../../../../../../types/utils'
|
||||
import OLButton from '@/shared/components/ol/ol-button'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -32,7 +33,7 @@ function ConfirmationModal({
|
||||
|
||||
return (
|
||||
<OLModal show={show} onHide={onHide}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('confirm_primary_email_change')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody className="pb-0">
|
||||
|
||||
+3
-2
@@ -4,7 +4,8 @@ import { FetchError, postJSON } from '@/infrastructure/fetch-json'
|
||||
import useAsync from '../../../../shared/hooks/use-async'
|
||||
import { UserEmailData } from '../../../../../../types/user-email'
|
||||
import OLButton from '@/shared/components/ol/ol-button'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -56,7 +57,7 @@ function ResendConfirmationCodeModal({
|
||||
id="action-project-modal"
|
||||
backdrop="static"
|
||||
>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('confirm_your_email')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ function LeaveModalContent({
|
||||
|
||||
return (
|
||||
<>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('delete_account')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useCallback } from 'react'
|
||||
import LeaveModalContent from './modal-content'
|
||||
import OLModal from '@/shared/components/ol/ol-modal'
|
||||
import { OLModal } from '@/shared/components/ol/ol-modal'
|
||||
|
||||
type LeaveModalProps = {
|
||||
isOpen: boolean
|
||||
|
||||
+3
-2
@@ -4,7 +4,8 @@ import OLBadge from '@/shared/components/ol/ol-badge'
|
||||
import getMeta from '../../../../utils/meta'
|
||||
import { sendMB } from '../../../../infrastructure/event-tracking'
|
||||
import OLButton from '@/shared/components/ol/ol-button'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -208,7 +209,7 @@ function UnlinkConfirmationModal({
|
||||
|
||||
return (
|
||||
<OLModal show={show} onHide={handleHide}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{title}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ import GoogleLogo from '../../../../shared/svgs/google-logo'
|
||||
import OrcidLogo from '../../../../shared/svgs/orcid-logo'
|
||||
import LinkingStatus from './status'
|
||||
import OLButton from '@/shared/components/ol/ol-button'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -168,7 +169,7 @@ function UnlinkConfirmModal({
|
||||
|
||||
return (
|
||||
<OLModal show={show} onHide={handleHide}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>
|
||||
{t('unlink_provider_account_title', { provider: title })}
|
||||
</OLModalTitle>
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ export default function EditorOverLimitModalContent({
|
||||
|
||||
return (
|
||||
<>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('do_you_need_edit_access')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import { useProjectContext } from '@/shared/context/project-context'
|
||||
import { useEditorContext } from '@/shared/context/editor-context'
|
||||
import { useIdeReactContext } from '@/features/ide-react/context/ide-react-context'
|
||||
import { sendMB } from '@/infrastructure/event-tracking'
|
||||
import OLModal from '@/shared/components/ol/ol-modal'
|
||||
import { OLModal } from '@/shared/components/ol/ol-modal'
|
||||
|
||||
const EditorOverLimitModal = () => {
|
||||
const [show, setShow] = useState(false)
|
||||
|
||||
+3
-2
@@ -3,7 +3,8 @@ import { useEditorContext } from '@/shared/context/editor-context'
|
||||
import { lazy, Suspense } from 'react'
|
||||
import { FullSizeLoadingSpinner } from '@/shared/components/loading-spinner'
|
||||
import ClickableElementEnhancer from '@/shared/components/clickable-element-enhancer'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -43,7 +44,7 @@ export default function ShareProjectModalContent({
|
||||
|
||||
return (
|
||||
<OLModal show={show} onHide={cancel} animation={animation}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('share_project')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
+3
-2
@@ -3,7 +3,8 @@ import { Trans, useTranslation } from 'react-i18next'
|
||||
import { transferProjectOwnership } from '../utils/api'
|
||||
import { useProjectContext } from '@/shared/context/project-context'
|
||||
import { useLocation } from '@/shared/hooks/use-location'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -45,7 +46,7 @@ export default function TransferOwnershipModal({
|
||||
|
||||
return (
|
||||
<OLModal show onHide={cancel}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('change_project_owner')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ export default function ViewOnlyAccessModalContent({
|
||||
|
||||
return (
|
||||
<>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('view_only_access')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import { useProjectContext } from '@/shared/context/project-context'
|
||||
import { useEditorContext } from '@/shared/context/editor-context'
|
||||
import { useIdeReactContext } from '@/features/ide-react/context/ide-react-context'
|
||||
import { sendMB } from '@/infrastructure/event-tracking'
|
||||
import OLModal from '@/shared/components/ol/ol-modal'
|
||||
import { OLModal } from '@/shared/components/ol/ol-modal'
|
||||
|
||||
const ViewOnlyAccessModal = () => {
|
||||
const [show, setShow] = useState(false)
|
||||
|
||||
+3
-2
@@ -1,4 +1,5 @@
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -273,7 +274,7 @@ const FigureModalContent = () => {
|
||||
}
|
||||
return (
|
||||
<OLModal onHide={hide} className="figure-modal" show>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>
|
||||
{helpShown
|
||||
? t('help')
|
||||
|
||||
@@ -5,7 +5,8 @@ import {
|
||||
DropdownToggle,
|
||||
} from '@/shared/components/dropdown/dropdown-menu'
|
||||
import OLButton from '@/shared/components/ol/ol-button'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
+3
-2
@@ -1,4 +1,5 @@
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -19,7 +20,7 @@ export const TableGeneratorHelpModal = () => {
|
||||
onHide={hideHelp}
|
||||
className="table-generator-help-modal"
|
||||
>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('help')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>
|
||||
|
||||
+3
-2
@@ -16,7 +16,8 @@ import { setColumnWidth } from '../commands'
|
||||
import { UNITS, WidthSelection, WidthUnit } from './column-width'
|
||||
import { useCodeMirrorViewContext } from '../../../codemirror-context'
|
||||
import { CopyToClipboard } from '@/shared/components/copy-to-clipboard'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -137,7 +138,7 @@ const ColumnWidthModalBody = () => {
|
||||
onHide={closeColumnWidthModal}
|
||||
className="table-generator-width-modal"
|
||||
>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('set_column_width')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>
|
||||
|
||||
+2
-1
@@ -4,7 +4,8 @@ import { deleteJSON } from '../../../../infrastructure/fetch-json'
|
||||
import { useSubscriptionDashboardContext } from '../../context/subscription-dashboard-context'
|
||||
import { useLocation } from '../../../../shared/hooks/use-location'
|
||||
import { debugConsole } from '@/utils/debugging'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
@@ -3,7 +3,8 @@ import { useSubscriptionDashboardContext } from '../../context/subscription-dash
|
||||
import { useCallback, useMemo, useState } from 'react'
|
||||
import { postJSON } from '@/infrastructure/fetch-json'
|
||||
import { useLocation } from '@/shared/hooks/use-location'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalHeader,
|
||||
} from '@/shared/components/ol/ol-modal'
|
||||
@@ -88,7 +89,7 @@ export default function PauseSubscriptionModal() {
|
||||
backdrop="static"
|
||||
>
|
||||
<OLModalBody>
|
||||
<OLModalHeader closeButton style={{ border: 0 }} />
|
||||
<OLModalHeader style={{ border: 0 }} />
|
||||
<img
|
||||
src={PauseDuck}
|
||||
alt="Need to duck out for a while?"
|
||||
|
||||
+2
-1
@@ -4,7 +4,8 @@ import { SubscriptionDashModalIds } from '../../../../../../../../../../types/su
|
||||
import { postJSON } from '../../../../../../../../infrastructure/fetch-json'
|
||||
import { useSubscriptionDashboardContext } from '../../../../../../context/subscription-dashboard-context'
|
||||
import { useLocation } from '../../../../../../../../shared/hooks/use-location'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
+3
-2
@@ -4,7 +4,8 @@ import LoadingSpinner from '../../../../../../../../shared/components/loading-sp
|
||||
import { useSubscriptionDashboardContext } from '../../../../../../context/subscription-dashboard-context'
|
||||
import { ChangeToGroupPlan } from '../change-to-group-plan'
|
||||
import { IndividualPlansTable } from '../individual-plans-table'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalHeader,
|
||||
OLModalTitle,
|
||||
@@ -43,7 +44,7 @@ export function ChangePlanModal() {
|
||||
|
||||
return (
|
||||
<OLModal id={modalId} show animation onHide={handleCloseModal} size="lg">
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('change_plan')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
|
||||
|
||||
+3
-2
@@ -12,7 +12,8 @@ import GenericErrorAlert from '../../../../generic-error-alert'
|
||||
import { subscriptionUpdateUrl } from '../../../../../../data/subscription-url'
|
||||
import { getRecurlyGroupPlanCode } from '../../../../../../util/recurly-group-plan-code'
|
||||
import { useLocation } from '../../../../../../../../shared/hooks/use-location'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -175,7 +176,7 @@ export function ChangeToGroupModal() {
|
||||
onHide={handleCloseModal}
|
||||
backdrop="static"
|
||||
>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle className="lh-sm">
|
||||
{t('customize_your_group_subscription')}
|
||||
{showGroupDiscount && (
|
||||
|
||||
+2
-1
@@ -9,7 +9,8 @@ import getMeta from '../../../../../../../../utils/meta'
|
||||
import { useSubscriptionDashboardContext } from '../../../../../../context/subscription-dashboard-context'
|
||||
import { subscriptionUpdateUrl } from '../../../../../../data/subscription-url'
|
||||
import { useLocation } from '../../../../../../../../shared/hooks/use-location'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
+2
-1
@@ -5,7 +5,8 @@ import { postJSON } from '../../../../../../../../infrastructure/fetch-json'
|
||||
import { useSubscriptionDashboardContext } from '../../../../../../context/subscription-dashboard-context'
|
||||
import { cancelPendingSubscriptionChangeUrl } from '../../../../../../data/subscription-url'
|
||||
import { useLocation } from '../../../../../../../../shared/hooks/use-location'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { SubscriptionDashModalIds } from '../../../../../../../../../../types/subscription/dashboard/modal-ids'
|
||||
import { useSubscriptionDashboardContext } from '../../../../../../context/subscription-dashboard-context'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
+2
-1
@@ -2,7 +2,8 @@ import { useState } from 'react'
|
||||
import { SubscriptionDashModalIds } from '../../../../../../../../types/subscription/dashboard/modal-ids'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { useSubscriptionDashboardContext } from '@/features/subscription/context/subscription-dashboard-context'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import OLButton from '@/shared/components/ol/ol-button'
|
||||
import OLModal, {
|
||||
import {
|
||||
OLModal,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
OLModalHeader,
|
||||
@@ -28,7 +29,7 @@ function LeaveProjectModal({
|
||||
id="action-project-modal"
|
||||
backdrop="static"
|
||||
>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{t('leave_project')}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ export default function WordCountModalContent({
|
||||
|
||||
return (
|
||||
<>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>
|
||||
{t('word_count_lower')}{' '}
|
||||
<SplitTestBadge
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { memo } from 'react'
|
||||
import WordCountModalContent from './word-count-modal-content'
|
||||
import withErrorBoundary from '../../../infrastructure/error-boundary'
|
||||
import OLModal from '@/shared/components/ol/ol-modal'
|
||||
import { OLModal } from '@/shared/components/ol/ol-modal'
|
||||
|
||||
const WordCountModal = memo(function WordCountModal({
|
||||
show,
|
||||
|
||||
@@ -12,12 +12,24 @@ type OLModalProps = ModalProps & {
|
||||
onHide: () => void
|
||||
}
|
||||
|
||||
export default function OLModal({ children, ...props }: OLModalProps) {
|
||||
type OLModalHeaderProps = ModalHeaderProps & {
|
||||
closeButton?: boolean
|
||||
}
|
||||
|
||||
export function OLModal({ children, ...props }: OLModalProps) {
|
||||
return <Modal {...props}>{children}</Modal>
|
||||
}
|
||||
|
||||
export function OLModalHeader({ children, ...props }: ModalHeaderProps) {
|
||||
return <Modal.Header {...props}>{children}</Modal.Header>
|
||||
export function OLModalHeader({
|
||||
children,
|
||||
closeButton = true,
|
||||
...props
|
||||
}: OLModalHeaderProps) {
|
||||
return (
|
||||
<Modal.Header closeButton={closeButton} {...props}>
|
||||
{children}
|
||||
</Modal.Header>
|
||||
)
|
||||
}
|
||||
|
||||
export function OLModalTitle({ children, ...props }: ModalTitleProps) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react'
|
||||
import { figmaDesignUrl } from '../../../.storybook/utils/figma-design-url'
|
||||
import OLModal, {
|
||||
import { figmaDesignUrl } from './../../../.storybook/utils/figma-design-url'
|
||||
import {
|
||||
OLModal,
|
||||
OLModalHeader,
|
||||
OLModalBody,
|
||||
OLModalFooter,
|
||||
@@ -99,7 +100,7 @@ const meta: Meta<typeof OLModal> = {
|
||||
},
|
||||
render: ({ title, children, footer, ...args }) => (
|
||||
<OLModal {...args}>
|
||||
<OLModalHeader closeButton>
|
||||
<OLModalHeader>
|
||||
<OLModalTitle>{title}</OLModalTitle>
|
||||
</OLModalHeader>
|
||||
<OLModalBody>{children}</OLModalBody>
|
||||
|
||||
Reference in New Issue
Block a user