Sfoglia il codice sorgente

reset cost confirmed on modal exit

Justin Rhee 3 anni fa
parent
commit
9e9b5bf93a

+ 5 - 1
dashboard/src/components/ProvisionerFlow.tsx

@@ -14,6 +14,7 @@ import Fieldset from "./porter/Fieldset";
 import Checkbox from "./porter/Checkbox";
 import Button from "./porter/Button";
 import ExpandableSection from "./porter/ExpandableSection";
+import Window from "./porter/Window";
 
 const providers = ["aws", "gcp", "azure"];
 
@@ -64,7 +65,10 @@ const ProvisionerFlow: React.FC<Props> = ({
           </BlockList>
         </StyledProvisionerFlow>
         {showCostConfirmModal && (
-          <Modal closeModal={() => setShowCostConfirmModal(false)}>
+          <Modal closeModal={() => {
+            setCostConfirmed(false);
+            setShowCostConfirmModal(false);
+          }}>
             <Text size={16} weight={500}>
               Important: AWS base cost
             </Text>

+ 5 - 3
dashboard/src/main/home/dashboard/ClusterSection.tsx

@@ -93,9 +93,11 @@ const ClusterSection = (props: Props) => {
   }
   return (
     <>
-      <Button onClick={() => setCurrentStep("cloud")}>
-        <i className="material-icons">add</i> Create a cluster
-      </Button>
+      {usage?.current.cluster > 1 && (
+        <Button onClick={() => setCurrentStep("cloud")}>
+          <i className="material-icons">add</i> Create a cluster
+        </Button>
+      )}
       <ClusterList />
     </>
   );