Second click on list item closes the details view (#3809)

Signed-off-by: Juho Heikka <juho.heikka@gmail.com>
This commit is contained in:
Juho Heikka authored and GitHub committed 2021-09-15 08:48:12 -04:00
1 parent 64fb590377
commit 74f3826235
6 files changed
+37 -7

No files matched your search

@@ -55,6 +55,14 @@ export class HelmCharts extends Component<Props> {
return helmChartStore.getByName(chartName, repo);
}
onDetails = (chart: HelmChart) => {
if (chart === this.selectedChart) {
this.hideDetails();
} else {
this.showDetails(chart);
}
};
showDetails = (chart: HelmChart) => {
if (!chart) {
navigation.push(helmChartsURL());
@@ -121,7 +129,7 @@ export class HelmCharts extends Component<Props> {
{ className: "menu" }
]}
detailsItem={this.selectedChart}
onDetails={this.showDetails}
onDetails={this.onDetails}
/>
{this.selectedChart && (
<HelmChartDetails