mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
Extract modal title to components (#496)
This commit is contained in:
@@ -19,6 +19,7 @@ import { useDiffData } from "../../../API/shared";
|
|||||||
import { InstallChartModalProps } from "../../../data/types";
|
import { InstallChartModalProps } from "../../../data/types";
|
||||||
import { DefinedValues } from "./DefinedValues";
|
import { DefinedValues } from "./DefinedValues";
|
||||||
import apiService from "../../../API/apiService";
|
import apiService from "../../../API/apiService";
|
||||||
|
import { InstallUpgradeTitle } from "./InstallUpgradeTitle";
|
||||||
|
|
||||||
export const InstallReleaseChartModal = ({
|
export const InstallReleaseChartModal = ({
|
||||||
isOpen,
|
isOpen,
|
||||||
@@ -186,12 +187,11 @@ export const InstallReleaseChartModal = ({
|
|||||||
onClose();
|
onClose();
|
||||||
}}
|
}}
|
||||||
title={
|
title={
|
||||||
<div className="font-bold">
|
<InstallUpgradeTitle
|
||||||
{`${isUpgrade ? "Upgrade" : "Install"} `}
|
isUpgrade={isUpgrade}
|
||||||
{(isUpgrade || releaseValues) && (
|
releaseValues={isUpgrade || releaseValues}
|
||||||
<span className="text-green-700 ">{chartName}</span>
|
chartName={chartName}
|
||||||
)}
|
/>
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
containerClassNames="w-full text-2xl h-2/3"
|
containerClassNames="w-full text-2xl h-2/3"
|
||||||
actions={[
|
actions={[
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { useDiffData } from "../../../API/shared";
|
|||||||
import { InstallChartModalProps } from "../../../data/types";
|
import { InstallChartModalProps } from "../../../data/types";
|
||||||
import { DefinedValues } from "./DefinedValues";
|
import { DefinedValues } from "./DefinedValues";
|
||||||
import apiService from "../../../API/apiService";
|
import apiService from "../../../API/apiService";
|
||||||
|
import { InstallUpgradeTitle } from "./InstallUpgradeTitle";
|
||||||
|
|
||||||
export const InstallRepoChartModal = ({
|
export const InstallRepoChartModal = ({
|
||||||
isOpen,
|
isOpen,
|
||||||
@@ -159,9 +160,11 @@ export const InstallRepoChartModal = ({
|
|||||||
onClose();
|
onClose();
|
||||||
}}
|
}}
|
||||||
title={
|
title={
|
||||||
<div className="font-bold">
|
<InstallUpgradeTitle
|
||||||
Install <span className="text-green-700 ">{chartName}</span>
|
isUpgrade={false}
|
||||||
</div>
|
releaseValues={false}
|
||||||
|
chartName={chartName}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
containerClassNames="w-full text-2xl h-2/3"
|
containerClassNames="w-full text-2xl h-2/3"
|
||||||
actions={[
|
actions={[
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { FC } from "react";
|
||||||
|
|
||||||
|
interface InstallUpgradeProps {
|
||||||
|
isUpgrade: boolean;
|
||||||
|
releaseValues: boolean;
|
||||||
|
chartName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const InstallUpgradeTitle: FC<InstallUpgradeProps> = ({
|
||||||
|
isUpgrade,
|
||||||
|
releaseValues,
|
||||||
|
chartName,
|
||||||
|
}) => {
|
||||||
|
const text = isUpgrade ? "Upgrade" : "Install";
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="font-bold">
|
||||||
|
{`${text}`}
|
||||||
|
{(isUpgrade || releaseValues) && (
|
||||||
|
<span className="text-green-700">{chartName}</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user