chore: significantly improve eslint performance, lint and prettier everything

This commit is contained in:
Alessio Gravili
2024-08-29 21:25:50 -04:00
parent bc367ab73c
commit 86fdad0bb8
653 changed files with 50289 additions and 19143 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
<a href="https://payloadcms.com"><img width="100%" src="https://github.com/payloadcms/payload/blob/main/packages/payload/src/admin/assets/images/github-banner-alt.jpg?raw=true" alt="Payload headless CMS Admin panel built with React" /></a> <a href="https://payloadcms.com"><img width="100%" src="https://github.com/payloadcms/payload/blob/main/packages/payload/src/admin/assets/images/github-banner-alt.jpg?raw=true" alt="Payload headless CMS Admin panel built with React" /></a>
<br /> <br />
<br /> <br />
<p align="left"> <p align="left">
<a href="https://github.com/payloadcms/payload/actions"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/payloadcms/payload/main.yml?style=flat-square"></a> <a href="https://github.com/payloadcms/payload/actions"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/payloadcms/payload/main.yml?style=flat-square"></a>
&nbsp; &nbsp;

View File

@@ -28,9 +28,8 @@ export const rootParserOptions = {
sourceType: 'module', sourceType: 'module',
ecmaVersion: 'latest', ecmaVersion: 'latest',
projectService: { projectService: {
allowDefaultProject: ['./src/*.ts', './src/*.tsx'],
defaultProject: './tsconfig.json',
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 40, maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 40,
allowDefaultProject: ['scripts/*.ts', '*.js', '*.mjs', '*.spec.ts'],
}, },
} }
@@ -46,15 +45,6 @@ export const rootEslintConfig = [
'templates/**', 'templates/**',
], ],
}, },
{
languageOptions: {
parserOptions: {
project: './tsconfig.json',
tsconfigDirName: import.meta.dirname,
...rootParserOptions,
},
},
},
{ {
plugins: { plugins: {
payload: payloadPlugin, payload: payloadPlugin,
@@ -79,6 +69,15 @@ export const rootEslintConfig = [
export default [ export default [
...rootEslintConfig, ...rootEslintConfig,
{
languageOptions: {
parserOptions: {
...rootParserOptions,
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{ {
files: ['packages/eslint-config/**/*.ts'], files: ['packages/eslint-config/**/*.ts'],
rules: { rules: {

View File

@@ -15,7 +15,7 @@
width: 150px; width: 150px;
} }
:global([data-theme="light"]) { :global([data-theme='light']) {
.logo { .logo {
filter: invert(1); filter: invert(1);
} }

View File

@@ -10,12 +10,12 @@ export const RenderParams: React.FC<{
className?: string className?: string
}> = ({ params = ['error', 'message', 'success'], message, className }) => { }> = ({ params = ['error', 'message', 'success'], message, className }) => {
const searchParams = useSearchParams() const searchParams = useSearchParams()
const paramValues = params.map(param => searchParams.get(param)).filter(Boolean) const paramValues = params.map((param) => searchParams.get(param)).filter(Boolean)
if (paramValues.length) { if (paramValues.length) {
return ( return (
<div className={className}> <div className={className}>
{paramValues.map(paramValue => ( {paramValues.map((paramValue) => (
<Message <Message
key={paramValue} key={paramValue}
message={(message || 'PARAM')?.replace('PARAM', paramValue || '')} message={(message || 'PARAM')?.replace('PARAM', paramValue || '')}

View File

@@ -1,7 +1,7 @@
@use './queries.scss' as *; @use './queries.scss' as *;
@use './colors.scss' as *; @use './colors.scss' as *;
@use './type.scss' as *; @use './type.scss' as *;
@import "./theme.scss"; @import './theme.scss';
:root { :root {
--base: 24px; --base: 24px;
@@ -88,7 +88,7 @@ p {
margin: var(--base) 0; margin: var(--base) 0;
@include mid-break { @include mid-break {
margin: calc(var(--base) * .75) 0; margin: calc(var(--base) * 0.75) 0;
} }
} }
@@ -102,12 +102,12 @@ a {
color: currentColor; color: currentColor;
&:focus { &:focus {
opacity: .8; opacity: 0.8;
outline: none; outline: none;
} }
&:active { &:active {
opacity: .7; opacity: 0.7;
outline: none; outline: none;
} }
} }

View File

@@ -16,7 +16,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode; api?: 'rest' |
const [user, setUser] = useState<User | null>() const [user, setUser] = useState<User | null>()
const create = useCallback<Create>( const create = useCallback<Create>(
async args => { async (args) => {
if (api === 'rest') { if (api === 'rest') {
const user = await rest(`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users`, args) const user = await rest(`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users`, args)
setUser(user) setUser(user)
@@ -38,7 +38,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode; api?: 'rest' |
) )
const login = useCallback<Login>( const login = useCallback<Login>(
async args => { async (args) => {
if (api === 'rest') { if (api === 'rest') {
const user = await rest(`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/login`, args) const user = await rest(`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/login`, args)
setUser(user) setUser(user)
@@ -110,7 +110,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode; api?: 'rest' |
}, [api]) }, [api])
const forgotPassword = useCallback<ForgotPassword>( const forgotPassword = useCallback<ForgotPassword>(
async args => { async (args) => {
if (api === 'rest') { if (api === 'rest') {
const user = await rest( const user = await rest(
`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/forgot-password`, `${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/forgot-password`,
@@ -132,7 +132,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode; api?: 'rest' |
) )
const resetPassword = useCallback<ResetPassword>( const resetPassword = useCallback<ResetPassword>(
async args => { async (args) => {
if (api === 'rest') { if (api === 'rest') {
const user = await rest( const user = await rest(
`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/reset-password`, `${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/reset-password`,

View File

@@ -1,4 +1,4 @@
@import "../../_css/common"; @import '../../_css/common';
.form { .form {
margin-bottom: var(--base); margin-bottom: var(--base);

View File

@@ -139,7 +139,7 @@ export const AccountForm: React.FC = () => {
label="Confirm Password" label="Confirm Password"
required required
register={register} register={register}
validate={value => value === password.current || 'The passwords do not match'} validate={(value) => value === password.current || 'The passwords do not match'}
error={errors.passwordConfirm} error={errors.passwordConfirm}
/> />
</Fragment> </Fragment>

View File

@@ -1,4 +1,4 @@
@import "../../_css/common"; @import '../../_css/common';
.form { .form {
margin-bottom: var(--base); margin-bottom: var(--base);

View File

@@ -103,7 +103,7 @@ export const CreateAccountForm: React.FC = () => {
label="Confirm Password" label="Confirm Password"
required required
register={register} register={register}
validate={value => value === password.current || 'The passwords do not match'} validate={(value) => value === password.current || 'The passwords do not match'}
error={errors.passwordConfirm} error={errors.passwordConfirm}
/> />
<Button <Button

View File

@@ -1,4 +1,4 @@
@import "../_css/common"; @import '../_css/common';
.createAccount { .createAccount {
margin-bottom: var(--block-padding); margin-bottom: var(--block-padding);

View File

@@ -1,4 +1,4 @@
@import "../../_css/common"; @import '../../_css/common';
.form { .form {
margin-bottom: var(--base); margin-bottom: var(--base);

View File

@@ -1,4 +1,4 @@
@import "../_css/common"; @import '../_css/common';
.login { .login {
margin-bottom: var(--block-padding); margin-bottom: var(--block-padding);

View File

@@ -5,7 +5,7 @@ import Link from 'next/link'
import { useAuth } from '../../_providers/Auth' import { useAuth } from '../../_providers/Auth'
export const LogoutPage: React.FC = props => { export const LogoutPage: React.FC = (props) => {
const { logout } = useAuth() const { logout } = useAuth()
const [success, setSuccess] = useState('') const [success, setSuccess] = useState('')
const [error, setError] = useState('') const [error, setError] = useState('')

View File

@@ -1,4 +1,4 @@
@import "../../_css/common"; @import '../../_css/common';
.error { .error {
color: red; color: red;
@@ -20,4 +20,3 @@
.message { .message {
margin-bottom: var(--base); margin-bottom: var(--base);
} }

View File

@@ -1,4 +1,4 @@
@import "../_css/common"; @import '../_css/common';
.recoverPassword { .recoverPassword {
margin-bottom: var(--block-padding); margin-bottom: var(--block-padding);

View File

@@ -1,4 +1,4 @@
@import "../../_css/common"; @import '../../_css/common';
.form { .form {
width: 66.66%; width: 66.66%;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,7 @@
width: 150px; width: 150px;
} }
:global([data-theme="light"]) { :global([data-theme='light']) {
.logo { .logo {
filter: invert(1); filter: invert(1);
} }

View File

@@ -9,12 +9,12 @@ export const RenderParams: React.FC<{
}> = ({ params = ['error', 'message', 'success'], message, className }) => { }> = ({ params = ['error', 'message', 'success'], message, className }) => {
const router = useRouter() const router = useRouter()
const searchParams = new URLSearchParams(router.query as any) const searchParams = new URLSearchParams(router.query as any)
const paramValues = params.map(param => searchParams.get(param)).filter(Boolean) const paramValues = params.map((param) => searchParams.get(param)).filter(Boolean)
if (paramValues.length) { if (paramValues.length) {
return ( return (
<div className={className}> <div className={className}>
{paramValues.map(paramValue => ( {paramValues.map((paramValue) => (
<Message key={paramValue} message={(message || 'PARAM')?.replace('PARAM', paramValue)} /> <Message key={paramValue} message={(message || 'PARAM')?.replace('PARAM', paramValue)} />
))} ))}
</div> </div>

View File

@@ -1,7 +1,7 @@
@use './queries.scss' as *; @use './queries.scss' as *;
@use './colors.scss' as *; @use './colors.scss' as *;
@use './type.scss' as *; @use './type.scss' as *;
@import "./theme.scss"; @import './theme.scss';
:root { :root {
--base: 24px; --base: 24px;
@@ -88,7 +88,7 @@ p {
margin: var(--base) 0; margin: var(--base) 0;
@include mid-break { @include mid-break {
margin: calc(var(--base) * .75) 0; margin: calc(var(--base) * 0.75) 0;
} }
} }
@@ -102,12 +102,12 @@ a {
color: currentColor; color: currentColor;
&:focus { &:focus {
opacity: .8; opacity: 0.8;
outline: none; outline: none;
} }
&:active { &:active {
opacity: .7; opacity: 0.7;
outline: none; outline: none;
} }
} }

View File

@@ -1,4 +1,4 @@
@import "../../css/common"; @import '../../css/common';
.account { .account {
margin-bottom: var(--block-padding); margin-bottom: var(--block-padding);

View File

@@ -150,7 +150,7 @@ const Account: React.FC = () => {
label="Confirm Password" label="Confirm Password"
required required
register={register} register={register}
validate={value => value === password.current || 'The passwords do not match'} validate={(value) => value === password.current || 'The passwords do not match'}
error={errors.passwordConfirm} error={errors.passwordConfirm}
/> />
</Fragment> </Fragment>

View File

@@ -1,4 +1,4 @@
@import "../../css/common"; @import '../../css/common';
.createAccount { .createAccount {
margin-bottom: var(--block-padding); margin-bottom: var(--block-padding);

View File

@@ -106,7 +106,7 @@ const CreateAccount: React.FC = () => {
label="Confirm Password" label="Confirm Password"
required required
register={register} register={register}
validate={value => value === password.current || 'The passwords do not match'} validate={(value) => value === password.current || 'The passwords do not match'}
error={errors.passwordConfirm} error={errors.passwordConfirm}
/> />
<Button <Button

View File

@@ -1,4 +1,4 @@
@import "../../css/common"; @import '../../css/common';
.login { .login {
margin-bottom: var(--block-padding); margin-bottom: var(--block-padding);

View File

@@ -1,4 +1,4 @@
@import "../../css/common"; @import '../../css/common';
.recoverPassword { .recoverPassword {
margin-bottom: var(--block-padding); margin-bottom: var(--block-padding);
@@ -24,4 +24,3 @@
.message { .message {
margin-bottom: var(--base); margin-bottom: var(--base);
} }

View File

@@ -1,4 +1,4 @@
@import "../../css/common"; @import '../../css/common';
.resetPassword { .resetPassword {
margin-bottom: var(--block-padding); margin-bottom: var(--block-padding);

View File

@@ -14,7 +14,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode; api?: 'rest' |
const [user, setUser] = useState<User | null>() const [user, setUser] = useState<User | null>()
const create = useCallback<Create>( const create = useCallback<Create>(
async args => { async (args) => {
if (api === 'rest') { if (api === 'rest') {
const user = await rest(`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users`, args) const user = await rest(`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users`, args)
setUser(user) setUser(user)
@@ -36,7 +36,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode; api?: 'rest' |
) )
const login = useCallback<Login>( const login = useCallback<Login>(
async args => { async (args) => {
if (api === 'rest') { if (api === 'rest') {
const user = await rest(`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/login`, args) const user = await rest(`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/login`, args)
setUser(user) setUser(user)
@@ -108,7 +108,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode; api?: 'rest' |
}, [api]) }, [api])
const forgotPassword = useCallback<ForgotPassword>( const forgotPassword = useCallback<ForgotPassword>(
async args => { async (args) => {
if (api === 'rest') { if (api === 'rest') {
const user = await rest( const user = await rest(
`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/forgot-password`, `${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/forgot-password`,
@@ -130,7 +130,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode; api?: 'rest' |
) )
const resetPassword = useCallback<ResetPassword>( const resetPassword = useCallback<ResetPassword>(
async args => { async (args) => {
if (api === 'rest') { if (api === 'rest') {
const user = await rest( const user = await rest(
`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/reset-password`, `${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/users/reset-password`,

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
'use client' 'use client'
import type { ElementType } from 'react'; import type { ElementType } from 'react'
import Link from 'next/link' import Link from 'next/link'
import React from 'react' import React from 'react'

View File

@@ -1,4 +1,4 @@
import type { Ref } from 'react'; import type { Ref } from 'react'
import React, { forwardRef } from 'react' import React, { forwardRef } from 'react'

View File

@@ -15,7 +15,7 @@
width: 150px; width: 150px;
} }
:global([data-theme="light"]) { :global([data-theme='light']) {
.logo { .logo {
filter: invert(1); filter: invert(1);
} }

View File

@@ -10,12 +10,12 @@ export const RenderParams: React.FC<{
params?: string[] params?: string[]
}> = ({ className, message, params = ['error', 'message', 'success'] }) => { }> = ({ className, message, params = ['error', 'message', 'success'] }) => {
const searchParams = useSearchParams() const searchParams = useSearchParams()
const paramValues = params.map(param => searchParams.get(param)).filter(Boolean) const paramValues = params.map((param) => searchParams.get(param)).filter(Boolean)
if (paramValues.length) { if (paramValues.length) {
return ( return (
<div className={className}> <div className={className}>
{paramValues.map(paramValue => ( {paramValues.map((paramValue) => (
<Message <Message
key={paramValue} key={paramValue}
message={(message || 'PARAM')?.replace('PARAM', paramValue || '')} message={(message || 'PARAM')?.replace('PARAM', paramValue || '')}

View File

@@ -1,4 +1,4 @@
@import "../../_css/common"; @import '../../_css/common';
.form { .form {
margin-bottom: var(--base); margin-bottom: var(--base);

View File

@@ -136,7 +136,7 @@ export const AccountForm: React.FC = () => {
register={register} register={register}
required required
type="password" type="password"
validate={value => value === password.current || 'The passwords do not match'} validate={(value) => value === password.current || 'The passwords do not match'}
/> />
</Fragment> </Fragment>
)} )}

View File

@@ -1,4 +1,4 @@
@import "../../_css/common"; @import '../../_css/common';
.form { .form {
margin-bottom: var(--base); margin-bottom: var(--base);

View File

@@ -103,7 +103,7 @@ export const CreateAccountForm: React.FC = () => {
register={register} register={register}
required required
type="password" type="password"
validate={value => value === password.current || 'The passwords do not match'} validate={(value) => value === password.current || 'The passwords do not match'}
/> />
<Button <Button
appearance="primary" appearance="primary"

View File

@@ -1,4 +1,4 @@
@import "../_css/common"; @import '../_css/common';
.createAccount { .createAccount {
margin-bottom: var(--block-padding); margin-bottom: var(--block-padding);

View File

@@ -1,4 +1,4 @@
@import "../../_css/common"; @import '../../_css/common';
.form { .form {
margin-bottom: var(--base); margin-bottom: var(--base);

View File

@@ -1,4 +1,4 @@
@import "../_css/common"; @import '../_css/common';
.login { .login {
margin-bottom: var(--block-padding); margin-bottom: var(--block-padding);

View File

@@ -1,4 +1,4 @@
@import "../../_css/common"; @import '../../_css/common';
.error { .error {
color: red; color: red;
@@ -20,4 +20,3 @@
.message { .message {
margin-bottom: var(--base); margin-bottom: var(--base);
} }

View File

@@ -1,4 +1,4 @@
@import "../_css/common"; @import '../_css/common';
.recoverPassword { .recoverPassword {
margin-bottom: var(--block-padding); margin-bottom: var(--block-padding);

View File

@@ -1,4 +1,4 @@
@import "../../_css/common"; @import '../../_css/common';
.form { .form {
width: 66.66%; width: 66.66%;

View File

@@ -3,8 +3,8 @@ import type { User } from '../../payload-types'
export const checkRole = (allRoles: User['roles'] = [], user: User = undefined): boolean => { export const checkRole = (allRoles: User['roles'] = [], user: User = undefined): boolean => {
if (user) { if (user) {
if ( if (
allRoles.some(role => { allRoles.some((role) => {
return user?.roles?.some(individualRole => { return user?.roles?.some((individualRole) => {
return individualRole === role return individualRole === role
}) })
}) })

View File

@@ -100,10 +100,10 @@ On boot, a seed script is included to scaffold a basic database for you to use a
### Conflicting routes ### Conflicting routes
>In a monorepo when routes are bootstrapped to the same host, they can conflict with Payload's own routes if they have the same name. In our template we've named the Nextjs API routes to `next` to avoid this conflict. > In a monorepo when routes are bootstrapped to the same host, they can conflict with Payload's own routes if they have the same name. In our template we've named the Nextjs API routes to `next` to avoid this conflict.
> >
>This can happen with any other routes conflicting with Payload such as `admin` and we recommend using different names for custom routes. > This can happen with any other routes conflicting with Payload such as `admin` and we recommend using different names for custom routes.
>Alternatively you can also rename Payload's own routes via the [configuration](https://payloadcms.com/docs/configuration/overview). > Alternatively you can also rename Payload's own routes via the [configuration](https://payloadcms.com/docs/configuration/overview).
## Production ## Production

View File

@@ -10,12 +10,12 @@ const files = ['./next.config.js', './next-env.d.ts']
const directories = ['./src/app'] const directories = ['./src/app']
const eject = async (): Promise<void> => { const eject = async (): Promise<void> => {
files.forEach(file => { files.forEach((file) => {
fs.unlinkSync(path.join(__dirname, file)) fs.unlinkSync(path.join(__dirname, file))
}) })
directories.forEach(directory => { directories.forEach((directory) => {
fs.rm(path.join(__dirname, directory), { recursive: true }, err => { fs.rm(path.join(__dirname, directory), { recursive: true }, (err) => {
if (err) throw err if (err) throw err
}) })
}) })

View File

@@ -29,7 +29,18 @@ $breakpoint: 1000px;
html { html {
font-size: 20px; font-size: 20px;
line-height: 1.5; line-height: 1.5;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; font-family:
system-ui,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Oxygen,
Ubuntu,
Cantarell,
'Open Sans',
'Helvetica Neue',
sans-serif;
@media (max-width: $breakpoint) { @media (max-width: $breakpoint) {
font-size: 16px; font-size: 16px;

View File

@@ -20,7 +20,7 @@ const start = async (): Promise<void> => {
const payload = await getPayloadClient({ const payload = await getPayloadClient({
initOptions: { initOptions: {
express: app, express: app,
onInit: async newPayload => { onInit: async (newPayload) => {
newPayload.logger.info(`Payload Admin URL: ${newPayload.getAdminURL()}`) newPayload.logger.info(`Payload Admin URL: ${newPayload.getAdminURL()}`)
}, },
}, },

View File

@@ -18,7 +18,7 @@ const start = async (): Promise<void> => {
const payload = await getPayloadClient({ const payload = await getPayloadClient({
initOptions: { initOptions: {
express: app, express: app,
onInit: async newPayload => { onInit: async (newPayload) => {
newPayload.logger.info(`Payload Admin URL: ${newPayload.getAdminURL()}`) newPayload.logger.info(`Payload Admin URL: ${newPayload.getAdminURL()}`)
}, },
}, },

View File

@@ -4,10 +4,7 @@
"module": "commonjs", "module": "commonjs",
"outDir": "dist", "outDir": "dist",
"noEmit": false, "noEmit": false,
"jsx": "react", "jsx": "react"
}, },
"include": [ "include": ["src/server.ts", "src/payload.config.ts"]
"src/server.ts",
"src/payload.config.ts",
]
} }

View File

@@ -33,7 +33,7 @@ export const fetchPage = async (
} }
: {}), : {}),
}, },
).then(res => res.json()) ).then((res) => res.json())
return pageRes?.docs?.[0] ?? null return pageRes?.docs?.[0] ?? null
} }

View File

@@ -3,8 +3,8 @@ import type { Page } from '../../payload-types'
export const fetchPages = async (): Promise<Page[]> => { export const fetchPages = async (): Promise<Page[]> => {
const pageRes: { const pageRes: {
docs: Page[] docs: Page[]
} = await fetch(`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/pages?depth=0&limit=100`).then(res => } = await fetch(`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/pages?depth=0&limit=100`).then(
res.json(), (res) => res.json(),
) // eslint-disable-line function-paren-newline ) // eslint-disable-line function-paren-newline
return pageRes?.docs ?? [] return pageRes?.docs ?? []

View File

@@ -9,7 +9,7 @@ import classes from './index.module.scss'
const Title: React.FC = () => <span>Dashboard</span> const Title: React.FC = () => <span>Dashboard</span>
export const AdminBarClient: React.FC<PayloadAdminBarProps> = props => { export const AdminBarClient: React.FC<PayloadAdminBarProps> = (props) => {
const [user, setUser] = useState<PayloadMeUser>() const [user, setUser] = useState<PayloadMeUser>()
return ( return (

View File

@@ -11,7 +11,7 @@ import classes from './index.module.scss'
export async function Header() { export async function Header() {
const mainMenu: MainMenu = await fetch( const mainMenu: MainMenu = await fetch(
`${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/globals/main-menu`, `${process.env.NEXT_PUBLIC_PAYLOAD_URL}/api/globals/main-menu`,
).then(res => res.json()) ).then((res) => res.json())
const { navItems } = mainMenu const { navItems } = mainMenu

View File

@@ -29,7 +29,18 @@ $breakpoint: 1000px;
html { html {
font-size: 20px; font-size: 20px;
line-height: 1.5; line-height: 1.5;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; font-family:
system-ui,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Oxygen,
Ubuntu,
Cantarell,
'Open Sans',
'Helvetica Neue',
sans-serif;
@media (max-width: $breakpoint) { @media (max-width: $breakpoint) {
font-size: 16px; font-size: 16px;

View File

@@ -11,7 +11,7 @@ export const AdminBar: React.FC<{
adminBarProps?: PayloadAdminBarProps adminBarProps?: PayloadAdminBarProps
user?: PayloadMeUser user?: PayloadMeUser
setUser?: (user: PayloadMeUser) => void // eslint-disable-line no-unused-vars setUser?: (user: PayloadMeUser) => void // eslint-disable-line no-unused-vars
}> = props => { }> = (props) => {
const { adminBarProps, user, setUser } = props const { adminBarProps, user, setUser } = props
return ( return (

View File

@@ -43,7 +43,7 @@ export const Header: React.FC<{
mainMenu: MainMenu mainMenu: MainMenu
} }
adminBarProps: PayloadAdminBarProps adminBarProps: PayloadAdminBarProps
}> = props => { }> = (props) => {
const { globals, adminBarProps } = props const { globals, adminBarProps } = props
const [user, setUser] = useState<PayloadMeUser>() const [user, setUser] = useState<PayloadMeUser>()

View File

@@ -14,7 +14,7 @@ const Page: React.FC<
mainMenu: MainMenu mainMenu: MainMenu
preview?: boolean preview?: boolean
} }
> = props => { > = (props) => {
const { title, richText } = props const { title, richText } = props
return ( return (
@@ -119,7 +119,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
const { docs: pages } = pagesData const { docs: pages } = pagesData
if (pages && Array.isArray(pages) && pages.length > 0) { if (pages && Array.isArray(pages) && pages.length > 0) {
paths = pages.map(page => ({ params: { slug: page.slug } })) paths = pages.map((page) => ({ params: { slug: page.slug } }))
} }
} }

View File

@@ -29,7 +29,18 @@ $breakpoint: 1000px;
html { html {
font-size: 20px; font-size: 20px;
line-height: 1.5; line-height: 1.5;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; font-family:
system-ui,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Oxygen,
Ubuntu,
Cantarell,
'Open Sans',
'Helvetica Neue',
sans-serif;
@media (max-width: $breakpoint) { @media (max-width: $breakpoint) {
font-size: 16px; font-size: 16px;
@@ -136,7 +147,18 @@ $breakpoint: 1000px;
html { html {
font-size: 20px; font-size: 20px;
line-height: 1.5; line-height: 1.5;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; font-family:
system-ui,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Oxygen,
Ubuntu,
Cantarell,
'Open Sans',
'Helvetica Neue',
sans-serif;
@media (max-width: $breakpoint) { @media (max-width: $breakpoint) {
font-size: 16px; font-size: 16px;

View File

@@ -4,7 +4,7 @@ import Page, { getStaticProps as sharedGetStaticProps } from './[slug]'
export default Page export default Page
export const getStaticProps: GetStaticProps = async ctx => { export const getStaticProps: GetStaticProps = async (ctx) => {
const func = sharedGetStaticProps.bind(this) const func = sharedGetStaticProps.bind(this)
return func(ctx) return func(ctx)
} }

View File

@@ -12,10 +12,10 @@
"preLaunchTask": "npm: build:server", "preLaunchTask": "npm: build:server",
"env": { "env": {
"PAYLOAD_CONFIG_PATH": "${workspaceFolder}/src/payload.config.ts" "PAYLOAD_CONFIG_PATH": "${workspaceFolder}/src/payload.config.ts"
}, }
// "outFiles": [ // "outFiles": [
// "${workspaceFolder}/dist/**/*.js" // "${workspaceFolder}/dist/**/*.js"
// ] // ]
}, }
] ]
} }

View File

@@ -11,7 +11,7 @@ export const Pages: CollectionConfig = {
admin: { admin: {
useAsTitle: 'title', useAsTitle: 'title',
defaultColumns: ['title', 'slug', 'updatedAt'], defaultColumns: ['title', 'slug', 'updatedAt'],
preview: doc => { preview: (doc) => {
return `${process.env.PAYLOAD_PUBLIC_SITE_URL}/api/preview?url=${encodeURIComponent( return `${process.env.PAYLOAD_PUBLIC_SITE_URL}/api/preview?url=${encodeURIComponent(
formatAppURL({ formatAppURL({
doc, doc,

View File

@@ -125,7 +125,7 @@ const link: LinkType = ({ appearances, disableLabel = false, overrides = {} } =
] ]
if (appearances) { if (appearances) {
appearanceOptionsToUse = appearances.map(appearance => appearanceOptions[appearance]) appearanceOptionsToUse = appearances.map((appearance) => appearanceOptions[appearance])
} }
linkResult.fields.push({ linkResult.fields.push({

View File

@@ -17,7 +17,7 @@ export function isObject(item: unknown): boolean {
export default function deepMerge<T, R>(target: T, source: R): T { export default function deepMerge<T, R>(target: T, source: R): T {
const output = { ...target } const output = { ...target }
if (isObject(target) && isObject(source)) { if (isObject(target) && isObject(source)) {
Object.keys(source).forEach(key => { Object.keys(source).forEach((key) => {
if (isObject(source[key])) { if (isObject(source[key])) {
if (!(key in target)) { if (!(key in target)) {
Object.assign(output, { [key]: source[key] }) Object.assign(output, { [key]: source[key] })

View File

@@ -32,7 +32,7 @@ const Newsletter: CollectionConfig = {
name: 'email', name: 'email',
type: 'text', type: 'text',
required: true, required: true,
} },
], ],
} }

View File

@@ -3,8 +3,7 @@ import generateEmailHTML from './generateEmailHTML'
const generateForgotPasswordEmail = async ({ token }): Promise<string> => const generateForgotPasswordEmail = async ({ token }): Promise<string> =>
generateEmailHTML({ generateEmailHTML({
headline: 'Locked out?', headline: 'Locked out?',
content: content: '<p>Let&apos;s get you back in.</p>',
'<p>Let&apos;s get you back in.</p>',
cta: { cta: {
buttonLabel: 'Reset your password', buttonLabel: 'Reset your password',
url: `${process.env.PAYLOAD_PUBLIC_SERVER_URL}/reset-password?token=${token}`, url: `${process.env.PAYLOAD_PUBLIC_SERVER_URL}/reset-password?token=${token}`,

View File

@@ -1,317 +1,345 @@
<!doctype html> <!doctype html>
<html> <html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style type="text/css">
body,
html {
margin: 0;
padding: 0;
}
<head> body,
<meta name="viewport" content="width=device-width, initial-scale=1.0"> html,
<style type="text/css"> .bg {
body, height: 100%;
html { }
margin: 0;
padding: 0;
}
body, body,
html, h1,
.bg { h2,
height: 100%; h3,
} h4,
p,
em,
strong {
font-family: sans-serif;
}
body, body {
h1, font-size: 15px;
h2, color: #333333;
h3, }
h4,
p,
em,
strong {
font-family: sans-serif;
}
body { a {
font-size: 15px; color: #333333;
color: #333333; outline: 0;
} text-decoration: underline;
}
a { a img {
color: #333333; border: 0;
outline: 0; outline: 0;
text-decoration: underline; }
}
a img { img {
border: 0; max-width: 100%;
outline: 0; height: auto;
} vertical-align: top;
}
img { h1,
max-width: 100%; h2,
height: auto; h3,
vertical-align: top; h4,
} h5 {
font-weight: 900;
h1, line-height: 1.25;
h2, }
h3,
h4,
h5 {
font-weight: 900;
line-height: 1.25;
}
h1 {
font-size: 40px;
color: #333333;
margin: 0 0 25px 0;
}
h2 {
color: #333333;
margin: 0 0 25px 0;
font-size: 30px;
line-height: 30px;
}
h3 {
font-size: 25px;
color: #333333;
margin: 0 0 25px 0;
}
h4 {
font-size: 20px;
color: #333333;
margin: 0 0 15px 0;
line-height: 30px;
}
h5 {
color: #333333;
font-size: 17px;
font-weight: 900;
margin: 0 0 15px;
}
table {
border-collapse: collapse;
}
p,
td {
font-size: 14px;
line-height: 25px;
color: #333333;
}
p {
margin: 0 0 25px;
}
ul {
padding-left: 15px;
margin-left: 15px;
font-size: 14px;
line-height: 25px;
margin-bottom: 25px;
}
li {
font-size: 14px;
line-height: 25px;
color: #333333;
}
table.hr td {
font-size: 0;
line-height: 2px;
}
.white {
color: white;
}
/********************************
MAIN
********************************/
.main {
background: white;
}
/********************************
MAX WIDTHS
********************************/
.max-width {
max-width: 800px;
width: 94%;
margin: 0 3%;
}
/********************************
REUSABLES
********************************/
.padding {
padding: 60px;
}
.center {
text-align: center;
}
.no-border {
border: 0;
outline: none;
text-decoration: none;
}
.no-margin {
margin: 0;
}
.spacer {
line-height: 45px;
height: 45px;
}
/********************************
PANELS
********************************/
.panel {
width: 100%;
}
@media screen and (max-width : 800px) {
h1 { h1 {
font-size: 24px !important; font-size: 40px;
margin: 0 0 20px 0 !important; color: #333333;
margin: 0 0 25px 0;
} }
h2 { h2 {
font-size: 20px !important; color: #333333;
margin: 0 0 20px 0 !important; margin: 0 0 25px 0;
font-size: 30px;
line-height: 30px;
} }
h3 { h3 {
font-size: 20px !important; font-size: 25px;
margin: 0 0 20px 0 !important; color: #333333;
margin: 0 0 25px 0;
} }
h4 { h4 {
font-size: 18px !important; font-size: 20px;
margin: 0 0 15px 0 !important; color: #333333;
margin: 0 0 15px 0;
line-height: 30px;
} }
h5 { h5 {
font-size: 15px !important; color: #333333;
margin: 0 0 10px !important; font-size: 17px;
font-weight: 900;
margin: 0 0 15px;
} }
table {
border-collapse: collapse;
}
p,
td {
font-size: 14px;
line-height: 25px;
color: #333333;
}
p {
margin: 0 0 25px;
}
ul {
padding-left: 15px;
margin-left: 15px;
font-size: 14px;
line-height: 25px;
margin-bottom: 25px;
}
li {
font-size: 14px;
line-height: 25px;
color: #333333;
}
table.hr td {
font-size: 0;
line-height: 2px;
}
.white {
color: white;
}
/********************************
MAIN
********************************/
.main {
background: white;
}
/********************************
MAX WIDTHS
********************************/
.max-width { .max-width {
width: 90% !important; max-width: 800px;
margin: 0 5% !important; width: 94%;
margin: 0 3%;
} }
td.padding { /********************************
padding: 30px !important; REUSABLES
********************************/
.padding {
padding: 60px;
} }
td.padding-vert { .center {
padding-top: 20px !important; text-align: center;
padding-bottom: 20px !important;
} }
td.padding-horiz { .no-border {
padding-left: 20px !important; border: 0;
padding-right: 20px !important; outline: none;
text-decoration: none;
}
.no-margin {
margin: 0;
} }
.spacer { .spacer {
line-height: 20px !important; line-height: 45px;
height: 20px !important; height: 45px;
} }
}
</style>
</head>
<body> /********************************
<div style="background-color:#F3F3F3; height: 100%;"> PANELS
<table height="100%" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f3f3f3" ********************************/
style="background-color: #f3f3f3;">
<tr>
<td valign="top" align="left">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody>
<tr>
<td align="center" valign="top">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody>
<tr>
<td align="center">
<table class="max-width" cellpadding="0" cellspacing="0" border="0" width="100%"
style="width: 100%;">
<tbody>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td class="padding main">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody>
<tr>
<td>
<!-- LOGO -->
<a href="https://payloadcms.com/" target="_blank">
<img src="https://payloadcms.com/images/logo-dark.png" width="150"
height="auto" />
</a>
</td>
</tr>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td>
<!-- HEADLINE -->
<h1 style="margin: 0 0 30px;">{{headline}}</h1>
</td>
</tr>
<tr>
<td>
<!-- CONTENT -->
{{{content}}}
<!-- CTA --> .panel {
{{#if cta}} width: 100%;
<div> }
<a href="{{cta.url}}"
style="background-color:#222222;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:60px;text-align:center;text-decoration:none;width:200px;-webkit-text-size-adjust:none;"> @media screen and (max-width: 800px) {
{{cta.buttonLabel}} h1 {
font-size: 24px !important;
margin: 0 0 20px 0 !important;
}
h2 {
font-size: 20px !important;
margin: 0 0 20px 0 !important;
}
h3 {
font-size: 20px !important;
margin: 0 0 20px 0 !important;
}
h4 {
font-size: 18px !important;
margin: 0 0 15px 0 !important;
}
h5 {
font-size: 15px !important;
margin: 0 0 10px !important;
}
.max-width {
width: 90% !important;
margin: 0 5% !important;
}
td.padding {
padding: 30px !important;
}
td.padding-vert {
padding-top: 20px !important;
padding-bottom: 20px !important;
}
td.padding-horiz {
padding-left: 20px !important;
padding-right: 20px !important;
}
.spacer {
line-height: 20px !important;
height: 20px !important;
}
}
</style>
</head>
<body>
<div style="background-color: #f3f3f3; height: 100%">
<table
height="100%"
width="100%"
cellpadding="0"
cellspacing="0"
border="0"
bgcolor="#f3f3f3"
style="background-color: #f3f3f3"
>
<tr>
<td valign="top" align="left">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody>
<tr>
<td align="center" valign="top">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody>
<tr>
<td align="center">
<table
class="max-width"
cellpadding="0"
cellspacing="0"
border="0"
width="100%"
style="width: 100%"
>
<tbody>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td class="padding main">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody>
<tr>
<td>
<!-- LOGO -->
<a href="https://payloadcms.com/" target="_blank">
<img
src="https://payloadcms.com/images/logo-dark.png"
width="150"
height="auto"
/>
</a> </a>
</div> </td>
{{/if}} </tr>
</td> <tr>
</tr> <td class="spacer">&nbsp;</td>
</tbody> </tr>
</table> <tr>
</td> <td>
</tr> <!-- HEADLINE -->
</tbody> <h1 style="margin: 0 0 30px">{{headline}}</h1>
</table> </td>
</td> </tr>
</tr> <tr>
</tbody> <td>
</table> <!-- CONTENT -->
</td> {{{content}}}
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</div>
</body>
<!-- CTA -->
{{#if cta}}
<div>
<a
href="{{cta.url}}"
style="
background-color: #222222;
border-radius: 4px;
color: #ffffff;
display: inline-block;
font-family: sans-serif;
font-size: 13px;
font-weight: bold;
line-height: 60px;
text-align: center;
text-decoration: none;
width: 200px;
-webkit-text-size-adjust: none;
"
>
{{cta.buttonLabel}}
</a>
</div>
{{/if}}
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</div>
</body>
</html> </html>

View File

@@ -8,7 +8,6 @@ if (process.env.NODE_ENV === 'production') {
// Configure a custom transport here // Configure a custom transport here
}, },
} }
} else { } else {
email = { email = {
fromName: 'Ethereal Email', fromName: 'Ethereal Email',

View File

@@ -1 +1 @@
export default {}; export default {}

View File

@@ -1,4 +1,3 @@
import dotenv from 'dotenv' import dotenv from 'dotenv'
import path from 'path' import path from 'path'
import { buildConfig } from 'payload/config' import { buildConfig } from 'payload/config'
@@ -14,7 +13,7 @@ const mockModulePath = path.resolve(__dirname, './emptyModule.js')
export default buildConfig({ export default buildConfig({
admin: { admin: {
webpack: config => ({ webpack: (config) => ({
...config, ...config,
resolve: { resolve: {
...config?.resolve, ...config?.resolve,
@@ -36,10 +35,7 @@ export default buildConfig({
}, },
}), }),
}, },
collections: [ collections: [Newsletter, Users],
Newsletter,
Users,
],
typescript: { typescript: {
outputFile: path.resolve(__dirname, 'payload-types.ts'), outputFile: path.resolve(__dirname, 'payload-types.ts'),
}, },

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.checkbox { .checkbox {
position: relative; position: relative;

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.select { .select {
position: relative; position: relative;

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.wrap { .wrap {
position: relative; position: relative;

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.wrap { .wrap {
position: relative; position: relative;

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.select { .select {
position: relative; position: relative;

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.select { .select {
position: relative; position: relative;

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.wrap { .wrap {
position: relative; position: relative;

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.wrap { .wrap {
position: relative; position: relative;

View File

@@ -41,7 +41,7 @@
margin-right: calc(var(--base) * -0.5); margin-right: calc(var(--base) * -0.5);
width: calc(100% + #{var(--base)}); width: calc(100% + #{var(--base)});
>* { > * {
width: 100%; width: 100%;
} }
} }

View File

@@ -1,4 +1,4 @@
@use "../../../css/common.scss" as *; @use '../../../css/common.scss' as *;
@mixin formInput() { @mixin formInput() {
all: unset; all: unset;

View File

@@ -35,7 +35,8 @@
background-color: var(--color-black); background-color: var(--color-black);
color: var(--color-white); color: var(--color-white);
&:hover, &:focus { &:hover,
&:focus {
background-color: var(--color-white); background-color: var(--color-white);
color: var(--color-black); color: var(--color-black);
box-shadow: inset 0 0 0 1px var(--color-black); box-shadow: inset 0 0 0 1px var(--color-black);
@@ -46,7 +47,8 @@
background-color: var(--color-white); background-color: var(--color-white);
box-shadow: inset 0 0 0 1px var(--color-black); box-shadow: inset 0 0 0 1px var(--color-black);
&:hover, &:focus { &:hover,
&:focus {
background-color: var(--color-black); background-color: var(--color-black);
color: var(--color-white); color: var(--color-white);
box-shadow: inset 0 0 0 1px var(--color-black); box-shadow: inset 0 0 0 1px var(--color-black);

View File

@@ -26,7 +26,7 @@
cursor: pointer; cursor: pointer;
display: none; display: none;
&[aria-expanded="true"] { &[aria-expanded='true'] {
transform: rotate(-25deg); transform: rotate(-25deg);
} }

View File

@@ -3,10 +3,10 @@
@use './type.scss' as *; @use './type.scss' as *;
:root { :root {
--breakpoint-xs-width : #{$breakpoint-xs-width}; --breakpoint-xs-width: #{$breakpoint-xs-width};
--breakpoint-s-width : #{$breakpoint-s-width}; --breakpoint-s-width: #{$breakpoint-s-width};
--breakpoint-m-width : #{$breakpoint-m-width}; --breakpoint-m-width: #{$breakpoint-m-width};
--breakpoint-l-width : #{$breakpoint-l-width}; --breakpoint-l-width: #{$breakpoint-l-width};
--scrollbar-width: 17px; --scrollbar-width: 17px;
--base: 24px; --base: 24px;
@@ -100,7 +100,7 @@ p {
margin: var(--base) 0; margin: var(--base) 0;
@include mid-break { @include mid-break {
margin: calc(var(--base) * .75) 0; margin: calc(var(--base) * 0.75) 0;
} }
} }
@@ -114,12 +114,12 @@ a {
color: currentColor; color: currentColor;
&:focus { &:focus {
opacity: .8; opacity: 0.8;
outline: none; outline: none;
} }
&:active { &:active {
opacity: .7; opacity: 0.7;
outline: none; outline: none;
} }
} }

View File

@@ -1,10 +1,10 @@
:root { :root {
--color-red: rgb(255,0,0); --color-red: rgb(255, 0, 0);
--color-green: rgb(178, 255, 214); --color-green: rgb(178, 255, 214);
--color-white: rgb(255, 255, 255); --color-white: rgb(255, 255, 255);
--color-dark-gray: rgb(51,52,52); --color-dark-gray: rgb(51, 52, 52);
--color-mid-gray: rgb(196,196,196); --color-mid-gray: rgb(196, 196, 196);
--color-gray: rgb(212,212,212); --color-gray: rgb(212, 212, 212);
--color-light-gray: rgb(244,244,244); --color-light-gray: rgb(244, 244, 244);
--color-black: rgb(0, 0, 0); --color-black: rgb(0, 0, 0);
} }

View File

@@ -140,7 +140,6 @@
@include mid-break { @include mid-break {
font-size: 22px; font-size: 22px;
line-height: 30px; line-height: 30px;
} }
@include small-break { @include small-break {

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.checkbox { .checkbox {
position: relative; position: relative;

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.select { .select {
position: relative; position: relative;

View File

@@ -33,8 +33,8 @@ export const Country: React.FC<
<ReactSelect <ReactSelect
instanceId={name} instanceId={name}
options={countryOptions} options={countryOptions}
value={countryOptions.find(c => c.value === value)} value={countryOptions.find((c) => c.value === value)}
onChange={val => onChange(val.value)} onChange={(val) => onChange(val.value)}
className={classes.reactSelect} className={classes.reactSelect}
classNamePrefix="rs" classNamePrefix="rs"
inputId={name} inputId={name}

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.wrap { .wrap {
position: relative; position: relative;

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.wrap { .wrap {
position: relative; position: relative;

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.select { .select {
position: relative; position: relative;

View File

@@ -32,8 +32,8 @@ export const Select: React.FC<
<ReactSelect <ReactSelect
instanceId={name} instanceId={name}
options={options} options={options}
value={options.find(s => s.value === value)} value={options.find((s) => s.value === value)}
onChange={val => onChange(val.value)} onChange={(val) => onChange(val.value)}
className={classes.reactSelect} className={classes.reactSelect}
classNamePrefix="rs" classNamePrefix="rs"
inputId={name} inputId={name}

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.select { .select {
position: relative; position: relative;

View File

@@ -33,8 +33,8 @@ export const State: React.FC<
<ReactSelect <ReactSelect
instanceId={name} instanceId={name}
options={stateOptions} options={stateOptions}
value={stateOptions.find(t => t.value === value)} value={stateOptions.find((t) => t.value === value)}
onChange={val => onChange(val.value)} onChange={(val) => onChange(val.value)}
className={classes.reactSelect} className={classes.reactSelect}
classNamePrefix="rs" classNamePrefix="rs"
id={name} id={name}

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.wrap { .wrap {
position: relative; position: relative;

View File

@@ -1,4 +1,4 @@
@use "../shared.scss"; @use '../shared.scss';
.wrap { .wrap {
position: relative; position: relative;

Some files were not shown because too many files have changed in this diff Show More