mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-21 18:58:03 +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 { DefinedValues } from "./DefinedValues";
|
||||
import apiService from "../../../API/apiService";
|
||||
import { InstallUpgradeTitle } from "./InstallUpgradeTitle";
|
||||
|
||||
export const InstallReleaseChartModal = ({
|
||||
isOpen,
|
||||
@@ -186,12 +187,11 @@ export const InstallReleaseChartModal = ({
|
||||
onClose();
|
||||
}}
|
||||
title={
|
||||
<div className="font-bold">
|
||||
{`${isUpgrade ? "Upgrade" : "Install"} `}
|
||||
{(isUpgrade || releaseValues) && (
|
||||
<span className="text-green-700 ">{chartName}</span>
|
||||
)}
|
||||
</div>
|
||||
<InstallUpgradeTitle
|
||||
isUpgrade={isUpgrade}
|
||||
releaseValues={isUpgrade || releaseValues}
|
||||
chartName={chartName}
|
||||
/>
|
||||
}
|
||||
containerClassNames="w-full text-2xl h-2/3"
|
||||
actions={[
|
||||
|
||||
@@ -13,6 +13,7 @@ import { useDiffData } from "../../../API/shared";
|
||||
import { InstallChartModalProps } from "../../../data/types";
|
||||
import { DefinedValues } from "./DefinedValues";
|
||||
import apiService from "../../../API/apiService";
|
||||
import { InstallUpgradeTitle } from "./InstallUpgradeTitle";
|
||||
|
||||
export const InstallRepoChartModal = ({
|
||||
isOpen,
|
||||
@@ -159,9 +160,11 @@ export const InstallRepoChartModal = ({
|
||||
onClose();
|
||||
}}
|
||||
title={
|
||||
<div className="font-bold">
|
||||
Install <span className="text-green-700 ">{chartName}</span>
|
||||
</div>
|
||||
<InstallUpgradeTitle
|
||||
isUpgrade={false}
|
||||
releaseValues={false}
|
||||
chartName={chartName}
|
||||
/>
|
||||
}
|
||||
containerClassNames="w-full text-2xl h-2/3"
|
||||
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