fix: panels don't clobber the tab bar anymore
This commit is contained in:
@@ -1053,30 +1053,30 @@ export const Editor: React.FC = () => {
|
|||||||
// Show settings if settings tab is active or settings view with no tab
|
// Show settings if settings tab is active or settings view with no tab
|
||||||
if (showSettings) {
|
if (showSettings) {
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="editor">
|
||||||
<SettingsView />
|
<SettingsView />
|
||||||
{renderErrorModal()}
|
{renderErrorModal()}
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show tags if tags tab is active
|
// Show tags if tags tab is active
|
||||||
if (showTags) {
|
if (showTags) {
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="editor">
|
||||||
<TagsView />
|
<TagsView />
|
||||||
{renderErrorModal()}
|
{renderErrorModal()}
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show chat if chat tab is active
|
// Show chat if chat tab is active
|
||||||
if (showChat && activeTabId) {
|
if (showChat && activeTabId) {
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="editor">
|
||||||
<ChatPanel key={activeTabId} conversationId={activeTabId} />
|
<ChatPanel key={activeTabId} conversationId={activeTabId} />
|
||||||
{renderErrorModal()}
|
{renderErrorModal()}
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1085,41 +1085,41 @@ export const Editor: React.FC = () => {
|
|||||||
const post = posts.find(p => p.id === activeTabId);
|
const post = posts.find(p => p.id === activeTabId);
|
||||||
if (post) {
|
if (post) {
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="editor">
|
||||||
<PostEditor key={post.id} post={post} />
|
<PostEditor key={post.id} post={post} />
|
||||||
{renderErrorModal()}
|
{renderErrorModal()}
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Post not found - show loading or empty state
|
// Post not found - show loading or empty state
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="editor">
|
||||||
<div className="editor-empty">
|
<div className="editor-empty">
|
||||||
<div className="welcome-content">
|
<div className="welcome-content">
|
||||||
<p className="text-muted">{isLoading ? 'Loading post...' : ''}</p>
|
<p className="text-muted">{isLoading ? 'Loading post...' : ''}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{renderErrorModal()}
|
{renderErrorModal()}
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show media editor if a media tab is active
|
// Show media editor if a media tab is active
|
||||||
if (showMedia && activeTabId) {
|
if (showMedia && activeTabId) {
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="editor">
|
||||||
<MediaEditor key={activeTabId} mediaId={activeTabId} />
|
<MediaEditor key={activeTabId} mediaId={activeTabId} />
|
||||||
{renderErrorModal()}
|
{renderErrorModal()}
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// No tab active - show dashboard
|
// No tab active - show dashboard
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="editor">
|
||||||
<Dashboard />
|
<Dashboard />
|
||||||
{renderErrorModal()}
|
{renderErrorModal()}
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -229,10 +229,6 @@ export const TabBar: React.FC = () => {
|
|||||||
return () => window.removeEventListener('keydown', handleKeyDown);
|
return () => window.removeEventListener('keydown', handleKeyDown);
|
||||||
}, [activeTabId, closeTab, toggleSidebar]);
|
}, [activeTabId, closeTab, toggleSidebar]);
|
||||||
|
|
||||||
if (tabs.length === 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleTabClick = (tabId: string) => {
|
const handleTabClick = (tabId: string) => {
|
||||||
setActiveTab(tabId);
|
setActiveTab(tabId);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user