Fix resource tree styling (#1926)

* Fix style for when no global command

* Fix style override expression

---------

Co-authored-by: Laurent Nguyen <languye@microsoft.com>
This commit is contained in:
Laurent Nguyen 2024-08-09 17:00:09 +02:00 committed by GitHub
parent 806a0657df
commit 58ae64193f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 2 deletions

View File

@ -249,6 +249,12 @@ export const SidebarContainer: React.FC<SidebarProps> = ({ explorer }) => {
setLoading(false); setLoading(false);
}, [setLoading]); }, [setLoading]);
const hasGlobalCommands = !(
configContext.platform === Platform.Fabric ||
userContext.apiType === "Postgres" ||
userContext.apiType === "VCoreMongo"
);
return ( return (
<Allotment ref={allotment} onChange={onChange} onDragEnd={onDragEnd} className="resourceTreeAndTabs"> <Allotment ref={allotment} onChange={onChange} onDragEnd={onDragEnd} className="resourceTreeAndTabs">
{/* Collections Tree - Start */} {/* Collections Tree - Start */}
@ -285,8 +291,11 @@ export const SidebarContainer: React.FC<SidebarProps> = ({ explorer }) => {
</button> </button>
</div> </div>
</div> </div>
<div className={styles.expandedContent}> <div
<GlobalCommands explorer={explorer} /> className={styles.expandedContent}
style={!hasGlobalCommands ? { gridTemplateRows: "1fr" } : undefined}
>
{hasGlobalCommands && <GlobalCommands explorer={explorer} />}
<ResourceTree explorer={explorer} /> <ResourceTree explorer={explorer} />
</div> </div>
</> </>