Просмотр исходного кода

Merge pull request #2761 from porter-dev/provisioner-price

reset cost confirmed on modal exit
jusrhee 3 лет назад
Родитель
Сommit
a5845c2c74

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

@@ -64,7 +64,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 />
     </>
   );