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} />
}
export const ExtensionToolbar: React.FC<{toolbarId: string}> = ({
toolbarId,
}) => {
export const ExtensionToolbar: React.FC<{
toolbarId: string
showLeftDivider?: boolean
}> = ({toolbarId, showLeftDivider}) => {
const groups: Array<React.ReactNode> = []
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
return <Container>{groups}</Container>
return (
<Container>
{showLeftDivider ? <GroupDivider></GroupDivider> : undefined}
{groups}
</Container>
)
}
export default ExtensionToolbar

View file

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