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 c1df291 commit 98dff3f
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/components/page/researchDetail/ResearchDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,28 @@ export const ResearchDetail: FC<PaperModel> = ({
}, [publication.firstPage, publication.lastPage]);

const quotation = useMemo(() => {
const authorsString = authors.map((author) => {
if (publication.language === "english") {
return `${author.givenName.en} ${author.familyName.en}`;
} else {
return `${author.familyName.ja}${author.givenName.ja}`;
}
}).join(", ");

const year = new Date(publishDateStr).getFullYear();

const parts = [
`${authorsString}.`,
`${title}.`,
journalTitle ? `${journalTitle},` : null,
publication.volume ? `Vol.${publication.volume},` : null,
publication.issue ? `No.${publication.issue},` : null,
pages ? `pp.${pages},` : null,
`${year}.`,
].filter(Boolean);

return parts.join(" ");
}, [authors, title, journalTitle, publication.volume, publication.issue, pages, publishDateStr, publication.language]);
const authorsString = authors.map((author) => {
if (publication.language === "english") {
return `${author.givenName.en} ${author.familyName.en}`;
} else {
return `${author.familyName.ja}${author.givenName.ja}`;
}
}).join(", ");

const year = new Date(publishDateStr).getFullYear();

const parts = [
`${authorsString}.`,
`${title}.`,
journalTitle ? `${journalTitle},` : null,
publication.volume ? `Vol.${publication.volume},` : null,
publication.issue ? `No.${publication.issue},` : null,
pages ? `pp.${pages},` : null,
`${year}.`,
].filter(Boolean);

return parts.join(" ");
}, [authors, title, journalTitle, publication.volume, publication.issue, pages, publishDateStr, publication.language]);

return (
<div>
Expand Down

0 comments on commit 98dff3f

Please sign in to comment.