mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 14:19:01 +02:00
Merge pull request #23660 from overleaf/mj-history-tooltip
[web] Editor redesign: Add tooltip to history button GitOrigin-RevId: c14dab2c6d62d10312f9d5097fd95cad5cae1397
This commit is contained in:
committed by
Copybot
parent
fb12a1bc8e
commit
a34ebd3c7e
@@ -7,6 +7,7 @@ import { OnlineUsers } from './online-users'
|
||||
import ShareProjectButton from './share-project-button'
|
||||
import importOverleafModules from '../../../../../macros/import-overleaf-module.macro'
|
||||
import { useEditorContext } from '@/shared/context/editor-context'
|
||||
import OLTooltip from '@/features/ui/components/ol/ol-tooltip'
|
||||
|
||||
const [publishModalModules] = importOverleafModules('publishModal')
|
||||
const SubmitProjectButton = publishModalModules?.import.NewPublishToolbarButton
|
||||
@@ -42,6 +43,7 @@ const ToolbarMenus = () => {
|
||||
|
||||
const ToolbarButtons = () => {
|
||||
const { permissionsLevel } = useEditorContext()
|
||||
const { t } = useTranslation()
|
||||
|
||||
const shouldDisplaySubmitButton =
|
||||
(permissionsLevel === 'owner' || permissionsLevel === 'readAndWrite') &&
|
||||
@@ -51,12 +53,18 @@ const ToolbarButtons = () => {
|
||||
<div className="ide-redesign-toolbar-actions">
|
||||
<OnlineUsers />
|
||||
<div className="ide-redesign-toolbar-button-container">
|
||||
<OLButton
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
className="ide-redesign-toolbar-button-subdued"
|
||||
leadingIcon={<MaterialIcon type="history" />}
|
||||
/>
|
||||
<OLTooltip
|
||||
id="tooltip-open-history"
|
||||
description={t('history')}
|
||||
overlayProps={{ delay: 0, placement: 'bottom' }}
|
||||
>
|
||||
<OLButton
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
className="ide-redesign-toolbar-button-subdued"
|
||||
leadingIcon={<MaterialIcon type="history" />}
|
||||
/>
|
||||
</OLTooltip>
|
||||
</div>
|
||||
{shouldDisplaySubmitButton && <SubmitProjectButton />}
|
||||
<ShareProjectButton />
|
||||
|
||||
Reference in New Issue
Block a user