mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #34395 from overleaf/mj-tabs-disable-close-button
[web] Disable close tab button on last tab GitOrigin-RevId: 2d4600162696b07848311e75154d9d86aac0b315
This commit is contained in:
committed by
Copybot
parent
dedc521295
commit
748bdfd59d
@@ -26,6 +26,7 @@ type TabProps = {
|
||||
tab: EditorFileTab
|
||||
openTab: (id: string) => void
|
||||
closeTab: (id: string) => void
|
||||
canCloseTab: boolean
|
||||
makeTabPermanent: (id: string) => void
|
||||
openContextMenu: (
|
||||
coords: { top: number; left: number },
|
||||
@@ -56,6 +57,7 @@ export const Tab = memo(function Tab({
|
||||
tab,
|
||||
openTab,
|
||||
closeTab,
|
||||
canCloseTab,
|
||||
makeTabPermanent,
|
||||
openContextMenu,
|
||||
closeContextMenu,
|
||||
@@ -233,6 +235,7 @@ export const Tab = memo(function Tab({
|
||||
<div className="editor-file-tab-action">
|
||||
<button
|
||||
onClick={onCloseClick}
|
||||
disabled={!canCloseTab}
|
||||
className="editor-file-tab-close-action"
|
||||
aria-label={t('close')}
|
||||
>
|
||||
|
||||
@@ -106,6 +106,7 @@ export const TabsContainer = () => {
|
||||
tab={tab}
|
||||
openTab={openTab}
|
||||
closeTab={closeTab}
|
||||
canCloseTab={tabs.length > 1}
|
||||
isSelected={openEntity?.entity._id === tab.id}
|
||||
onTabDrop={moveTab}
|
||||
makeTabPermanent={makeTabPermanent}
|
||||
|
||||
Reference in New Issue
Block a user