Update how conditional elements are rendered for bar modules. (#688)

This commit is contained in:
Jas Singh
2025-01-03 00:23:10 -08:00
committed by GitHub
parent 0533965c86
commit e525d9e03a
6 changed files with 105 additions and 37 deletions

View File

@@ -23,7 +23,7 @@ const Network = (): BarBoxChild => {
},
);
const networkIcon = <icon className={'bar-button-icon network-icon'} icon={iconBinding()} />;
const NetworkIcon = (): JSX.Element => <icon className={'bar-button-icon network-icon'} icon={iconBinding()} />;
const networkLabel = Variable.derive(
[
@@ -66,8 +66,6 @@ const Network = (): BarBoxChild => {
},
);
const componentChildren = [networkIcon, networkLabel()];
const component = (
<box
vexpand
@@ -79,7 +77,8 @@ const Network = (): BarBoxChild => {
componentClassName.drop();
}}
>
{componentChildren}
<NetworkIcon />
{networkLabel()}
</box>
);