Skip to content

Commit ead12c8

Browse files
authored
fix(ui, next): adjust modal alignment and padding (#7931)
## Description Updates styling on modals and auth forms for more consistent spacing and alignment. - [x] I have read and understand the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository. ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## Checklist: - [ ] I have added tests that prove my fix is effective or that my feature works - [x] Existing test suite passes locally with my changes - [ ] I have made corresponding changes to the documentation
1 parent 6253ec5 commit ead12c8

File tree

30 files changed

+533
-276
lines changed

30 files changed

+533
-276
lines changed

packages/next/src/elements/LeaveWithoutSaving/index.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
position: relative;
1313
display: flex;
1414
flex-direction: column;
15-
gap: var(--base);
15+
gap: base(0.8);
1616
padding: base(2);
1717
}
1818

1919
&__content {
2020
display: flex;
2121
flex-direction: column;
22-
gap: var(--base);
22+
gap: base(0.4);
2323

2424
> * {
2525
margin: 0;
@@ -28,7 +28,7 @@
2828

2929
&__controls {
3030
display: flex;
31-
gap: var(--base);
31+
gap: base(0.4);
3232

3333
.btn {
3434
margin: 0;

packages/next/src/templates/Minimal/index.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
&--width-normal {
1616
.template-minimal__wrap {
17-
max-width: 500px;
17+
max-width: base(24);
1818
width: 100%;
1919
}
2020
}
2121

2222
&--width-wide {
2323
.template-minimal__wrap {
24-
max-width: 1024px;
24+
max-width: base(48);
2525
width: 100%;
2626
}
2727
}

packages/next/src/views/CreateFirstUser/index.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
@import '../../scss/styles.scss';
2+
13
.create-first-user {
4+
display: flex;
5+
flex-direction: column;
6+
gap: base(0.4);
7+
28
> form > .field-type {
39
margin-bottom: var(--base);
10+
11+
& .form-submit {
12+
margin: 0;
13+
}
414
}
515
}
616

packages/next/src/views/Logout/LogoutClient.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { formatAdminURL } from '@payloadcms/ui/shared'
44
import LinkImport from 'next/link.js'
55
import React, { Fragment, useEffect } from 'react'
66

7+
import './index.scss'
8+
9+
const baseClass = 'logout'
10+
711
const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default
812

913
export const LogoutClient: React.FC<{
@@ -26,7 +30,7 @@ export const LogoutClient: React.FC<{
2630

2731
if (isLoggingOut) {
2832
return (
29-
<Fragment>
33+
<div className={`${baseClass}__wrap`}>
3034
{inactivity && <h2>{t('authentication:loggedOutInactivity')}</h2>}
3135
{!inactivity && <h2>{t('authentication:loggedOutSuccessfully')}</h2>}
3236
<Button
@@ -43,7 +47,7 @@ export const LogoutClient: React.FC<{
4347
>
4448
{t('authentication:logBackIn')}
4549
</Button>
46-
</Fragment>
50+
</div>
4751
)
4852
}
4953

packages/next/src/views/Logout/index.scss

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1+
@import '../../scss/styles.scss';
2+
13
.logout {
24
display: flex;
5+
flex-direction: column;
36
align-items: center;
47
flex-wrap: wrap;
5-
min-height: 100vh;
68

79
&__wrap {
8-
& > *:first-child {
9-
margin-top: 0;
10-
}
11-
12-
& > *:last-child {
13-
margin-bottom: 0;
14-
}
10+
z-index: 1;
11+
position: relative;
12+
display: flex;
13+
flex-direction: column;
14+
align-items: flex-start;
15+
gap: base(0.8);
16+
width: 100%;
17+
max-width: base(36);
1518

16-
.btn {
19+
& > * {
1720
margin: 0;
1821
}
1922
}

packages/next/src/views/Logout/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const LogoutView: React.FC<
2525
} = initPageResult
2626

2727
return (
28-
<div className={`${baseClass}__wrap`}>
28+
<div className={`${baseClass}`}>
2929
<LogoutClient
3030
adminRoute={adminRoute}
3131
inactivity={inactivity}

packages/next/src/views/NotFound/index.client.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ export const NotFoundClient: React.FC<{
3838
.join(' ')}
3939
>
4040
<Gutter className={`${baseClass}__wrap`}>
41-
<h1>{t('general:nothingFound')}</h1>
42-
<p>{t('general:sorryNotFound')}</p>
41+
<div className={`${baseClass}__content`}>
42+
<h1>{t('general:nothingFound')}</h1>
43+
<p>{t('general:sorryNotFound')}</p>
44+
</div>
4345
<Button
4446
className={`${baseClass}__button`}
4547
el="link"

packages/next/src/views/NotFound/index.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@
1313
}
1414
}
1515

16+
&__wrap {
17+
display: flex;
18+
flex-direction: column;
19+
align-items: flex-start;
20+
gap: base(0.8);
21+
max-width: base(36);
22+
}
23+
24+
&__content {
25+
display: flex;
26+
flex-direction: column;
27+
gap: base(0.4);
28+
29+
> * {
30+
margin: 0;
31+
}
32+
}
33+
1634
&__button {
1735
margin: 0;
1836
}

packages/next/src/views/ResetPassword/index.client.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,23 @@ export const ResetPasswordClient: React.FC<Args> = ({ token }) => {
7575
method="POST"
7676
onSuccess={onSuccess}
7777
>
78-
<PasswordField
79-
field={{
80-
name: 'password',
81-
label: i18n.t('authentication:newPassword'),
82-
required: true,
83-
}}
84-
/>
85-
<ConfirmPasswordField />
86-
<HiddenField
87-
field={{
88-
name: 'token',
89-
}}
90-
forceUsePathFromProps
91-
value={token}
92-
/>
78+
<div className={'inputWrap'}>
79+
<PasswordField
80+
field={{
81+
name: 'password',
82+
label: i18n.t('authentication:newPassword'),
83+
required: true,
84+
}}
85+
/>
86+
<ConfirmPasswordField />
87+
<HiddenField
88+
field={{
89+
name: 'token',
90+
}}
91+
forceUsePathFromProps
92+
value={token}
93+
/>
94+
</div>
9395
<FormSubmit size="large">{i18n.t('authentication:resetPassword')}</FormSubmit>
9496
</Form>
9597
)
Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
1+
@import '../../scss/styles.scss';
2+
13
.reset-password {
2-
form > .field-type {
3-
margin-bottom: var(--base);
4+
&__wrap {
5+
z-index: 1;
6+
position: relative;
7+
display: flex;
8+
flex-direction: column;
9+
align-items: flex-start;
10+
gap: base(0.8);
11+
max-width: base(36);
12+
13+
& > form {
14+
width: 100%;
15+
16+
& > .inputWrap {
17+
display: flex;
18+
flex-direction: column;
19+
gap: base(0.8);
20+
21+
> * {
22+
margin: 0;
23+
}
24+
}
25+
}
26+
27+
& > .btn {
28+
margin: 0;
29+
}
430
}
531
}

0 commit comments

Comments
 (0)