-
-
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.
Merge pull request #477 from AlexsLemonade/davidsmejia/455-display-ex…
…ternal-accessions add support for displaying external accessions
- Loading branch information
Showing
5 changed files
with
54 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react' | ||
import { Box } from 'grommet' | ||
import { Link } from 'components/Link' | ||
|
||
export const ProjectExternalAccessionsDetail = ({ | ||
inline = false, | ||
externalAccessions = [] | ||
}) => { | ||
// Comma separated list. | ||
if (inline) { | ||
return externalAccessions.map(({ accession, url }, i) => ( | ||
<React.Fragment key={accession}> | ||
{i !== 0 && ', '} | ||
<Link label={accession} href={url} /> | ||
</React.Fragment> | ||
)) | ||
} | ||
|
||
// One external accession per line. | ||
return externalAccessions.map(({ accession, url }, i) => ( | ||
<Box key={accession} margin={{ top: i ? 'small' : 'none' }}> | ||
<Link label={accession} href={url} /> | ||
</Box> | ||
)) | ||
} | ||
|
||
export default ProjectExternalAccessionsDetail |
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
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