Add check button: WIP need api
+import { Button } from "@material-ui/core";
import Box from "@material-ui/core/Box/Box";
import Step from "@material-ui/core/Step";
import StepContent from "@material-ui/core/StepContent";
import StepLabel from "@material-ui/core/StepLabel";
import Stepper from "@material-ui/core/Stepper";
+import { boolean } from "@storybook/addon-knobs";
import { BasePage } from "pages/BasePage";
import { CertStatus } from "pages/Domains/CertStatus";
import { DomainStatus } from "pages/Domains/Status";
-import React from "react";
+import React, { useState } from "react";
import { useSelector } from "react-redux";
import { useRouteMatch } from "react-router-dom";
import { RootState } from "reducers";
@@ -31,6 +33,9 @@ const DomainTourPageRaw: React.FC = () => {
const router = useRouteMatch<{ name: string }>();
const domain = domains.find((x) => x.name === router.params.name);
+ const [checkTXT, setCheckTXT] = useState(false);
+ const [checkCNAME, setCheckCNAME] = useState(false);
+
if (isLoading && !isFirstLoaded) {
return <Loading />;
}
@@ -78,10 +83,6 @@ const DomainTourPageRaw: React.FC = () => {
title: `Verify your domain by adding a TXT record.`,
content: (
<Box>
- <Box mt={1}>
- <DomainStatus status={domain.txtStatus} />
- </Box>
-
<Box mt={2}>Add a TXT Record in your DNS config panel you just open.</Box>
<Box mt={2}>
<DNSConfigItems
@@ -103,6 +104,23 @@ const DomainTourPageRaw: React.FC = () => {
</Box>
<Box mt={2}>{renderHelper(domain.domain, "TXT", domain.txt)}</Box>
+ <Box mt={2} display="flex" flexDirection="row">
+ <Button
+ variant="outlined"
+ color="primary"
+ size="small"
+ onClick={() => {
+ setCheckTXT(true);
+ }}
+ >
+ Check TXT Status
+ </Button>
+ {checkTXT && (
+ <Box pl={2} display="flex">
+ <DomainStatus status={domain.txtStatus} />
+ </Box>
+ )}
+ </Box>
</Box>
),
completed: domain.txtStatus === "ready",
@@ -119,9 +137,6 @@ const DomainTourPageRaw: React.FC = () => {
title: `Apply a certificate`,
content: (
<Box>
- <Box mt={1}>
- <CertStatus cert={cert} />
- </Box>
<Box mt={2}>Add a CNAME Record in your DNS config panel.</Box>
<Box mt={2}>
<DNSConfigItems
@@ -142,6 +157,23 @@ const DomainTourPageRaw: React.FC = () => {
</Box>
<Box mt={2}>{renderHelper(firstDomain, "CNAME", firstTarget)}</Box>
+ <Box mt={2} display="flex" flexDirection="row">
+ <Button
+ variant="outlined"
+ color="primary"
+ size="small"
+ onClick={() => {
+ setCheckCNAME(true);
+ }}
+ >
+ Check CNAME Status
+ </Button>
+ {checkCNAME && (
+ <Box pl={2} display="flex">
+ <CertStatus cert={cert} />
+ </Box>
+ )}
+ </Box>
</Box>
),
completed: cert.ready === "True",
