Skip to content

Commit 837a5dc

Browse files
authored
fix: improved account page layout (#1088)
* Improved account page layout * Updated PayButton Pro html table style to match other tables * Fixed app crash * Updated headers to use consistent font weight style on /account page
1 parent 1c793b1 commit 837a5dc

6 files changed

Lines changed: 50 additions & 38 deletions

File tree

components/Account/ProDisplay.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const ProConfig = (): JSX.Element => {
99
const [isPro, setIsPro] = useState<boolean | null>()
1010

1111
const showLimit = (configLimit: number | 'Inf'): string => {
12-
return configLimit === 'Inf' ? 'Unlimited' : configLimit.toString()
12+
return configLimit === 'Inf' || configLimit === Infinity ? 'Unlimited' : configLimit.toString()
1313
}
1414

1515
useEffect(() => {
@@ -35,37 +35,38 @@ const ProConfig = (): JSX.Element => {
3535
}, [])
3636

3737
return <>
38-
<h3>PayButton Pro</h3>
38+
<h4 className={style.section_header}>PayButton Pro</h4>
3939
<div className={style.pro_ctn}>
4040
<div className={stylep.label}>
4141
{text}
4242
</div>
4343
{isPro === false && <ProPurchase/>}
44-
<div className={stylep.public_key_info_ctn}>
44+
<div className="paybutton-table-ctn">
4545
<table>
4646
<thead>
4747
<tr>
48-
<th></th>
48+
<th>Account Limits</th>
4949
<th>Standard</th>
5050
<th>Pro</th>
5151
</tr>
52+
<tr className="header-spacer"></tr>
5253
</thead>
5354
<tbody>
5455
<tr>
5556
<td>Outgoing Emails on Payment</td>
5657
<td>{showLimit(config.proSettings.standardDailyEmailLimit)} / day</td>
5758
<td>{showLimit(config.proSettings.proDailyEmailLimit)} / day</td>
5859
</tr>
59-
<tr>
60-
<td>Addresses Per Button</td>
61-
<td>{showLimit(config.proSettings.standardAddressesPerButtonLimit)}</td>
62-
<td>{showLimit(config.proSettings.proAddressesPerButtonLimit)}</td>
63-
</tr>
6460
<tr>
6561
<td>Outgoing Server-to-Server Messages On Payment</td>
6662
<td>{showLimit(config.proSettings.standardDailyPostLimit)} / day</td>
6763
<td>{showLimit(config.proSettings.proDailyPostLimit)} / day</td>
6864
</tr>
65+
<tr>
66+
<td>Addresses Per Button</td>
67+
<td>{showLimit(config.proSettings.standardAddressesPerButtonLimit)}</td>
68+
<td>{showLimit(config.proSettings.proAddressesPerButtonLimit)}</td>
69+
</tr>
6970
</tbody>
7071
</table>
7172
</div>

components/Account/account.module.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ body[data-theme='dark'] .changepw_ctn input {
4747
.pro_ctn {
4848
width: 100%;
4949
background-color: #fff;
50-
max-width: 700px;
5150
padding: 20px;
5251
border-radius: 10px;
5352
display: flex;
@@ -74,3 +73,8 @@ body[data-theme="dark"] .pro_ctn input {
7473
.upgrade_btn a button {
7574
width: 100%
7675
}
76+
77+
.section_header {
78+
margin: 0 0 10px 0;
79+
font-weight: 600;
80+
}

components/Organization/ViewOrganization.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const ViewOrganization = ({ user, orgMembers, setOrgMembers, organization }: IPr
2323
const [loading, setLoading] = useState(false)
2424

2525
return <>
26-
<h3 className={style.config_title}>Organization</h3>
26+
<h4 className={style.config_title}>Organization</h4>
2727
<div className={style.org_ctn}>
2828
{org !== null && org.creatorId === user.userProfile.id
2929
? (

components/Organization/organization.module.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.org_ctn {
22
width: 100%;
33
background-color: #fff;
4-
max-width: 700px;
54
padding: 20px;
65
border-radius: 10px;
76
}

pages/account/account.module.css

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,36 @@
44
--max-width: 700px;
55
}
66

7+
.account_columns {
8+
display: flex;
9+
flex-direction: column;
10+
gap: 20px;
11+
}
12+
13+
@media (min-width: 1200px) {
14+
.account_columns {
15+
flex-direction: row;
16+
align-items: flex-start;
17+
}
18+
19+
.account_column {
20+
flex: 1;
21+
min-width: 0;
22+
}
23+
}
24+
25+
.account_column {
26+
display: flex;
27+
flex-direction: column;
28+
}
29+
30+
.section_header {
31+
margin: 0 0 10px 0;
32+
}
33+
734
.account_card {
835
width: 100%;
936
background-color: var(--secondary-bg-color);
10-
max-width: var(--max-width);
1137
padding: 30px;
1238
border-radius: 8px;
1339
word-wrap: break-word;
@@ -234,26 +260,3 @@ background-color: #434343;
234260
.public_key_info_ctn {
235261
width: 100%;
236262
}
237-
238-
.public_key_info_ctn table {
239-
width: 100%;
240-
border-collapse: collapse;
241-
border-spacing: 0;
242-
margin: 0;
243-
border-radius: 6px;
244-
}
245-
246-
.public_key_info_ctn th,
247-
.public_key_info_ctn td {
248-
border: none;
249-
width: 100%;
250-
}
251-
252-
.public_key_info_ctn th {
253-
background-color: black;
254-
color: white;
255-
}
256-
257-
.public_key_info_ctn tr:nth-child(even) {
258-
background-color: var(--secondary-bg-color);
259-
}

pages/account/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,13 @@ export default function Account ({ user, userPublicKey, organization, orgMembers
103103
}
104104
}
105105

106-
if (user !== null) {
106+
if (user != null) {
107107
return (
108108
<div className={style.account_ctn}>
109109
<TopBar title="Account" user={user.stUser?.email} />
110+
<div className={style.account_columns}>
111+
<div className={style.account_column}>
112+
<h4 className={style.section_header}>General</h4>
110113
<div className={style.account_card}>
111114
<div className={style.account_row}>
112115
<div className={style.label}>Email</div>
@@ -189,11 +192,13 @@ export default function Account ({ user, userPublicKey, organization, orgMembers
189192

190193
</div>
191194
</div>
195+
</div>
192196

193-
<div>
197+
<div className={style.account_column}>
194198
{config.proSettings.enabled && <ProDisplay/>}
195199
<ViewOrganization user={user} orgMembers={orgMembers} setOrgMembers={setOrgMembers} organization={organization}/>
196200
</div>
201+
</div>
197202
</div>)
198203
}
199204
return <Page />

0 commit comments

Comments
 (0)