From 56df68b988e6c2514056167914e363177117da75 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 15 Feb 2024 13:51:12 -0800 Subject: [PATCH] refactor authordisplay, bibtex export toast --- src/app/author/[author]/AuthorDisplay.tsx | 6 ++++-- src/app/document/view/[slug]/DocumentViewer.tsx | 4 +--- src/app/document/view/[slug]/VersionChooser.tsx | 12 +++++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/app/author/[author]/AuthorDisplay.tsx b/src/app/author/[author]/AuthorDisplay.tsx index b0ce724..7fde590 100644 --- a/src/app/author/[author]/AuthorDisplay.tsx +++ b/src/app/author/[author]/AuthorDisplay.tsx @@ -1,5 +1,5 @@ import Link from 'next/link' -import { Fragment } from 'react' +import { Fragment, Suspense } from 'react' import { affiliations, nationalities, authors } from '../../db/data' import { Zilla_Slab } from 'next/font/google' import { notFound } from 'next/navigation' @@ -143,7 +143,9 @@ export default function AuthorDisplay({ return ( <> - + + +
) => { }) if (error) throw error let doc = data - // const doc = documents[slug] + const { manifest, abstract, citation } = doc - // if (!manifest) return notFound() const { title, authors, diff --git a/src/app/document/view/[slug]/VersionChooser.tsx b/src/app/document/view/[slug]/VersionChooser.tsx index e8f0bb6..3d35d6a 100644 --- a/src/app/document/view/[slug]/VersionChooser.tsx +++ b/src/app/document/view/[slug]/VersionChooser.tsx @@ -26,8 +26,7 @@ const VersionChooser = ({ const fileEnding = file === 'other' ? '' : `.${file}` const [selectedRevision, setSelectedRevision] = useState(latest) // Initialize the selected revision with the latest revision - const notifyCopied = () => - toast('BibTeX copied to clipboard!', { type: 'success' }) + const notifyCopied = () => toast('BibTeX copied to clipboard!') const handleClick = () => { const bibtex = `@article{ @@ -50,7 +49,7 @@ const VersionChooser = ({ } return ( -
+
-