Hide toolbar divider when no extensions are there

This commit is contained in:
vezwork 2022-07-26 08:16:16 -04:00 committed by Elliot
parent e3226da492
commit 0ed466f404
2 changed files with 11 additions and 6 deletions

View file

@ -62,9 +62,10 @@ const ExtensionToolsetRender: React.FC<{
return <Toolset config={config} /> return <Toolset config={config} />
} }
export const ExtensionToolbar: React.FC<{toolbarId: string}> = ({ export const ExtensionToolbar: React.FC<{
toolbarId, toolbarId: string
}) => { showLeftDivider?: boolean
}> = ({toolbarId, showLeftDivider}) => {
const groups: Array<React.ReactNode> = [] const groups: Array<React.ReactNode> = []
const extensionsById = useVal(getStudio().atomP.ephemeral.extensions.byId) const extensionsById = useVal(getStudio().atomP.ephemeral.extensions.byId)
@ -84,7 +85,12 @@ export const ExtensionToolbar: React.FC<{toolbarId: string}> = ({
if (groups.length === 0) return null if (groups.length === 0) return null
return <Container>{groups}</Container> return (
<Container>
{showLeftDivider ? <GroupDivider></GroupDivider> : undefined}
{groups}
</Container>
)
} }
export default ExtensionToolbar export default ExtensionToolbar

View file

@ -142,13 +142,12 @@ const GlobalToolbar: React.FC = () => {
unpinHintIcon={<DoubleChevronLeft />} unpinHintIcon={<DoubleChevronLeft />}
pinned={outlinePinned} pinned={outlinePinned}
/> />
<GroupDivider />
{conflicts.length > 0 ? ( {conflicts.length > 0 ? (
<NumberOfConflictsIndicator> <NumberOfConflictsIndicator>
{conflicts.length} {conflicts.length}
</NumberOfConflictsIndicator> </NumberOfConflictsIndicator>
) : null} ) : null}
<ExtensionToolbar toolbarId="global" /> <ExtensionToolbar showLeftDivider toolbarId="global" />
</SubContainer> </SubContainer>
<SubContainer> <SubContainer>
{moreMenu} {moreMenu}