Skip to content

Commit cfc3270

Browse files
committed
Show SSL status on territory edit
1 parent cf27645 commit cfc3270

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

components/territory-domains.js

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ export default function CustomDomainForm ({ sub }) {
4545
}
4646
}
4747

48+
const getSSLStatusBadge = (sslEnabled) => {
49+
switch (sslEnabled) {
50+
case true:
51+
return <Badge bg='success'>SSL enabled</Badge>
52+
case false:
53+
return <Badge bg='danger'>SSL disabled</Badge>
54+
}
55+
}
56+
4857
return (
4958
<Form
5059
initial={{
@@ -61,25 +70,28 @@ export default function CustomDomainForm ({ sub }) {
6170
{error && <Info variant='danger'>error</Info>}
6271
{success && <Info variant='success'>Domain settings updated successfully!</Info>}
6372
{sub?.customDomain && (
64-
<div className='d-flex align-items-center gap-2'>
65-
{getStatusBadge(sub.customDomain.verificationState)}
66-
<span className='text-muted'>
67-
{sub.customDomain.lastVerifiedAt &&
68-
` (Last checked: ${new Date(sub.customDomain.lastVerifiedAt).toLocaleString()})`}
69-
</span>
73+
<>
74+
<div className='d-flex align-items-center gap-2'>
75+
{getStatusBadge(sub.customDomain.verificationState)}
76+
<span className='text-muted'>
77+
{sub.customDomain.lastVerifiedAt &&
78+
` (Last checked: ${new Date(sub.customDomain.lastVerifiedAt).toLocaleString()})`}
79+
</span>
7080

71-
{sub.customDomain.verificationState === 'PENDING' && (
72-
<Info>
73-
<h6>Verify your domain</h6>
74-
<p>Add the following DNS records to verify ownership of your domain:</p>
75-
<pre>
76-
CNAME record:
77-
Host: @
78-
Value: stacker.news
79-
</pre>
80-
</Info>
81-
)}
82-
</div>
81+
{sub.customDomain.verificationState === 'PENDING' && (
82+
<Info>
83+
<h6>Verify your domain</h6>
84+
<p>Add the following DNS records to verify ownership of your domain:</p>
85+
<pre>
86+
CNAME record:
87+
Host: @
88+
Value: stacker.news
89+
</pre>
90+
</Info>
91+
)}
92+
</div>
93+
{getSSLStatusBadge(sub.customDomain.sslEnabled)}
94+
</>
8395
)}
8496
</div>
8597
}

0 commit comments

Comments
 (0)