-
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
9e55045
commit f74c9f7
Showing
9 changed files
with
497 additions
and
432 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,49 @@ | ||
import React, {useEffect} from "react"; | ||
import React, { useEffect } from "react"; | ||
import _ from "lodash"; | ||
import linkify from 'linkify-html'; | ||
import {Row, Col} from "antd" | ||
import linkify from "linkify-html"; | ||
import { Row, Col } from "antd"; | ||
|
||
const ReferencesTable = ({ data, referenceIndexMap, style, primarySourceDatasetKey , pathToDataset}) => { | ||
useEffect(()=>{},[referenceIndexMap]) | ||
const ReferencesTable = ({ | ||
data, | ||
referenceIndexMap, | ||
style, | ||
primarySourceDatasetKey, | ||
pathToDataset, | ||
}) => { | ||
useEffect(() => {}, [referenceIndexMap]); | ||
return ( | ||
<div style={style} className="col-reference-link-container"> | ||
{_.values(data) | ||
|
||
.map(s => ( | ||
<> | ||
<Row key={s.id}> | ||
<Col style={{paddingRight: "5px"}}> | ||
{_.get(referenceIndexMap, s.id) && <span> | ||
{`[${_.get(referenceIndexMap, s.id)}]`} | ||
</span>} | ||
.map((s) => ( | ||
<> | ||
<Row key={s.id}> | ||
<Col style={{ paddingRight: "5px" }}> | ||
{_.get(referenceIndexMap, s.id) && ( | ||
<span>{`[${_.get(referenceIndexMap, s.id)}]`}</span> | ||
)} | ||
</Col> | ||
<Col span={20}> | ||
<span | ||
id={`col-refererence-${s.id}`} | ||
dangerouslySetInnerHTML={{ __html: linkify(s.citation) }} | ||
></span> | ||
</Col> | ||
</Row> | ||
|
||
{s?.sourceDataset?.key !== primarySourceDatasetKey && ( | ||
<Row> | ||
<Col style={{ paddingLeft: "22px" }}> | ||
Source:{" "} | ||
<a href={`${pathToDataset}${s?.sourceDataset?.key}`}> | ||
{s?.sourceDataset?.title} | ||
</a> | ||
</Col> | ||
<Col span={20} > | ||
<span id={`col-refererence-${s.id}`} | ||
dangerouslySetInnerHTML={{ __html: linkify(s.citation)}} | ||
></span> | ||
</Col> | ||
</Row> | ||
|
||
{s?.sourceDataset?.key !== primarySourceDatasetKey && <Row><Col style={{paddingLeft: "22px"}}>Source: <a href={`${pathToDataset}${s?.sourceDataset?.key}`}>{s?.sourceDataset?.title}</a></Col></Row>} | ||
</> | ||
))} | ||
)} | ||
</> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ReferencesTable; | ||
|
||
|
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
Oops, something went wrong.