Skip to content

Commit 9d1463d

Browse files
committed
fix: table styling for cloud project custom domains
1 parent b66cf95 commit 9d1463d

4 files changed

Lines changed: 55 additions & 28 deletions

File tree

src/app/(frontend)/(cloud)/cloud/[team-slug]/[project-slug]/(tabs)/settings/domains/ManageDomain/index.module.scss

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,29 @@
3535
color: var(--theme-text);
3636
}
3737

38+
.tableContainer {
39+
position: relative;
40+
overflow: scroll;
41+
}
42+
3843
.record {
39-
width: 100%;
44+
min-width: 100%;
45+
overflow: scroll;
4046
background: var(--theme-elevation-100);
4147
padding: 1rem;
4248

4349
th,
4450
td {
4551
padding-right: 0.5rem;
4652
vertical-align: top;
53+
min-width: 100px;
4754
}
4855

4956
th {
50-
@include label;
57+
@include small;
5158
& {
5259
font-weight: normal;
53-
font-family: var(--font-geist-mono);
60+
color: var(--theme-elevation-600);
5461
text-align: left;
5562
padding: 0.25rem 0.5rem;
5663
}
@@ -61,6 +68,13 @@
6168
padding: 0 0.5rem;
6269
white-space: nowrap;
6370
color: var(--theme-text);
71+
72+
& span {
73+
display: flex;
74+
align-items: center;
75+
gap: 1rem;
76+
margin-right: 2rem;
77+
}
6478
}
6579
}
6680

src/app/(frontend)/(cloud)/cloud/[team-slug]/[project-slug]/(tabs)/settings/domains/ManageDomain/index.tsx

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Project, Team } from '@root/payload-cloud-types.js'
22

33
import { Accordion } from '@components/Accordion/index.js'
44
import { Button } from '@components/Button/index.js'
5+
import { CopyToClipboard } from '@components/CopyToClipboard'
56
import { Heading } from '@components/Heading/index.js'
67
import { ModalWindow } from '@components/ModalWindow/index.js'
78
import { useModal } from '@faceless-ui/modal'
@@ -87,22 +88,34 @@ export const ManageDomain: React.FC<Props> = ({ domain, environmentSlug, project
8788
>
8889
<div className={classes.domainContent}>
8990
<p>Add the following record to your DNS provider:</p>
90-
<table className={classes.record}>
91-
<thead>
92-
<tr>
93-
<th>Type</th>
94-
<th>Name</th>
95-
<th>Content</th>
96-
</tr>
97-
</thead>
98-
<tbody>
99-
<tr>
100-
<td>{recordType}</td>
101-
<td>{recordName}</td>
102-
<td>{recordContent}</td>
103-
</tr>
104-
</tbody>
105-
</table>
91+
<div className={classes.tableContainer}>
92+
<table className={classes.record}>
93+
<thead>
94+
<tr>
95+
<th>Type</th>
96+
<th>Name</th>
97+
<th>Content</th>
98+
</tr>
99+
</thead>
100+
<tbody>
101+
<tr>
102+
<td>{recordType}</td>
103+
<td>
104+
<span>
105+
{recordName}
106+
{recordName && <CopyToClipboard value={recordName} />}
107+
</span>
108+
</td>
109+
<td>
110+
<span>
111+
{recordContent}
112+
{recordContent && <CopyToClipboard value={recordContent} />}
113+
</span>
114+
</td>
115+
</tr>
116+
</tbody>
117+
</table>
118+
</div>
106119
<div className={classes.domainActions}>
107120
<div className={classes.rightActions}>
108121
<Button appearance="danger" label="Delete" onClick={() => openModal(modalSlug)} />

src/app/(frontend)/(cloud)/cloud/[team-slug]/[project-slug]/(tabs)/settings/email/ManageEmailDomain/index.module.scss

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@
4242

4343
.records {
4444
display: block;
45-
background: var(--theme-elevation-50);
45+
background: var(--theme-elevation-100);
4646
padding: 1rem;
4747
overflow: auto;
4848

4949
th {
50-
@include h6;
50+
@include small;
5151
& {
5252
font-weight: normal;
53-
font-family: var(--font-geist-mono);
53+
color: var(--theme-elevation-600);
5454
text-align: left;
5555
padding: 0.25rem 0.5rem;
5656
}
@@ -65,12 +65,13 @@
6565
span {
6666
display: inline-block;
6767
vertical-align: middle;
68+
margin-right: 2rem;
6869
}
6970

7071
button {
7172
display: inline-block;
7273
vertical-align: middle;
73-
margin-right: 0.25rem;
74+
margin-right: 1rem;
7475

7576
span {
7677
width: 0;
@@ -87,10 +88,7 @@
8788
}
8889

8990
.recordName {
90-
width: 11em;
91-
9291
& > span {
93-
width: 9em;
9492
overflow: hidden;
9593
text-overflow: ellipsis;
9694
word-break: keep-all;

src/app/(frontend)/(cloud)/cloud/[team-slug]/[project-slug]/(tabs)/settings/email/ManageEmailDomain/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { Secret } from '@forms/fields/Secret/index.js'
1111
import { ExternalLinkIcon } from '@root/icons/ExternalLinkIcon/index.js'
1212
import { qs } from '@root/utilities/qs.js'
1313
import Link from 'next/link'
14+
import { useRouter } from 'next/navigation'
1415
import { useCallback, useEffect, useRef, useState } from 'react'
1516
import * as React from 'react'
1617
import { toast } from 'sonner'
@@ -42,6 +43,7 @@ export const ManageEmailDomain: React.FC<Props> = ({
4243
const projectID = project?.id
4344
const projectEmailDomains = project?.customEmailDomains
4445
const hasInitialized = useRef(false)
46+
const router = useRouter()
4547

4648
const getDomainVerificationStatus = useCallback(
4749
async (domainId: string) => {
@@ -119,7 +121,7 @@ export const ManageEmailDomain: React.FC<Props> = ({
119121

120122
if (req.status === 200) {
121123
const res = await req.json()
122-
// reloadProject()
124+
router.refresh()
123125
return res
124126
}
125127
} catch (e) {
@@ -154,7 +156,7 @@ export const ManageEmailDomain: React.FC<Props> = ({
154156

155157
if (req.status === 200) {
156158
const res = await req.json()
157-
// reloadProject()
159+
router.refresh()
158160
toast.success(res.message)
159161
}
160162
} catch (e) {

0 commit comments

Comments
 (0)