-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added "New datasets" page + conditionally rendering of external link …
…icon in banners via configuration (#158) * Added new datasets page, components, and config + banner config * Added config change, new prop isExternalLink to banner, can conditionally render external link icon via config now * removed NewDatasetsPageContent.tsx and added new studies to config. Will need to rename ResourcePageContent.tsx to something more generic * refactored ResourcePageContent to CardedPageContent since both the resource and recently added datasets page use the same HTML structure * Only external links in banner will open in a new tab, internal links will open in the same tab now * fixing es lint build error removing an introduced white space * still fighting eslint due to indentation issue * changing verbiage to newly available datasets * changing from _target to _blank
- Loading branch information
1 parent
fd03f96
commit 9b80f43
Showing
6 changed files
with
124 additions
and
10 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,64 @@ | ||
{ | ||
"title": "Newly Available Datasets", | ||
"introduction": [ | ||
{ | ||
"type": "text", | ||
"content": "The " | ||
}, | ||
{ | ||
"type": "boldText", | ||
"content": "HEAL Data Platform " | ||
}, | ||
{ | ||
"type": "text", | ||
"content": "connects to HEAL-compliant repositories where data are stored, providing a single point of access to the diverse array of studies and data funded by the NIH HEAL Initiative®. " | ||
}, | ||
{ | ||
"type": "text", | ||
"content": "Here are some of the latest studies to share their data so that they are accessible on the HEAL Data Platform." | ||
} | ||
], | ||
"sections": [ | ||
{ | ||
"title" : "Jan - Mar 2024", | ||
"cards": [ | ||
{ | ||
"title": "Regulation of neuropathic pain by exercise: effects on nociceptor plasticity and inflammation", | ||
"content": "MEGAN R DETLOFF, DREXEL UNIVERSITY", | ||
"linkText": "View Study", | ||
"link": "https://healdata.org/portal/discovery/HDP01265" | ||
}, | ||
{ | ||
"title": "Multi-organ human-on-a-chip system to address overdose and acute and chronic efficacy and off-target toxicity", | ||
"content": "James J Hickman, MICHAEL L SHULER, UNIVERSITY OF CENTRAL FLORIDA", | ||
"linkText": "View Study", | ||
"link": "https://healdata.org/portal/discovery/HDP00054" | ||
}, | ||
{ | ||
"title": "Modeling temporomandibular joint disorders pain: role of transient receptor potential ion channels", | ||
"content": "Yong Chen, DUKE UNIVERSITY", | ||
"linkText": "View Study", | ||
"link": "https://healdata.org/portal/discovery/HDP00538" | ||
}, | ||
{ | ||
"title": "Collaborating to Heal Addiction and Mental Health in Primary care (CHAMP)", | ||
"content": "JOHN C. FORTNEY, Anna Ratzliff, ANDREW J SAXON, UNIVERSITY OF WASHINGTON", | ||
"linkText": "View Study", | ||
"link": "https://healdata.org/portal/discovery/HDP00201" | ||
}, | ||
{ | ||
"title": "Sleep, opiate withdrawal and the N/OFQ - NOP system", | ||
"content": "Michael R Bruchas, Thomas S Kilduff, SRI INTERNATIONAL", | ||
"linkText": "View Study", | ||
"link": "https://healdata.org/portal/discovery/HDP00397" | ||
}, | ||
{ | ||
"title": "Improving health and employment outcomes through workplace opioid policies", | ||
"content": "Ann Marie Dale, WASHINGTON UNIVERSITY", | ||
"linkText": "View Study", | ||
"link": "https://healdata.org/portal/discovery/HDP00331" | ||
} | ||
] | ||
} | ||
] | ||
} |
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
38 changes: 38 additions & 0 deletions
38
packages/portal/src/pages/landing/newly-available-datasets.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,38 @@ | ||
import {GetStaticProps} from 'next'; | ||
import ContentSource from '../../lib/content'; | ||
|
||
import NavPageLayout, { NavPageLayoutProps } from '../../components/Navigation/NavPageLayout'; | ||
import CardedPageContent, {CardedPageConfig} from '../../components/Contents/CardedPageContent'; | ||
import { getNavPageLayoutPropsFromConfig } from '../../common/staticProps'; | ||
|
||
interface ResourcePageProps extends NavPageLayoutProps { | ||
newDatasetsPageConfig: CardedPageConfig | ||
} | ||
|
||
const ResourcePage = ({headerProps, footerProps, newDatasetsPageConfig}: ResourcePageProps) => { | ||
|
||
return ( | ||
<NavPageLayout {...{headerProps, footerProps}}> | ||
<div className='flex flex-row justify-items-center'> | ||
<div className='sm:prose-base lg:prose-lg xl:prose-xl 2xl:prose-xl mx-20'> | ||
<CardedPageContent {...newDatasetsPageConfig}/> | ||
</div> | ||
</div> | ||
</NavPageLayout> | ||
); | ||
}; | ||
|
||
|
||
// should move this thing into _app.tsx and make a dedicated layout component after https://github.com/vercel/next.js/discussions/10949 is addressed | ||
export const getStaticProps: GetStaticProps<ResourcePageProps> = async ( ) => { | ||
const navPageLayoutProps = await getNavPageLayoutPropsFromConfig(); | ||
const newDatasetsPageConfig = await ContentSource.get('config/newDatasets.json') as unknown as CardedPageConfig; | ||
return { | ||
props: { | ||
...navPageLayoutProps, | ||
newDatasetsPageConfig | ||
} | ||
}; | ||
}; | ||
|
||
export default ResourcePage; |
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