-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: use correct indication attribute name (#408) * fix: add URL cites back (#409) * add release information component for footer * run prettier * cleanup: make about links consistent (#413) * make footer no longer sticky * fix: correct source versioning (#421) * fix: clean up GtoP import (#419) * fix: use latest GO address (#424) * feat: bump drugbank version (#422) * feat: alphabetize sources * refactor: alphabetize sources * style: running prettier to prettify the sort data function * fix: sort on pmid and source columns * feat: add sources to interaction page * feat: reduce precision of interaction score on interaction page to 2 decimal places --------- Co-authored-by: James Stevenson <james.stevenson@nationwidechildrens.org> Co-authored-by: Adam Coffman <acoffman@wustl.edu>
- Loading branch information
1 parent
b00b120
commit ace432d
Showing
26 changed files
with
439 additions
and
175 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
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
8 changes: 8 additions & 0 deletions
8
client/src/components/Shared/ReleaseInformation/ReleaseInformation.scss
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,8 @@ | ||
.release-info { | ||
font-size: 16px; | ||
|
||
a { | ||
color: white; | ||
text-decoration: underline; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
client/src/components/Shared/ReleaseInformation/ReleaseInformation.tsx
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,51 @@ | ||
import './ReleaseInformation.scss'; | ||
import React, { useState, useEffect } from 'react'; | ||
|
||
const ReleaseInformation: React.FC = () => { | ||
interface GithubRelease { | ||
html_url: string; | ||
name: string; | ||
published_at: string; | ||
} | ||
|
||
const [currentRelease, setCurrentRelease] = useState< | ||
GithubRelease | undefined | ||
>(undefined); | ||
|
||
const fetchRelease = async () => { | ||
const response = await fetch( | ||
'https://api.github.com/repos/dgidb/dgidb-v5/releases?per_page=1' | ||
); | ||
if (response.ok) { | ||
const body = await response.json(); | ||
setCurrentRelease(body[0]); | ||
} else { | ||
setCurrentRelease(undefined); | ||
} | ||
}; | ||
|
||
useEffect(() => { | ||
fetchRelease(); | ||
}, []); | ||
|
||
return ( | ||
<div> | ||
{currentRelease && ( | ||
<div className="release-info"> | ||
DGIdb {currentRelease.name} ( | ||
{new Date(currentRelease.published_at).toLocaleString().split(',')[0]} | ||
) • | ||
<a href={currentRelease.html_url} target="_blank"> | ||
Release Notes | ||
</a> | ||
• | ||
<a href="https://github.com/dgidb/dgidb-v5/releases/" target="_blank"> | ||
History | ||
</a> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ReleaseInformation; |
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
Oops, something went wrong.