Skip to content

Commit

Permalink
fix(groups): do not indent groups with one element inside (#1958)
Browse files Browse the repository at this point in the history
* Do not indent groups with one element inside

* Update composite.tsx
  • Loading branch information
kirovilya authored Nov 3, 2024
1 parent 78702fc commit 999c42e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/features/composite/composite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ class Composite extends Component<CompositeProps & WithTranslation<'composite'>,
}
for (const epName in groupedFeatures) {
const featuresGroup = groupedFeatures[epName];
// do not indent groups with one element inside
const noNeedIndent = featuresGroup.length == 1;
result.push(
<div key={epName}>
{showEndpointLabels ? `Endpoint: ${epName}` : null}
<div className="ps-4">
<div className={noNeedIndent ? '' : 'ps-4'}>
{featuresGroup.map((f) => (
<Feature
key={f.name + f.endpoint}
Expand Down

0 comments on commit 999c42e

Please sign in to comment.