-
-
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.
add support for displaying external accessions
- Loading branch information
1 parent
1071b5b
commit 39b8581
Showing
3 changed files
with
46 additions
and
0 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,25 @@ | ||
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