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} />
|
||||
}
|
||||
|
||||
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
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue