From 2b9268c8ef8610cdd219d7c3e266388ae6940a06 Mon Sep 17 00:00:00 2001 From: David <33458145+davidmcpowell@users.noreply.github.com> Date: Thu, 10 Jul 2025 10:24:06 +0100 Subject: [PATCH] Merge pull request #27003 from overleaf/dp-modal-opacity Change settings modal appearance tab to have transparent backdrop GitOrigin-RevId: 9cbf36164a8d82ec5945d06c7107a3b73b334cfe --- .../settings/settings-modal-body.tsx | 51 ++++--------------- .../components/settings/settings-modal.tsx | 50 +++++++++++++++++- .../bootstrap-5/pages/editor/settings.scss | 4 ++ 3 files changed, 63 insertions(+), 42 deletions(-) diff --git a/services/web/frontend/js/features/ide-redesign/components/settings/settings-modal-body.tsx b/services/web/frontend/js/features/ide-redesign/components/settings/settings-modal-body.tsx index b9a1fddbfe..99b3cea3eb 100644 --- a/services/web/frontend/js/features/ide-redesign/components/settings/settings-modal-body.tsx +++ b/services/web/frontend/js/features/ide-redesign/components/settings/settings-modal-body.tsx @@ -1,7 +1,8 @@ import MaterialIcon, { AvailableUnfilledIcon, } from '@/shared/components/material-icon' -import { ReactElement, useMemo, useState } from 'react' +import { ReactElement } from 'react' + import { Nav, NavLink, @@ -9,10 +10,6 @@ import { TabContent, TabPane, } from 'react-bootstrap' -import { useTranslation } from 'react-i18next' -import EditorSettings from './editor-settings/editor-settings' -import AppearanceSettings from './appearance-settings/appearance-settings' -import CompilerSettings from './compiler-settings/compiler-settings' export type SettingsEntry = SettingsLink | SettingsTab @@ -30,41 +27,15 @@ type SettingsLink = { title: string } -export const SettingsModalBody = () => { - const { t } = useTranslation() - const settingsTabs: SettingsEntry[] = useMemo( - () => [ - { - key: 'editor', - title: t('editor'), - icon: 'code', - component: , - }, - { - key: 'compiler', - title: t('compiler'), - icon: 'picture_as_pdf', - component: , - }, - { - key: 'appearance', - title: t('appearance'), - icon: 'brush', - component: , - }, - { - key: 'account_settings', - title: t('account_settings'), - icon: 'settings', - href: '/user/settings', - }, - ], - [t] - ) - const [activeTab, setActiveTab] = useState( - settingsTabs[0]?.key - ) - +export const SettingsModalBody = ({ + activeTab, + setActiveTab, + settingsTabs, +}: { + activeTab: string | null | undefined + setActiveTab: (tab: string | null | undefined) => void + settingsTabs: SettingsEntry[] +}) => { return ( { // TODO ide-redesign-cleanup: Either rename the field, or introduce a separate // one const { leftMenuShown, setLeftMenuShown } = useLayoutContext() const { t } = useTranslation() + const settingsTabs: SettingsEntry[] = useMemo( + () => [ + { + key: 'editor', + title: t('editor'), + icon: 'code', + component: , + }, + { + key: 'compiler', + title: t('compiler'), + icon: 'picture_as_pdf', + component: , + }, + { + key: 'appearance', + title: t('appearance'), + icon: 'brush', + component: , + }, + { + key: 'account_settings', + title: t('account_settings'), + icon: 'settings', + href: '/user/settings', + }, + ], + [t] + ) + const [activeTab, setActiveTab] = useState( + settingsTabs[0]?.key + ) return ( setLeftMenuShown(false)} size="lg" + backdropClassName={ + activeTab === 'appearance' + ? 'ide-settings-modal-transparent-backdrop' + : undefined + } > {t('settings')} - + ) diff --git a/services/web/frontend/stylesheets/bootstrap-5/pages/editor/settings.scss b/services/web/frontend/stylesheets/bootstrap-5/pages/editor/settings.scss index 02ce2cca30..e443b6e8ec 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/pages/editor/settings.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/pages/editor/settings.scss @@ -47,6 +47,10 @@ padding: 0; } +.modal-backdrop.show.ide-settings-modal-transparent-backdrop { + opacity: 0; +} + .ide-settings-section { padding-top: var(--spacing-06); padding-bottom: var(--spacing-05);