mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-24 17:51:51 +02:00
Merge pull request #26023 from overleaf/td-remove-components-from-includes
Remove imports of react-bootstrap components from marketing pages GitOrigin-RevId: 12a3446cc42f1438a52f49a893e53a02a1b5be4f
This commit is contained in:
@@ -9,4 +9,3 @@ import './features/multi-submit'
|
||||
import './features/cookie-banner'
|
||||
import './features/autoplay-video'
|
||||
import './features/mathjax'
|
||||
import './features/header-footer-react'
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
import '../marketing'
|
||||
import { renderInReactLayout } from '@/react'
|
||||
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { CompromisedPasswordCard } from '../features/compromised-password/components/compromised-password-root'
|
||||
import { CompromisedPasswordCard } from '@/features/compromised-password/components/compromised-password-root'
|
||||
|
||||
const compromisedPasswordContainer = document.getElementById(
|
||||
'compromised-password'
|
||||
)
|
||||
|
||||
if (compromisedPasswordContainer) {
|
||||
const root = createRoot(compromisedPasswordContainer)
|
||||
root.render(<CompromisedPasswordCard />)
|
||||
}
|
||||
renderInReactLayout('compromised-password', () => <CompromisedPasswordCard />)
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import '../marketing'
|
||||
import { renderInReactLayout } from '@/react'
|
||||
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { SocketDiagnostics } from '@/features/socket-diagnostics/components/socket-diagnostics'
|
||||
|
||||
const socketDiagnosticsContainer = document.getElementById('socket-diagnostics')
|
||||
|
||||
if (socketDiagnosticsContainer) {
|
||||
const root = createRoot(socketDiagnosticsContainer)
|
||||
root.render(<SocketDiagnostics />)
|
||||
}
|
||||
renderInReactLayout('socket-diagnostics', () => <SocketDiagnostics />)
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
import '../../marketing'
|
||||
import { renderInReactLayout } from '@/react'
|
||||
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { AddSecondaryEmailPrompt } from '../../features/settings/components/emails/add-secondary-email-prompt'
|
||||
import { AddSecondaryEmailPrompt } from '@/features/settings/components/emails/add-secondary-email-prompt'
|
||||
|
||||
const addSecondaryEmailContainer = document.getElementById(
|
||||
'add-secondary-email'
|
||||
)
|
||||
|
||||
if (addSecondaryEmailContainer) {
|
||||
const root = createRoot(addSecondaryEmailContainer)
|
||||
root.render(<AddSecondaryEmailPrompt />)
|
||||
}
|
||||
renderInReactLayout('add-secondary-email', () => <AddSecondaryEmailPrompt />)
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import '../../marketing'
|
||||
import { renderInReactLayout } from '@/react'
|
||||
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import ConfirmSecondaryEmailForm from '../../features/settings/components/emails/confirm-secondary-email-form'
|
||||
import ConfirmSecondaryEmailForm from '@/features/settings/components/emails/confirm-secondary-email-form'
|
||||
|
||||
const confirmEmailContainer = document.getElementById('confirm-secondary-email')
|
||||
|
||||
if (confirmEmailContainer) {
|
||||
const root = createRoot(confirmEmailContainer)
|
||||
root.render(<ConfirmSecondaryEmailForm />)
|
||||
}
|
||||
renderInReactLayout('confirm-secondary-email', () => (
|
||||
<ConfirmSecondaryEmailForm />
|
||||
))
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
import '../../marketing'
|
||||
import './../../utils/meta'
|
||||
import '../../utils/webpack-public-path'
|
||||
import './../../infrastructure/error-reporter'
|
||||
import '@/i18n'
|
||||
import '../../features/settings/components/root'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import SettingsPageRoot from '../../features/settings/components/root.tsx'
|
||||
|
||||
const element = document.getElementById('settings-page-root')
|
||||
// For react-google-recaptcha
|
||||
window.recaptchaOptions = {
|
||||
enterprise: true,
|
||||
useRecaptchaNet: true,
|
||||
}
|
||||
if (element) {
|
||||
const root = createRoot(element)
|
||||
root.render(<SettingsPageRoot />)
|
||||
}
|
||||
13
services/web/frontend/js/pages/user/settings.tsx
Normal file
13
services/web/frontend/js/pages/user/settings.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { renderInReactLayout } from '@/react'
|
||||
import '@/utils/meta'
|
||||
import '@/utils/webpack-public-path'
|
||||
import '@/infrastructure/error-reporter'
|
||||
import '@/i18n'
|
||||
import SettingsPageRoot from '@/features/settings/components/root'
|
||||
|
||||
// For react-google-recaptcha
|
||||
window.recaptchaOptions = {
|
||||
enterprise: true,
|
||||
useRecaptchaNet: true,
|
||||
}
|
||||
renderInReactLayout('settings-page-root', () => <SettingsPageRoot />)
|
||||
@@ -1,14 +1,9 @@
|
||||
import '@/marketing'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { renderInReactLayout } from '@/react'
|
||||
import PreviewSubscriptionChange from '@/features/subscription/components/preview-subscription-change/root'
|
||||
import { SplitTestProvider } from '@/shared/context/split-test-context'
|
||||
|
||||
const element = document.getElementById('subscription-preview-change')
|
||||
if (element) {
|
||||
const root = createRoot(element)
|
||||
root.render(
|
||||
<SplitTestProvider>
|
||||
<PreviewSubscriptionChange />
|
||||
</SplitTestProvider>
|
||||
)
|
||||
}
|
||||
renderInReactLayout('subscription-preview-change', () => (
|
||||
<SplitTestProvider>
|
||||
<PreviewSubscriptionChange />
|
||||
</SplitTestProvider>
|
||||
))
|
||||
|
||||
15
services/web/frontend/js/react.ts
Normal file
15
services/web/frontend/js/react.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import './marketing'
|
||||
import './features/header-footer-react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { ReactNode } from 'react'
|
||||
|
||||
export function renderInReactLayout(
|
||||
parentId: string,
|
||||
createChildren: () => ReactNode
|
||||
) {
|
||||
const parentElement = document.getElementById(parentId)
|
||||
if (parentElement) {
|
||||
const root = createRoot(parentElement)
|
||||
root.render(createChildren())
|
||||
}
|
||||
}
|
||||
@@ -133,6 +133,7 @@ export interface Meta {
|
||||
'ol-hasIndividualPaidSubscription': boolean
|
||||
'ol-hasManagedUsersFeature': boolean
|
||||
'ol-hasPassword': boolean
|
||||
'ol-hasSplitTestWriteAccess': boolean
|
||||
'ol-hasSubscription': boolean
|
||||
'ol-hasTrackChangesFeature': boolean
|
||||
'ol-hideLinkingWidgets': boolean // CI only
|
||||
@@ -241,6 +242,7 @@ export interface Meta {
|
||||
'ol-showUpgradePrompt': boolean
|
||||
'ol-skipUrl': string
|
||||
'ol-splitTestInfo': { [name: string]: SplitTestInfo }
|
||||
'ol-splitTestName': string
|
||||
'ol-splitTestVariants': { [name: string]: string }
|
||||
'ol-ssoDisabled': boolean
|
||||
'ol-ssoErrorMessage': string
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import '@/marketing'
|
||||
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import UserActivateRegister from '../components/user-activate-register'
|
||||
|
||||
const container = document.getElementById('user-activate-register-container')
|
||||
if (container) {
|
||||
const root = createRoot(container)
|
||||
root.render(<UserActivateRegister />)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { renderInReactLayout } from '@/react'
|
||||
|
||||
import UserActivateRegister from '../components/user-activate-register'
|
||||
|
||||
renderInReactLayout('user-activate-register-container', () => (
|
||||
<UserActivateRegister />
|
||||
))
|
||||
Reference in New Issue
Block a user