|
|
@@ -1,5 +1,3 @@
|
|
|
-import MaterialIcon from '@/shared/components/material-icon'
|
|
|
-import { useTranslation } from 'react-i18next'
|
|
|
import { ToolbarMenuBar } from './menu-bar'
|
|
|
import { ToolbarProjectTitle } from './project-title'
|
|
|
import { OnlineUsers } from './online-users'
|
|
|
@@ -11,12 +9,14 @@ import { useLayoutContext } from '@/shared/context/layout-context'
|
|
|
import BackToEditorButton from '@/features/editor-navigation-toolbar/components/back-to-editor-button'
|
|
|
import { useCallback } from 'react'
|
|
|
import * as eventTracking from '../../../../infrastructure/event-tracking'
|
|
|
-import OLTooltip from '@/features/ui/components/ol/ol-tooltip'
|
|
|
+import { ToolbarLogos } from './logos'
|
|
|
+import { useEditorContext } from '@/shared/context/editor-context'
|
|
|
import UpgradeButton from './upgrade-button'
|
|
|
import getMeta from '@/utils/meta'
|
|
|
|
|
|
export const Toolbar = () => {
|
|
|
const { view, setView } = useLayoutContext()
|
|
|
+ const { cobranding } = useEditorContext()
|
|
|
|
|
|
const handleBackToEditorClick = useCallback(() => {
|
|
|
eventTracking.sendMB('navigation-clicked-history', { action: 'close' })
|
|
|
@@ -37,43 +37,19 @@ export const Toolbar = () => {
|
|
|
|
|
|
return (
|
|
|
<div className="ide-redesign-toolbar">
|
|
|
- <ToolbarMenus />
|
|
|
+ <div className="ide-redesign-toolbar-menu">
|
|
|
+ <ToolbarLogos cobranding={cobranding} />
|
|
|
+ <ToolbarMenuBar />
|
|
|
+ </div>
|
|
|
<ToolbarProjectTitle />
|
|
|
- <ToolbarButtons />
|
|
|
- </div>
|
|
|
- )
|
|
|
-}
|
|
|
-
|
|
|
-const ToolbarMenus = () => {
|
|
|
- const { t } = useTranslation()
|
|
|
- return (
|
|
|
- <div className="ide-redesign-toolbar-menu">
|
|
|
- <OLTooltip
|
|
|
- id="tooltip-home-button"
|
|
|
- description={t('back_to_your_projects')}
|
|
|
- overlayProps={{ delay: 0, placement: 'bottom' }}
|
|
|
- >
|
|
|
- <div className="ide-redesign-toolbar-home-button">
|
|
|
- <a href="/project" className="ide-redesign-toolbar-home-link">
|
|
|
- <span className="toolbar-ol-logo" aria-label={t('overleaf_logo')} />
|
|
|
- <MaterialIcon type="home" className="toolbar-ol-home-button" />
|
|
|
- </a>
|
|
|
- </div>
|
|
|
- </OLTooltip>
|
|
|
- <ToolbarMenuBar />
|
|
|
- </div>
|
|
|
- )
|
|
|
-}
|
|
|
-
|
|
|
-const ToolbarButtons = () => {
|
|
|
- return (
|
|
|
- <div className="ide-redesign-toolbar-actions">
|
|
|
- <LabsActions />
|
|
|
- <OnlineUsers />
|
|
|
- <ShowHistoryButton />
|
|
|
- <ChangeLayoutButton />
|
|
|
- <ShareProjectButton />
|
|
|
- {getMeta('ol-showUpgradePrompt') && <UpgradeButton />}
|
|
|
+ <div className="ide-redesign-toolbar-actions">
|
|
|
+ <LabsActions />
|
|
|
+ <OnlineUsers />
|
|
|
+ <ShowHistoryButton />
|
|
|
+ <ChangeLayoutButton />
|
|
|
+ <ShareProjectButton />
|
|
|
+ {getMeta('ol-showUpgradePrompt') && <UpgradeButton />}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
)
|
|
|
}
|