Skip to content

Commit

Permalink
Update ResearchDetail.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
dccommon committed Apr 1, 2024
1 parent d1d4800 commit 045b73c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/page/researchDetail/ResearchDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ export const ResearchDetail: FC<PaperModel> = ({
return `${publication.firstPage} - ${publication.lastPage}`;
}, [publication.firstPage, publication.lastPage]);

const quotation = useMemo(() => {
const lastNames = authors.map((author) => author.familyName.ja).join(", ");
const year = new Date(publishDateStr).getFullYear();
return `${lastNames}. ${title}, ${journalTitle}, Vol.${publication.volume}, No.${publication.issue}, pp.${pages}, ${year}.`;
}, [authors, title, journalTitle, publication.volume, publication.issue, pages, publishDateStr]);

return (
<div>
{hero && <ResearchHero hero={hero} />}
Expand Down Expand Up @@ -117,7 +123,7 @@ export const ResearchDetail: FC<PaperModel> = ({
ref={citeTextareaRef}
className={"h-full w-full resize-none border-0 bg-transparent"}
readOnly
value={publication.quotation}
value={quotation}
/>
</div>
<div
Expand Down

0 comments on commit 045b73c

Please sign in to comment.