-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
128 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { Link, Text } from 'preshape'; | ||
import React from 'react'; | ||
import { Publication } from '../../types'; | ||
import { fromISO } from '../../utils/date'; | ||
|
||
interface Props extends Publication {} | ||
|
||
const PublicationComponent = (props: Props) => { | ||
const { authors, date, description, journal, title, href } = props; | ||
|
||
return ( | ||
<Link | ||
backgroundColor="background-shade-2" | ||
borderRadius="x3" | ||
display="block" | ||
href={href} | ||
margin="x3" | ||
padding="x6" | ||
> | ||
<Text flex="horizontal" gap="x10"> | ||
<Text basis="0" grow margin="x1" strong> | ||
{title} | ||
</Text> | ||
|
||
<Text size="x2" strong> | ||
{journal} | ||
</Text> | ||
</Text> | ||
|
||
<Text margin="x1">{description}</Text> | ||
|
||
<Text margin="x2" size="x3" strong> | ||
by{' '} | ||
{authors.map((author, index) => ( | ||
<Text inline key={author}> | ||
{author}{' '} | ||
<Text inline superscript> | ||
[{index + 1}] | ||
</Text> | ||
{index === authors.length - 1 ? ' ' : ', '} | ||
</Text> | ||
))} | ||
</Text> | ||
|
||
<Text margin="x2" size="x3" strong> | ||
{fromISO(date)} | ||
</Text> | ||
</Link> | ||
); | ||
}; | ||
|
||
export default PublicationComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters