11import { Badge } from 'react-bootstrap'
22import { Form , Input , SubmitButton } from './form'
33import { gql , useMutation } from '@apollo/client'
4- import Info from './info'
54import { customDomainSchema } from '@/lib/validate'
65import ActionTooltip from './action-tooltip'
76import { useToast } from '@/components/toast'
@@ -77,23 +76,6 @@ export default function CustomDomainForm ({ sub }) {
7776 { getStatusBadge ( sub . customDomain . dnsState ) }
7877 </ ActionTooltip >
7978 { getSSLStatusBadge ( sub . customDomain . sslState ) }
80- { sub . customDomain . dnsState === 'PENDING' && (
81- < Info >
82- < h6 > Verify your domain</ h6 >
83- < p > Add the following DNS records to verify ownership of your domain:</ p >
84- < pre >
85- CNAME record:
86- Host: @
87- Value: stacker.news
88- </ pre >
89- </ Info >
90- ) }
91- { sub . customDomain . sslState === 'PENDING' && (
92- < Info >
93- < h6 > SSL certificate pending</ h6 >
94- < p > Our system will issue an SSL certificate for your domain.</ p >
95- </ Info >
96- ) }
9779 </ div >
9880 </ >
9981 ) }
@@ -105,6 +87,38 @@ export default function CustomDomainForm ({ sub }) {
10587 { /* TODO: toaster */ }
10688 < SubmitButton variant = 'primary' className = 'mt-3' > save</ SubmitButton >
10789 </ div >
90+ { ( sub . customDomain . dnsState === 'PENDING' || sub . customDomain . dnsState === 'FAILED' ) && (
91+ < >
92+ < h6 > Verify your domain</ h6 >
93+ < p > Add the following DNS records to verify ownership of your domain:</ p >
94+ < pre >
95+ CNAME:
96+ Host: @
97+ Value: stacker.news
98+ </ pre >
99+ < pre >
100+ TXT:
101+ Host: @
102+ Value: ${ sub . customDomain . verificationTxt }
103+ </ pre >
104+ </ >
105+ ) }
106+ { sub . customDomain . sslState === 'PENDING' && (
107+ < >
108+ < h6 > SSL verification pending</ h6 >
109+ < p > We issued an SSL certificate for your domain.</ p >
110+ < pre >
111+ CNAME:
112+ Host: ${ sub . customDomain . verificationCname }
113+ Value: ${ sub . customDomain . verificationCnameValue }
114+ </ pre >
115+ < pre >
116+ TXT:
117+ Host: @
118+ Value: ${ sub . customDomain . verificationTxt }
119+ </ pre >
120+ </ >
121+ ) }
108122 </ Form >
109123 )
110124}
0 commit comments