Hide toolbar divider when no extensions are there
This commit is contained in:
parent
e3226da492
commit
0ed466f404
2 changed files with 11 additions and 6 deletions
|
@ -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
|
||||||
|
|
|
@ -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}
|
||||||
|
|
Loading…
Reference in a new issue