style: format

This commit is contained in:
quantum9Innovation 2024-02-17 22:56:26 +00:00 committed by github-actions[bot]
parent 0443604d04
commit 2f1d4fec8b
8 changed files with 43 additions and 48 deletions

View file

@ -9,8 +9,8 @@
"lint": "next lint", "lint": "next lint",
"format": "prettier --write ." "format": "prettier --write ."
}, },
"engines" : { "engines": {
"node" : ">=20.0.0" "node": ">=20.0.0"
}, },
"dependencies": { "dependencies": {
"@tanstack/react-query": "^5.20.2", "@tanstack/react-query": "^5.20.2",

View file

@ -13,9 +13,7 @@ export function generateStaticParams() {
return affiliationsList.map((shortName) => ({ shortName })) return affiliationsList.map((shortName) => ({ shortName }))
} }
const Description = ({ const Description = ({ description }: Readonly<{ description: string }>) => {
description
}: Readonly<{ description: string }>) => {
return ( return (
<> <>
{description.split('[linebreak]').map((d, i) => ( {description.split('[linebreak]').map((d, i) => (

View file

@ -11,9 +11,7 @@ import Image from 'next/image'
const zillaSlab = Zilla_Slab({ subsets: ['latin'], weight: ['500'] }) const zillaSlab = Zilla_Slab({ subsets: ['latin'], weight: ['500'] })
const MainAuthorPosition = ({ const MainAuthorPosition = ({ author }: { author: Author }) => {
author
}: { author: Author }) => {
const { name, affiliation, website } = author const { name, affiliation, website } = author
const mainAffiliationShort = affiliation[0].split('@')[1] const mainAffiliationShort = affiliation[0].split('@')[1]
@ -55,17 +53,13 @@ const MainAuthorPosition = ({
) )
} }
const OtherAuthorPositions = ({ const OtherAuthorPositions = ({ author }: { author: Author }) => {
author
}: { author: Author }) => {
const { affiliation } = author const { affiliation } = author
if (affiliation.length === 1) return if (affiliation.length === 1) return
return ( return (
<> <>
<h1 className='text-3xl md:mt-6 mt-4 mb-2 font-serif'> <h1 className='text-3xl md:mt-6 mt-4 mb-2 font-serif'>Other Positions</h1>
Other Positions
</h1>
{affiliation.slice(1).map((a: string, i: number) => { {affiliation.slice(1).map((a: string, i: number) => {
const position = a.split('@')[0] const position = a.split('@')[0]
const affiliation = affiliations[a.split('@')[1]].name const affiliation = affiliations[a.split('@')[1]].name
@ -84,9 +78,7 @@ const OtherAuthorPositions = ({
) )
} }
const FormerAuthorPositions = ({ const FormerAuthorPositions = ({ author }: { author: Author }) => {
author
}: { author: Author }) => {
const { formerAffiliations } = author const { formerAffiliations } = author
if (!formerAffiliations) return null if (!formerAffiliations) return null
@ -114,9 +106,7 @@ const FormerAuthorPositions = ({
) )
} }
const AuthorBio = ({ const AuthorBio = ({ author }: { author: Author }) => {
author
}: { author: Author }) => {
const { bio } = author const { bio } = author
if (!bio) return null if (!bio) return null

View file

@ -7,9 +7,5 @@
export default function Container({ export default function Container({
children, children,
}: Readonly<{ children: React.ReactNode }>) { }: Readonly<{ children: React.ReactNode }>) {
return ( return <div className={`pb-10 px-5 max-w-[1200px] mx-auto`}>{children}</div>
<div className={`pb-10 px-5 max-w-[1200px] mx-auto`}>
{children}
</div>
)
} }

View file

@ -112,7 +112,7 @@ const VersionChooser = ({
)} )}
</select> </select>
</div> </div>
); )
} }
export default VersionChooser export default VersionChooser

View file

@ -9,7 +9,7 @@ import MobileMenu from './components/MobileMenu'
import { ToastContainer } from 'react-toastify' import { ToastContainer } from 'react-toastify'
import 'react-toastify/dist/ReactToastify.css' import 'react-toastify/dist/ReactToastify.css'
import Providers from './providers' import Providers from './providers'
import Image from "next/legacy/image" import Image from 'next/legacy/image'
/* The default font is Inter. If you want to use Zilla Slab (or any other Google Font, /* The default font is Inter. If you want to use Zilla Slab (or any other Google Font,
which are pre-provided by Next.js in the 'next/font/google' module), you need to which are pre-provided by Next.js in the 'next/font/google' module), you need to

View file

@ -1,5 +1,11 @@
import Link from 'next/link' import Link from 'next/link'
import { documents, authors, affiliations, Author, Affiliation } from './db/data' import {
documents,
authors,
affiliations,
Author,
Affiliation,
} from './db/data'
import News from './components/News' import News from './components/News'
import RandomDocs from './components/RandomDocs' import RandomDocs from './components/RandomDocs'
import RecentDocuments from './components/RecentDocuments' import RecentDocuments from './components/RecentDocuments'
@ -42,7 +48,9 @@ interface AuthorDisplayProps {
const AuthorDisplay = ({ authors, affiliations }: AuthorDisplayProps) => { const AuthorDisplay = ({ authors, affiliations }: AuthorDisplayProps) => {
return ( return (
<ol className='list-decimal pl-4 space-y-2'> <ol className='list-decimal pl-4 space-y-2'>
{sortAuthorsByDocumentsPublished(authors).slice(0, 10).map(({ id, author }) => { {sortAuthorsByDocumentsPublished(authors)
.slice(0, 10)
.map(({ id, author }) => {
let data = author let data = author
let affiliationSlug = data.affiliation[0].split('@')[1] let affiliationSlug = data.affiliation[0].split('@')[1]
let affiliation = affiliations[affiliationSlug] let affiliation = affiliations[affiliationSlug]

View file

@ -8,14 +8,17 @@ type ProvidersProps = {
} }
export default function Providers({ children }: Readonly<ProvidersProps>) { export default function Providers({ children }: Readonly<ProvidersProps>) {
const queryClient = useMemo(() => const queryClient = useMemo(
() =>
new QueryClient({ new QueryClient({
defaultOptions: { defaultOptions: {
queries: { queries: {
staleTime: 60 * 1000, staleTime: 60 * 1000,
}, },
}, },
}), []) }),
[]
)
return ( return (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider> <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
) )