Skip to content

Commit 8bec3ba

Browse files
authored
Merge pull request #2 from ushahidi/Removing-lang
Removing language section if no languages
2 parents 4b89729 + 3c4ed11 commit 8bec3ba

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/components/SimplePanel.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,19 @@ export const SimplePanel: React.FC<Props> = ({ options, data, width, height }) =
170170
</div>
171171
</div>
172172
))}
173-
174-
<h2 className="panel-section-header top-spacing">Language Distribution</h2>
175-
<div className="panel-lang-container">
176-
177-
{languageRows.map((row, i) => (
178-
<div key={i} className="panel-lang-pill">
179-
{row.language} {Number(row.percent ?? '0').toFixed(
180-
options.decimalPlaces ?? 1)}%
173+
{languageRows.length > 0 && (
174+
<>
175+
<h2 className="panel-section-header top-spacing">Language Distribution</h2>
176+
<div className="panel-lang-container">
177+
{languageRows.map((row, i) => (
178+
<div key={i} className="panel-lang-pill">
179+
{row.language} {Number(row.percent ?? '0').toFixed(
180+
options.decimalPlaces ?? 1)}%
181+
</div>
182+
))}
181183
</div>
182-
))}
183-
</div>
184+
</>
185+
)}
184186
</div>
185187
);
186188
};

0 commit comments

Comments
 (0)