style: format
This commit is contained in:
parent
0443604d04
commit
2f1d4fec8b
8 changed files with 43 additions and 48 deletions
|
@ -9,8 +9,8 @@
|
|||
"lint": "next lint",
|
||||
"format": "prettier --write ."
|
||||
},
|
||||
"engines" : {
|
||||
"node" : ">=20.0.0"
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/react-query": "^5.20.2",
|
||||
|
|
|
@ -13,9 +13,7 @@ export function generateStaticParams() {
|
|||
return affiliationsList.map((shortName) => ({ shortName }))
|
||||
}
|
||||
|
||||
const Description = ({
|
||||
description
|
||||
}: Readonly<{ description: string }>) => {
|
||||
const Description = ({ description }: Readonly<{ description: string }>) => {
|
||||
return (
|
||||
<>
|
||||
{description.split('[linebreak]').map((d, i) => (
|
||||
|
|
|
@ -11,9 +11,7 @@ import Image from 'next/image'
|
|||
|
||||
const zillaSlab = Zilla_Slab({ subsets: ['latin'], weight: ['500'] })
|
||||
|
||||
const MainAuthorPosition = ({
|
||||
author
|
||||
}: { author: Author }) => {
|
||||
const MainAuthorPosition = ({ author }: { author: Author }) => {
|
||||
const { name, affiliation, website } = author
|
||||
|
||||
const mainAffiliationShort = affiliation[0].split('@')[1]
|
||||
|
@ -55,17 +53,13 @@ const MainAuthorPosition = ({
|
|||
)
|
||||
}
|
||||
|
||||
const OtherAuthorPositions = ({
|
||||
author
|
||||
}: { author: Author }) => {
|
||||
const OtherAuthorPositions = ({ author }: { author: Author }) => {
|
||||
const { affiliation } = author
|
||||
|
||||
if (affiliation.length === 1) return
|
||||
return (
|
||||
<>
|
||||
<h1 className='text-3xl md:mt-6 mt-4 mb-2 font-serif'>
|
||||
Other Positions
|
||||
</h1>
|
||||
<h1 className='text-3xl md:mt-6 mt-4 mb-2 font-serif'>Other Positions</h1>
|
||||
{affiliation.slice(1).map((a: string, i: number) => {
|
||||
const position = a.split('@')[0]
|
||||
const affiliation = affiliations[a.split('@')[1]].name
|
||||
|
@ -84,9 +78,7 @@ const OtherAuthorPositions = ({
|
|||
)
|
||||
}
|
||||
|
||||
const FormerAuthorPositions = ({
|
||||
author
|
||||
}: { author: Author }) => {
|
||||
const FormerAuthorPositions = ({ author }: { author: Author }) => {
|
||||
const { formerAffiliations } = author
|
||||
|
||||
if (!formerAffiliations) return null
|
||||
|
@ -114,9 +106,7 @@ const FormerAuthorPositions = ({
|
|||
)
|
||||
}
|
||||
|
||||
const AuthorBio = ({
|
||||
author
|
||||
}: { author: Author }) => {
|
||||
const AuthorBio = ({ author }: { author: Author }) => {
|
||||
const { bio } = author
|
||||
if (!bio) return null
|
||||
|
||||
|
|
|
@ -7,9 +7,5 @@
|
|||
export default function Container({
|
||||
children,
|
||||
}: Readonly<{ children: React.ReactNode }>) {
|
||||
return (
|
||||
<div className={`pb-10 px-5 max-w-[1200px] mx-auto`}>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
return <div className={`pb-10 px-5 max-w-[1200px] mx-auto`}>{children}</div>
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ const VersionChooser = ({
|
|||
)}
|
||||
</select>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
export default VersionChooser
|
||||
|
|
|
@ -9,7 +9,7 @@ import MobileMenu from './components/MobileMenu'
|
|||
import { ToastContainer } from 'react-toastify'
|
||||
import 'react-toastify/dist/ReactToastify.css'
|
||||
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,
|
||||
which are pre-provided by Next.js in the 'next/font/google' module), you need to
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
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 RandomDocs from './components/RandomDocs'
|
||||
import RecentDocuments from './components/RecentDocuments'
|
||||
|
@ -42,24 +48,26 @@ interface AuthorDisplayProps {
|
|||
const AuthorDisplay = ({ authors, affiliations }: AuthorDisplayProps) => {
|
||||
return (
|
||||
<ol className='list-decimal pl-4 space-y-2'>
|
||||
{sortAuthorsByDocumentsPublished(authors).slice(0, 10).map(({ id, author }) => {
|
||||
let data = author
|
||||
let affiliationSlug = data.affiliation[0].split('@')[1]
|
||||
let affiliation = affiliations[affiliationSlug]
|
||||
return (
|
||||
<li key={id}>
|
||||
<Link href={`/author/${id}`}>
|
||||
{data.name.first}
|
||||
{data.name.nickname ? ` "${data.name.nickname}" ` : ' '}
|
||||
{data.name.last}
|
||||
</Link>{' '}
|
||||
of{' '}
|
||||
<Link href={`/affiliation/${affiliationSlug}`}>
|
||||
{affiliation.short}
|
||||
</Link>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
{sortAuthorsByDocumentsPublished(authors)
|
||||
.slice(0, 10)
|
||||
.map(({ id, author }) => {
|
||||
let data = author
|
||||
let affiliationSlug = data.affiliation[0].split('@')[1]
|
||||
let affiliation = affiliations[affiliationSlug]
|
||||
return (
|
||||
<li key={id}>
|
||||
<Link href={`/author/${id}`}>
|
||||
{data.name.first}
|
||||
{data.name.nickname ? ` "${data.name.nickname}" ` : ' '}
|
||||
{data.name.last}
|
||||
</Link>{' '}
|
||||
of{' '}
|
||||
<Link href={`/affiliation/${affiliationSlug}`}>
|
||||
{affiliation.short}
|
||||
</Link>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ol>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -8,14 +8,17 @@ type ProvidersProps = {
|
|||
}
|
||||
|
||||
export default function Providers({ children }: Readonly<ProvidersProps>) {
|
||||
const queryClient = useMemo(() =>
|
||||
const queryClient = useMemo(
|
||||
() =>
|
||||
new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
staleTime: 60 * 1000,
|
||||
},
|
||||
},
|
||||
}), [])
|
||||
}),
|
||||
[]
|
||||
)
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue