diff --git a/services/web/frontend/js/features/ide-react/components/alerts/alerts.tsx b/services/web/frontend/js/features/ide-react/components/alerts/alerts.tsx index 29e97a2137..507ecf45e5 100644 --- a/services/web/frontend/js/features/ide-react/components/alerts/alerts.tsx +++ b/services/web/frontend/js/features/ide-react/components/alerts/alerts.tsx @@ -2,10 +2,11 @@ import { useTranslation } from 'react-i18next' import { LostConnectionAlert } from './lost-connection-alert' import { useConnectionContext } from '@/features/ide-react/context/connection-context' import { debugging } from '@/utils/debugging' -import { Alert } from 'react-bootstrap' import useScopeValue from '@/shared/hooks/use-scope-value' import { createPortal } from 'react-dom' import { useGlobalAlertsContainer } from '@/features/ide-react/context/global-alerts-context' +import OLNotification from '@/features/ui/components/ol/ol-notification' +import OLButton from '@/features/ui/components/ol/ol-button' export function Alerts() { const { t } = useTranslation() @@ -27,9 +28,10 @@ export function Alerts() { return createPortal( <> {connectionState.forceDisconnected ? ( - - {t('disconnected')} - + {t('disconnected')}} + /> ) : null} {connectionState.reconnectAt ? ( @@ -40,23 +42,29 @@ export function Alerts() { ) : null} {isStillReconnecting ? ( - - {t('reconnecting')}… - + {t('reconnecting')}…} + /> ) : null} {synctexError ? ( - - {t('synctex_failed')} - - {t('more_info')} - - + {t('synctex_failed')}} + action={ + + {t('more_info')} + + } + /> ) : null} {connectionState.inactiveDisconnect || @@ -64,15 +72,19 @@ export function Alerts() { (connectionState.error === 'rate-limited' || connectionState.error === 'unable-to-connect') && !secondsUntilReconnect()) ? ( - - {t('editor_disconected_click_to_reconnect')} - + {t('editor_disconected_click_to_reconnect')} + } + /> ) : null} {debugging ? ( - - Connected: {isConnected.toString()} - + Connected: {isConnected.toString()}} + /> ) : null} , globalAlertsContainer diff --git a/services/web/frontend/js/features/ide-react/components/alerts/lost-connection-alert.tsx b/services/web/frontend/js/features/ide-react/components/alerts/lost-connection-alert.tsx index 6592491bab..5bafd16fb0 100644 --- a/services/web/frontend/js/features/ide-react/components/alerts/lost-connection-alert.tsx +++ b/services/web/frontend/js/features/ide-react/components/alerts/lost-connection-alert.tsx @@ -1,7 +1,8 @@ import { useTranslation } from 'react-i18next' import { useEffect, useState } from 'react' import { secondsUntil } from '@/features/ide-react/connection/utils' -import { Alert } from 'react-bootstrap' +import OLNotification from '@/features/ui/components/ol/ol-notification' +import OLButton from '@/features/ui/components/ol/ol-button' type LostConnectionAlertProps = { reconnectAt: number @@ -25,16 +26,25 @@ export function LostConnectionAlert({ }, [reconnectAt]) return ( - - {t('lost_connection')}{' '} - {t('reconnecting_in_x_secs', { seconds: secondsUntilReconnect })}. - - + + {t('lost_connection')}{' '} + {t('reconnecting_in_x_secs', { seconds: secondsUntilReconnect })}. + + } + action={ + tryReconnectNow()} + size="sm" + variant="secondary" + bs3Props={{ className: 'pull-right' }} + > + {t('try_now')} + + } + /> ) } diff --git a/services/web/frontend/js/features/ide-react/components/modals/force-disconnected.tsx b/services/web/frontend/js/features/ide-react/components/modals/force-disconnected.tsx index 0f8f50543a..11f6e0e86a 100644 --- a/services/web/frontend/js/features/ide-react/components/modals/force-disconnected.tsx +++ b/services/web/frontend/js/features/ide-react/components/modals/force-disconnected.tsx @@ -1,8 +1,11 @@ import { useTranslation } from 'react-i18next' -import { Modal } from 'react-bootstrap' -import AccessibleModal from '@/shared/components/accessible-modal' import { memo, useEffect, useState } from 'react' import { useConnectionContext } from '@/features/ide-react/context/connection-context' +import OLModal, { + OLModalBody, + OLModalHeader, + OLModalTitle, +} from '@/features/ui/components/ol/ol-modal' // show modal when editor is forcefully disconnected function ForceDisconnected() { @@ -40,7 +43,7 @@ function ForceDisconnected() { } return ( - {}} @@ -48,13 +51,13 @@ function ForceDisconnected() { backdrop={false} keyboard={false} > - - {t('please_wait')} - - + + {t('please_wait')} + + {t('were_performing_maintenance', { seconds: secondsUntilRefresh })} - - + + ) } diff --git a/services/web/frontend/js/features/ide-react/components/modals/generic-message-modal.tsx b/services/web/frontend/js/features/ide-react/components/modals/generic-message-modal.tsx index 51f849c4f4..37bd91753a 100644 --- a/services/web/frontend/js/features/ide-react/components/modals/generic-message-modal.tsx +++ b/services/web/frontend/js/features/ide-react/components/modals/generic-message-modal.tsx @@ -1,14 +1,19 @@ import { useTranslation } from 'react-i18next' -import { Modal } from 'react-bootstrap' -import AccessibleModal from '@/shared/components/accessible-modal' import { memo } from 'react' +import OLModal, { + OLModalBody, + OLModalFooter, + OLModalHeader, + OLModalTitle, +} from '@/features/ui/components/ol/ol-modal' +import OLButton from '@/features/ui/components/ol/ol-button' export type GenericMessageModalOwnProps = { title: string message: string } -type GenericMessageModalProps = React.ComponentProps & +type GenericMessageModalProps = React.ComponentProps & GenericMessageModalOwnProps function GenericMessageModal({ @@ -19,19 +24,19 @@ function GenericMessageModal({ const { t } = useTranslation() return ( - - - {title} - + + + {title} + - {message} + {message} - - - - + + + ) } diff --git a/services/web/frontend/js/features/ide-react/components/modals/out-of-sync-modal.tsx b/services/web/frontend/js/features/ide-react/components/modals/out-of-sync-modal.tsx index b29f2445c3..53aa73f6c3 100644 --- a/services/web/frontend/js/features/ide-react/components/modals/out-of-sync-modal.tsx +++ b/services/web/frontend/js/features/ide-react/components/modals/out-of-sync-modal.tsx @@ -1,8 +1,13 @@ import { Trans, useTranslation } from 'react-i18next' -import { Button, Modal } from 'react-bootstrap' -import AccessibleModal from '@/shared/components/accessible-modal' import { memo, useState } from 'react' import { useLocation } from '@/shared/hooks/use-location' +import OLButton from '@/features/ui/components/ol/ol-button' +import OLModal, { + OLModalBody, + OLModalFooter, + OLModalHeader, + OLModalTitle, +} from '@/features/ui/components/ol/ol-modal' export type OutOfSyncModalProps = { editorContent: string @@ -24,17 +29,17 @@ function OutOfSyncModal({ editorContent, show, onHide }: OutOfSyncModalProps) { } return ( - - - {t('out_of_sync')} - - + + {t('out_of_sync')} + + , ]} /> - - - + {editorContentShown ? (