-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
4f014b0
commit 96db922
Showing
3 changed files
with
45 additions
and
26 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,11 @@ | ||
@import '../lib/_variables.sass' | ||
|
||
.article | ||
display: flex | ||
.article_border | ||
.article_content | ||
display: flex | ||
flex-direction: column | ||
.article_title | ||
font-weight: $bold | ||
|
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 |
---|---|---|
@@ -1,28 +1,36 @@ | ||
import React from 'react'; | ||
import {useState, useEffect} from 'react'; | ||
import { mypublications } from '../constants/publications'; | ||
import React from "react"; | ||
import { useState, useEffect } from "react"; | ||
import { mypublications } from "../constants/publications"; | ||
|
||
export default function RecentPublications (props) { | ||
const [papers, setPapers] = useState(mypublications); | ||
export default function RecentPublications(props) { | ||
const [papers, setPapers] = useState(mypublications); | ||
|
||
useEffect(() => { | ||
window.scrollTo(0,0); | ||
}, []); | ||
useEffect(() => { | ||
window.scrollTo(0, 0); | ||
}, []); | ||
|
||
return <div className="_pubications _recent_publications"> | ||
{ papers.filter(paper => { | ||
return ( | ||
paper.type === "article-journal" | ||
); | ||
}) | ||
.filter((i, index) => (index < 3)) | ||
.map(({doi, content}) => { | ||
return ( | ||
<a key={doi} href={doi} target="_blank" rel="noopener noreferrer"> | ||
<p style={{ color: "black" }}dangerouslySetInnerHTML={{__html: content}}></p> | ||
</a> | ||
); | ||
})} | ||
</div> | ||
|
||
} | ||
return ( | ||
<div className="_pubications _recent_publications"> | ||
{papers | ||
.filter((paper) => { | ||
return paper.type === "article-journal"; | ||
}) | ||
.filter((i, index) => index < 3) | ||
.map(({ doi,title,author,date, content }) => { | ||
return ( | ||
<a key={doi} href={doi} target="_blank" rel="noopener noreferrer"> | ||
<div className="article"> | ||
<div className="article_border"></div> | ||
<div className="article_content"> | ||
<div className="article_top"><span>{date}</span></div> | ||
<h5 className="article_title">{title}</h5> | ||
<div className="article_author">{author}</div> | ||
<div className="article_doi">{doi}</div> | ||
</div> | ||
</div> | ||
</a> | ||
); | ||
})} | ||
</div> | ||
); | ||
} |