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
This commit is contained in:
@@ -12,14 +12,14 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--base);
|
gap: base(0.8);
|
||||||
padding: base(2);
|
padding: base(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
&__content {
|
&__content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--base);
|
gap: base(0.4);
|
||||||
|
|
||||||
> * {
|
> * {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
&__controls {
|
&__controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: var(--base);
|
gap: base(0.4);
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
@@ -14,14 +14,14 @@
|
|||||||
|
|
||||||
&--width-normal {
|
&--width-normal {
|
||||||
.template-minimal__wrap {
|
.template-minimal__wrap {
|
||||||
max-width: 500px;
|
max-width: base(24);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&--width-wide {
|
&--width-wide {
|
||||||
.template-minimal__wrap {
|
.template-minimal__wrap {
|
||||||
max-width: 1024px;
|
max-width: base(48);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
|
@import '../../scss/styles.scss';
|
||||||
|
|
||||||
.create-first-user {
|
.create-first-user {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
> form > .field-type {
|
> form > .field-type {
|
||||||
margin-bottom: var(--base);
|
margin-bottom: var(--base);
|
||||||
|
|
||||||
|
& .form-submit {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import { formatAdminURL } from '@payloadcms/ui/shared'
|
|||||||
import LinkImport from 'next/link.js'
|
import LinkImport from 'next/link.js'
|
||||||
import React, { Fragment, useEffect } from 'react'
|
import React, { Fragment, useEffect } from 'react'
|
||||||
|
|
||||||
|
import './index.scss'
|
||||||
|
|
||||||
|
const baseClass = 'logout'
|
||||||
|
|
||||||
const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default
|
const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default
|
||||||
|
|
||||||
export const LogoutClient: React.FC<{
|
export const LogoutClient: React.FC<{
|
||||||
@@ -26,7 +30,7 @@ export const LogoutClient: React.FC<{
|
|||||||
|
|
||||||
if (isLoggingOut) {
|
if (isLoggingOut) {
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<div className={`${baseClass}__wrap`}>
|
||||||
{inactivity && <h2>{t('authentication:loggedOutInactivity')}</h2>}
|
{inactivity && <h2>{t('authentication:loggedOutInactivity')}</h2>}
|
||||||
{!inactivity && <h2>{t('authentication:loggedOutSuccessfully')}</h2>}
|
{!inactivity && <h2>{t('authentication:loggedOutSuccessfully')}</h2>}
|
||||||
<Button
|
<Button
|
||||||
@@ -43,7 +47,7 @@ export const LogoutClient: React.FC<{
|
|||||||
>
|
>
|
||||||
{t('authentication:logBackIn')}
|
{t('authentication:logBackIn')}
|
||||||
</Button>
|
</Button>
|
||||||
</Fragment>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,22 @@
|
|||||||
|
@import '../../scss/styles.scss';
|
||||||
|
|
||||||
.logout {
|
.logout {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
min-height: 100vh;
|
|
||||||
|
|
||||||
&__wrap {
|
&__wrap {
|
||||||
& > *:first-child {
|
z-index: 1;
|
||||||
margin-top: 0;
|
position: relative;
|
||||||
}
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: base(0.8);
|
||||||
|
width: 100%;
|
||||||
|
max-width: base(36);
|
||||||
|
|
||||||
& > *:last-child {
|
& > * {
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export const LogoutView: React.FC<
|
|||||||
} = initPageResult
|
} = initPageResult
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`${baseClass}__wrap`}>
|
<div className={`${baseClass}`}>
|
||||||
<LogoutClient
|
<LogoutClient
|
||||||
adminRoute={adminRoute}
|
adminRoute={adminRoute}
|
||||||
inactivity={inactivity}
|
inactivity={inactivity}
|
||||||
|
|||||||
@@ -38,8 +38,10 @@ export const NotFoundClient: React.FC<{
|
|||||||
.join(' ')}
|
.join(' ')}
|
||||||
>
|
>
|
||||||
<Gutter className={`${baseClass}__wrap`}>
|
<Gutter className={`${baseClass}__wrap`}>
|
||||||
|
<div className={`${baseClass}__content`}>
|
||||||
<h1>{t('general:nothingFound')}</h1>
|
<h1>{t('general:nothingFound')}</h1>
|
||||||
<p>{t('general:sorryNotFound')}</p>
|
<p>{t('general:sorryNotFound')}</p>
|
||||||
|
</div>
|
||||||
<Button
|
<Button
|
||||||
className={`${baseClass}__button`}
|
className={`${baseClass}__button`}
|
||||||
el="link"
|
el="link"
|
||||||
|
|||||||
@@ -13,6 +13,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__wrap {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: base(0.8);
|
||||||
|
max-width: base(36);
|
||||||
|
}
|
||||||
|
|
||||||
|
&__content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
|
> * {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&__button {
|
&__button {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ export const ResetPasswordClient: React.FC<Args> = ({ token }) => {
|
|||||||
method="POST"
|
method="POST"
|
||||||
onSuccess={onSuccess}
|
onSuccess={onSuccess}
|
||||||
>
|
>
|
||||||
|
<div className={'inputWrap'}>
|
||||||
<PasswordField
|
<PasswordField
|
||||||
field={{
|
field={{
|
||||||
name: 'password',
|
name: 'password',
|
||||||
@@ -90,6 +91,7 @@ export const ResetPasswordClient: React.FC<Args> = ({ token }) => {
|
|||||||
forceUsePathFromProps
|
forceUsePathFromProps
|
||||||
value={token}
|
value={token}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
<FormSubmit size="large">{i18n.t('authentication:resetPassword')}</FormSubmit>
|
<FormSubmit size="large">{i18n.t('authentication:resetPassword')}</FormSubmit>
|
||||||
</Form>
|
</Form>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,31 @@
|
|||||||
|
@import '../../scss/styles.scss';
|
||||||
|
|
||||||
.reset-password {
|
.reset-password {
|
||||||
form > .field-type {
|
&__wrap {
|
||||||
margin-bottom: var(--base);
|
z-index: 1;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: base(0.8);
|
||||||
|
max-width: base(36);
|
||||||
|
|
||||||
|
& > form {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
& > .inputWrap {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.8);
|
||||||
|
|
||||||
|
> * {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& > .btn {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import type { AdminViewProps } from 'payload'
|
import type { AdminViewProps } from 'payload'
|
||||||
|
|
||||||
import { Button, Translation } from '@payloadcms/ui'
|
import { Button } from '@payloadcms/ui'
|
||||||
import { formatAdminURL } from '@payloadcms/ui/shared'
|
import { formatAdminURL, Translation } from '@payloadcms/ui/shared'
|
||||||
import LinkImport from 'next/link.js'
|
import LinkImport from 'next/link.js'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import { MinimalTemplate } from '../../templates/Minimal/index.js'
|
|
||||||
import { ResetPasswordClient } from './index.client.js'
|
import { ResetPasswordClient } from './index.client.js'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|
||||||
@@ -37,7 +36,6 @@ export const ResetPassword: React.FC<AdminViewProps> = ({ initPageResult, params
|
|||||||
|
|
||||||
if (user) {
|
if (user) {
|
||||||
return (
|
return (
|
||||||
<MinimalTemplate className={resetPasswordBaseClass}>
|
|
||||||
<div className={`${resetPasswordBaseClass}__wrap`}>
|
<div className={`${resetPasswordBaseClass}__wrap`}>
|
||||||
<h1>{i18n.t('authentication:alreadyLoggedIn')}</h1>
|
<h1>{i18n.t('authentication:alreadyLoggedIn')}</h1>
|
||||||
<p>
|
<p>
|
||||||
@@ -58,21 +56,17 @@ export const ResetPassword: React.FC<AdminViewProps> = ({ initPageResult, params
|
|||||||
t={i18n.t}
|
t={i18n.t}
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
<br />
|
<Button buttonStyle="secondary" el="link" Link={Link} size="large" to={adminRoute}>
|
||||||
<Button buttonStyle="secondary" el="link" Link={Link} to={adminRoute}>
|
|
||||||
{i18n.t('general:backToDashboard')}
|
{i18n.t('general:backToDashboard')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</MinimalTemplate>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MinimalTemplate className={resetPasswordBaseClass}>
|
|
||||||
<div className={`${resetPasswordBaseClass}__wrap`}>
|
<div className={`${resetPasswordBaseClass}__wrap`}>
|
||||||
<h1>{i18n.t('authentication:resetPassword')}</h1>
|
<h1>{i18n.t('authentication:resetPassword')}</h1>
|
||||||
<ResetPasswordClient token={token} />
|
<ResetPasswordClient token={token} />
|
||||||
</div>
|
</div>
|
||||||
</MinimalTemplate>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,24 +38,40 @@
|
|||||||
@include blur-bg;
|
@include blur-bg;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
&__toggle {
|
&__toggle {
|
||||||
@extend %btn-reset;
|
@extend %btn-reset;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__wrapper {
|
||||||
|
z-index: 1;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.8);
|
||||||
|
padding: base(2);
|
||||||
|
max-width: base(36);
|
||||||
|
}
|
||||||
|
|
||||||
|
&__content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
|
> * {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__controls {
|
||||||
|
display: flex;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
[dir='ltr'] & {
|
margin: 0;
|
||||||
margin-right: var(--base);
|
|
||||||
}
|
}
|
||||||
[dir='rtl'] & {
|
|
||||||
margin-left: var(--base);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__modal-template {
|
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import { toast } from 'sonner'
|
|||||||
|
|
||||||
import type { Props } from './types.js'
|
import type { Props } from './types.js'
|
||||||
|
|
||||||
import { MinimalTemplate } from '../../../templates/Minimal/index.js'
|
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|
||||||
const baseClass = 'restore-version'
|
const baseClass = 'restore-version'
|
||||||
@@ -123,12 +122,16 @@ const Restore: React.FC<Props> = ({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Modal className={`${baseClass}__modal`} slug={modalSlug}>
|
<Modal className={`${baseClass}__modal`} slug={modalSlug}>
|
||||||
<MinimalTemplate className={`${baseClass}__modal-template`}>
|
<div className={`${baseClass}__wrapper`}>
|
||||||
|
<div className={`${baseClass}__content`}>
|
||||||
<h1>{t('version:confirmVersionRestoration')}</h1>
|
<h1>{t('version:confirmVersionRestoration')}</h1>
|
||||||
<p>{restoreMessage}</p>
|
<p>{restoreMessage}</p>
|
||||||
|
</div>
|
||||||
|
<div className={`${baseClass}__controls`}>
|
||||||
<Button
|
<Button
|
||||||
buttonStyle="secondary"
|
buttonStyle="secondary"
|
||||||
onClick={processing ? undefined : () => toggleModal(modalSlug)}
|
onClick={processing ? undefined : () => toggleModal(modalSlug)}
|
||||||
|
size="large"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
{t('general:cancel')}
|
{t('general:cancel')}
|
||||||
@@ -136,7 +139,8 @@ const Restore: React.FC<Props> = ({
|
|||||||
<Button onClick={processing ? undefined : () => void handleRestore()}>
|
<Button onClick={processing ? undefined : () => void handleRestore()}>
|
||||||
{processing ? t('version:restoring') : t('general:confirm')}
|
{processing ? t('version:restoring') : t('general:confirm')}
|
||||||
</Button>
|
</Button>
|
||||||
</MinimalTemplate>
|
</div>
|
||||||
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,26 +4,39 @@
|
|||||||
@include blur-bg;
|
@include blur-bg;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 100%;
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: base(2);
|
height: 100%;
|
||||||
|
|
||||||
&__template {
|
|
||||||
z-index: 1;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__toggle {
|
&__toggle {
|
||||||
@extend %btn-reset;
|
@extend %btn-reset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__wrapper {
|
||||||
|
z-index: 1;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.8);
|
||||||
|
padding: base(2);
|
||||||
|
max-width: base(36);
|
||||||
|
}
|
||||||
|
|
||||||
|
&__content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
|
> * {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__controls {
|
||||||
|
display: flex;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__actions {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: $baseline;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,8 @@ export const DeleteDocument: React.FC<Props> = (props) => {
|
|||||||
{t('general:delete')}
|
{t('general:delete')}
|
||||||
</PopupList.Button>
|
</PopupList.Button>
|
||||||
<Modal className={baseClass} slug={modalSlug}>
|
<Modal className={baseClass} slug={modalSlug}>
|
||||||
<div className={`${baseClass}__template`}>
|
<div className={`${baseClass}__wrapper`}>
|
||||||
|
<div className={`${baseClass}__content`}>
|
||||||
<h1>{t('general:confirmDeletion')}</h1>
|
<h1>{t('general:confirmDeletion')}</h1>
|
||||||
<p>
|
<p>
|
||||||
<Translation
|
<Translation
|
||||||
@@ -144,16 +145,22 @@ export const DeleteDocument: React.FC<Props> = (props) => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
<div className={`${baseClass}__actions`}>
|
</div>
|
||||||
|
<div className={`${baseClass}__controls`}>
|
||||||
<Button
|
<Button
|
||||||
buttonStyle="secondary"
|
buttonStyle="secondary"
|
||||||
id="confirm-cancel"
|
id="confirm-cancel"
|
||||||
onClick={deleting ? undefined : () => toggleModal(modalSlug)}
|
onClick={deleting ? undefined : () => toggleModal(modalSlug)}
|
||||||
|
size="large"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
{t('general:cancel')}
|
{t('general:cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button id="confirm-delete" onClick={deleting ? undefined : handleDelete}>
|
<Button
|
||||||
|
id="confirm-delete"
|
||||||
|
onClick={deleting ? undefined : handleDelete}
|
||||||
|
size="large"
|
||||||
|
>
|
||||||
{deleting ? t('general:deleting') : t('general:confirm')}
|
{deleting ? t('general:deleting') : t('general:confirm')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,16 +4,35 @@
|
|||||||
@include blur-bg;
|
@include blur-bg;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 100%;
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: base(2);
|
height: 100%;
|
||||||
|
|
||||||
&__template {
|
&__wrapper {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.8);
|
||||||
|
padding: base(2);
|
||||||
|
max-width: base(36);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
|
> * {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__controls {
|
||||||
|
display: flex;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
margin-right: $baseline;
|
margin: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,21 +125,26 @@ export const DeleteMany: React.FC<Props> = (props) => {
|
|||||||
{t('general:delete')}
|
{t('general:delete')}
|
||||||
</Pill>
|
</Pill>
|
||||||
<Modal className={baseClass} slug={modalSlug}>
|
<Modal className={baseClass} slug={modalSlug}>
|
||||||
<div className={`${baseClass}__template`}>
|
<div className={`${baseClass}__wrapper`}>
|
||||||
|
<div className={`${baseClass}__content`}>
|
||||||
<h1>{t('general:confirmDeletion')}</h1>
|
<h1>{t('general:confirmDeletion')}</h1>
|
||||||
<p>{t('general:aboutToDeleteCount', { count, label: getTranslation(plural, i18n) })}</p>
|
<p>{t('general:aboutToDeleteCount', { count, label: getTranslation(plural, i18n) })}</p>
|
||||||
|
</div>
|
||||||
|
<div className={`${baseClass}__controls`}>
|
||||||
<Button
|
<Button
|
||||||
buttonStyle="secondary"
|
buttonStyle="secondary"
|
||||||
id="confirm-cancel"
|
id="confirm-cancel"
|
||||||
onClick={deleting ? undefined : () => toggleModal(modalSlug)}
|
onClick={deleting ? undefined : () => toggleModal(modalSlug)}
|
||||||
|
size="large"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
{t('general:cancel')}
|
{t('general:cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button id="confirm-delete" onClick={deleting ? undefined : handleDelete}>
|
<Button id="confirm-delete" onClick={deleting ? undefined : handleDelete} size="large">
|
||||||
{deleting ? t('general:deleting') : t('general:confirm')}
|
{deleting ? t('general:deleting') : t('general:confirm')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,16 +5,36 @@
|
|||||||
@include blur-bg;
|
@include blur-bg;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: base(2);
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
margin-right: $baseline;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&__modal-template {
|
&__wrapper {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.8);
|
||||||
|
padding: base(2);
|
||||||
|
max-width: base(36);
|
||||||
|
}
|
||||||
|
|
||||||
|
&__content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
|
> * {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__controls {
|
||||||
|
display: flex;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,21 +118,26 @@ export const DuplicateDocument: React.FC<Props> = ({ id, slug, singularLabel })
|
|||||||
</PopupList.Button>
|
</PopupList.Button>
|
||||||
{modified && hasClicked && (
|
{modified && hasClicked && (
|
||||||
<Modal className={`${baseClass}__modal`} slug={modalSlug}>
|
<Modal className={`${baseClass}__modal`} slug={modalSlug}>
|
||||||
<div className={`${baseClass}__modal-template`}>
|
<div className={`${baseClass}__wrapper`}>
|
||||||
|
<div className={`${baseClass}__content`}>
|
||||||
<h1>{t('general:confirmDuplication')}</h1>
|
<h1>{t('general:confirmDuplication')}</h1>
|
||||||
<p>{t('general:unsavedChangesDuplicate')}</p>
|
<p>{t('general:unsavedChangesDuplicate')}</p>
|
||||||
|
</div>
|
||||||
|
<div className={`${baseClass}__controls`}>
|
||||||
<Button
|
<Button
|
||||||
buttonStyle="secondary"
|
buttonStyle="secondary"
|
||||||
id="confirm-cancel"
|
id="confirm-cancel"
|
||||||
onClick={() => toggleModal(modalSlug)}
|
onClick={() => toggleModal(modalSlug)}
|
||||||
|
size="large"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
{t('general:cancel')}
|
{t('general:cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button id="confirm-duplicate" onClick={() => void confirm()}>
|
<Button id="confirm-duplicate" onClick={() => void confirm()} size="large">
|
||||||
{t('general:duplicateWithoutSaving')}
|
{t('general:duplicateWithoutSaving')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
)}
|
)}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
|||||||
@@ -6,14 +6,33 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: base(2);
|
|
||||||
|
|
||||||
&__template {
|
&__wrapper {
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.8);
|
||||||
|
padding: base(2);
|
||||||
|
max-width: base(36);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
|
> * {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__controls {
|
||||||
|
display: flex;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
margin-right: $baseline;
|
margin: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ export const GenerateConfirmation: React.FC<GenerateConfirmationProps> = (props)
|
|||||||
{t('authentication:generateNewAPIKey')}
|
{t('authentication:generateNewAPIKey')}
|
||||||
</Button>
|
</Button>
|
||||||
<Modal className={baseClass} slug={modalSlug}>
|
<Modal className={baseClass} slug={modalSlug}>
|
||||||
<div className={`${baseClass}__template`}>
|
<div className={`${baseClass}__wrapper`}>
|
||||||
|
<div className={`${baseClass}__content`}>
|
||||||
<h1>{t('authentication:confirmGeneration')}</h1>
|
<h1>{t('authentication:confirmGeneration')}</h1>
|
||||||
<p>
|
<p>
|
||||||
<Translation
|
<Translation
|
||||||
@@ -55,18 +56,21 @@ export const GenerateConfirmation: React.FC<GenerateConfirmationProps> = (props)
|
|||||||
t={t}
|
t={t}
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className={`${baseClass}__controls`}>
|
||||||
<Button
|
<Button
|
||||||
buttonStyle="secondary"
|
buttonStyle="secondary"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
toggleModal(modalSlug)
|
toggleModal(modalSlug)
|
||||||
}}
|
}}
|
||||||
|
size="large"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
{t('general:cancel')}
|
{t('general:cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={handleGenerate}>{t('authentication:generate')}</Button>
|
<Button onClick={handleGenerate}>{t('authentication:generate')}</Button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,15 +4,34 @@
|
|||||||
@include blur-bg;
|
@include blur-bg;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: base(2);
|
|
||||||
|
|
||||||
&__template {
|
&__wrapper {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.8);
|
||||||
|
padding: base(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
|
> * {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__controls {
|
||||||
|
display: flex;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
margin-right: $baseline;
|
margin: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,21 +127,30 @@ export const PublishMany: React.FC<PublishManyProps> = (props) => {
|
|||||||
{t('version:publish')}
|
{t('version:publish')}
|
||||||
</Pill>
|
</Pill>
|
||||||
<Modal className={baseClass} slug={modalSlug}>
|
<Modal className={baseClass} slug={modalSlug}>
|
||||||
<div className={`${baseClass}__template`}>
|
<div className={`${baseClass}__wrapper`}>
|
||||||
|
<div className={`${baseClass}__content`}>
|
||||||
<h1>{t('version:confirmPublish')}</h1>
|
<h1>{t('version:confirmPublish')}</h1>
|
||||||
<p>{t('version:aboutToPublishSelection', { label: getTranslation(plural, i18n) })}</p>
|
<p>{t('version:aboutToPublishSelection', { label: getTranslation(plural, i18n) })}</p>
|
||||||
|
</div>
|
||||||
|
<div className={`${baseClass}__controls`}>
|
||||||
<Button
|
<Button
|
||||||
buttonStyle="secondary"
|
buttonStyle="secondary"
|
||||||
id="confirm-cancel"
|
id="confirm-cancel"
|
||||||
onClick={submitted ? undefined : () => toggleModal(modalSlug)}
|
onClick={submitted ? undefined : () => toggleModal(modalSlug)}
|
||||||
|
size="large"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
{t('general:cancel')}
|
{t('general:cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button id="confirm-publish" onClick={submitted ? undefined : handlePublish}>
|
<Button
|
||||||
|
id="confirm-publish"
|
||||||
|
onClick={submitted ? undefined : handlePublish}
|
||||||
|
size="large"
|
||||||
|
>
|
||||||
{submitted ? t('version:publishing') : t('general:confirm')}
|
{submitted ? t('version:publishing') : t('general:confirm')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,22 +20,41 @@
|
|||||||
&__modal {
|
&__modal {
|
||||||
@include blur-bg;
|
@include blur-bg;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: base(2);
|
|
||||||
|
|
||||||
&__toggle {
|
&__toggle {
|
||||||
@extend %btn-reset;
|
@extend %btn-reset;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__wrapper {
|
||||||
|
z-index: 1;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.8);
|
||||||
|
padding: base(2);
|
||||||
|
max-width: base(36);
|
||||||
|
}
|
||||||
|
|
||||||
|
&__content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
|
> * {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__controls {
|
||||||
|
display: flex;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
margin-right: $baseline;
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__modal-template {
|
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,20 +152,28 @@ export const Status: React.FC = () => {
|
|||||||
{t('version:unpublish')}
|
{t('version:unpublish')}
|
||||||
</Button>
|
</Button>
|
||||||
<Modal className={`${baseClass}__modal`} slug={unPublishModalSlug}>
|
<Modal className={`${baseClass}__modal`} slug={unPublishModalSlug}>
|
||||||
<div className={`${baseClass}__modal-template`}>
|
<div className={`${baseClass}__wrapper`}>
|
||||||
|
<div className={`${baseClass}__content`}>
|
||||||
<h1>{t('version:confirmUnpublish')}</h1>
|
<h1>{t('version:confirmUnpublish')}</h1>
|
||||||
<p>{t('version:aboutToUnpublish')}</p>
|
<p>{t('version:aboutToUnpublish')}</p>
|
||||||
|
</div>
|
||||||
|
<div className={`${baseClass}__controls`}>
|
||||||
<Button
|
<Button
|
||||||
buttonStyle="secondary"
|
buttonStyle="secondary"
|
||||||
onClick={processing ? undefined : () => toggleModal(unPublishModalSlug)}
|
onClick={processing ? undefined : () => toggleModal(unPublishModalSlug)}
|
||||||
|
size="large"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
{t('general:cancel')}
|
{t('general:cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={processing ? undefined : () => performAction('unpublish')}>
|
<Button
|
||||||
|
onClick={processing ? undefined : () => performAction('unpublish')}
|
||||||
|
size="large"
|
||||||
|
>
|
||||||
{t(processing ? 'version:unpublishing' : 'general:confirm')}
|
{t(processing ? 'version:unpublishing' : 'general:confirm')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)}
|
)}
|
||||||
@@ -181,12 +189,16 @@ export const Status: React.FC = () => {
|
|||||||
{t('version:revertToPublished')}
|
{t('version:revertToPublished')}
|
||||||
</Button>
|
</Button>
|
||||||
<Modal className={`${baseClass}__modal`} slug={revertModalSlug}>
|
<Modal className={`${baseClass}__modal`} slug={revertModalSlug}>
|
||||||
<div className={`${baseClass}__modal-template`}>
|
<div className={`${baseClass}__wrapper`}>
|
||||||
|
<div className={`${baseClass}__content`}>
|
||||||
<h1>{t('version:confirmRevertToSaved')}</h1>
|
<h1>{t('version:confirmRevertToSaved')}</h1>
|
||||||
<p>{t('version:aboutToRevertToPublished')}</p>
|
<p>{t('version:aboutToRevertToPublished')}</p>
|
||||||
|
</div>
|
||||||
|
<div className={`${baseClass}__controls`}>
|
||||||
<Button
|
<Button
|
||||||
buttonStyle="secondary"
|
buttonStyle="secondary"
|
||||||
onClick={processing ? undefined : () => toggleModal(revertModalSlug)}
|
onClick={processing ? undefined : () => toggleModal(revertModalSlug)}
|
||||||
|
size="large"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
{t('general:cancel')}
|
{t('general:cancel')}
|
||||||
@@ -194,10 +206,12 @@ export const Status: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
id="action-revert-to-published-confirm"
|
id="action-revert-to-published-confirm"
|
||||||
onClick={processing ? undefined : () => performAction('revert')}
|
onClick={processing ? undefined : () => performAction('revert')}
|
||||||
|
size="large"
|
||||||
>
|
>
|
||||||
{t(processing ? 'version:reverting' : 'general:confirm')}
|
{t(processing ? 'version:reverting' : 'general:confirm')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
'use client'
|
|
||||||
import type { ClientTranslationKeys, TFunction } from '@payloadcms/translations'
|
import type { ClientTranslationKeys, TFunction } from '@payloadcms/translations'
|
||||||
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|||||||
@@ -4,15 +4,34 @@
|
|||||||
@include blur-bg;
|
@include blur-bg;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: base(2);
|
|
||||||
|
|
||||||
&__template {
|
&__wrapper {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.8);
|
||||||
|
padding: base(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
|
> * {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__controls {
|
||||||
|
display: flex;
|
||||||
|
gap: base(0.4);
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
margin-right: $baseline;
|
margin: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,21 +124,30 @@ export const UnpublishMany: React.FC<UnpublishManyProps> = (props) => {
|
|||||||
{t('version:unpublish')}
|
{t('version:unpublish')}
|
||||||
</Pill>
|
</Pill>
|
||||||
<Modal className={baseClass} slug={modalSlug}>
|
<Modal className={baseClass} slug={modalSlug}>
|
||||||
<div className={`${baseClass}__template`}>
|
<div className={`${baseClass}__wrapper`}>
|
||||||
|
<div className={`${baseClass}__content`}>
|
||||||
<h1>{t('version:confirmUnpublish')}</h1>
|
<h1>{t('version:confirmUnpublish')}</h1>
|
||||||
<p>{t('version:aboutToUnpublishSelection', { label: getTranslation(plural, i18n) })}</p>
|
<p>{t('version:aboutToUnpublishSelection', { label: getTranslation(plural, i18n) })}</p>
|
||||||
|
</div>
|
||||||
|
<div className={`${baseClass}__controls`}>
|
||||||
<Button
|
<Button
|
||||||
buttonStyle="secondary"
|
buttonStyle="secondary"
|
||||||
id="confirm-cancel"
|
id="confirm-cancel"
|
||||||
onClick={submitted ? undefined : () => toggleModal(modalSlug)}
|
onClick={submitted ? undefined : () => toggleModal(modalSlug)}
|
||||||
|
size="large"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
{t('general:cancel')}
|
{t('general:cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button id="confirm-unpublish" onClick={submitted ? undefined : handleUnpublish}>
|
<Button
|
||||||
|
id="confirm-unpublish"
|
||||||
|
onClick={submitted ? undefined : handleUnpublish}
|
||||||
|
size="large"
|
||||||
|
>
|
||||||
{submitted ? t('version:unpublishing') : t('general:confirm')}
|
{submitted ? t('version:unpublishing') : t('general:confirm')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// IMPORTANT: the shared.ts file CANNOT contain any Server Components _that import client components_.
|
// IMPORTANT: the shared.ts file CANNOT contain any Server Components _that import client components_.
|
||||||
|
export { Translation } from '../../elements/Translation/index.js'
|
||||||
export { withMergedProps } from '../../elements/withMergedProps/index.js' // cannot be within a 'use client', thus we export this from shared
|
export { withMergedProps } from '../../elements/withMergedProps/index.js' // cannot be within a 'use client', thus we export this from shared
|
||||||
export { WithServerSideProps } from '../../elements/WithServerSideProps/index.js'
|
export { WithServerSideProps } from '../../elements/WithServerSideProps/index.js'
|
||||||
export { PayloadIcon } from '../../graphics/Icon/index.js'
|
export { PayloadIcon } from '../../graphics/Icon/index.js'
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
|
// DO NOT MODIFY. This file is automatically generated in initDevAndTest.ts
|
||||||
|
|
||||||
// DO NOT MODIFY. This file is automatically generated in initDevAndTest.ts
|
import { mongooseAdapter } from '@payloadcms/db-mongodb'
|
||||||
|
|
||||||
|
export const databaseAdapter = mongooseAdapter({
|
||||||
import { mongooseAdapter } from '@payloadcms/db-mongodb'
|
|
||||||
|
|
||||||
export const databaseAdapter = mongooseAdapter({
|
|
||||||
url:
|
url:
|
||||||
process.env.MONGODB_MEMORY_SERVER_URI ||
|
process.env.MONGODB_MEMORY_SERVER_URI ||
|
||||||
process.env.DATABASE_URI ||
|
process.env.DATABASE_URI ||
|
||||||
@@ -12,5 +10,4 @@
|
|||||||
collation: {
|
collation: {
|
||||||
strength: 1,
|
strength: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user