Skip to content

Commit

Permalink
combine all centers in one json
Browse files Browse the repository at this point in the history
  • Loading branch information
onursumer committed Dec 24, 2024
1 parent 01b81ec commit 5b0c21b
Show file tree
Hide file tree
Showing 27 changed files with 313 additions and 1,244 deletions.
4 changes: 2 additions & 2 deletions components/HtaCenterPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ const customHeaderContent: { [centerId: string]: JSX.Element } = {
<HeaderLogos
imgSources={[
'/phase1/DFCI-Logo-with-Flag.webp',
'/phase1/sage_bionetworks_logo.webp',
'/dcc/sage_bionetworks_logo.webp',
'/phase1/MSK_logo.webp',
'/phase1/isb_color_logo1.webp',
'/dcc/isb_color_logo1.webp',
]}
headerImgClassname={styles.headerImg20}
/>
Expand Down
310 changes: 289 additions & 21 deletions data/phase1_centers.json → data/research_network.json

Large diffs are not rendered by default.

12 changes: 3 additions & 9 deletions pages/center/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import HtaCenterPage, {
} from '../../components/HtaCenterPage';
import PageWrapper from '../../components/PageWrapper';
import PreReleaseBanner from '../../components/PreReleaseBanner';
import phase1Centers from '../../data/phase1_centers.json';
import phase2Centers from '../../data/phase2_centers.json';
import centers from '../../data/research_network.json';
import { HtaCenters } from '../../types';

const HTAPage = (props: HtaCenterPageProps) => {
Expand All @@ -21,10 +20,7 @@ const HTAPage = (props: HtaCenterPageProps) => {
};

export const getStaticPaths: GetStaticPaths = async () => {
const paths = [
...Object.keys(phase1Centers),
...Object.keys(phase2Centers),
].map((id) => ({
const paths = Object.keys(centers).map((id) => ({
params: { id },
}));

Expand All @@ -36,9 +32,7 @@ function getCenter(centers: HtaCenters, id?: string | string[]) {
}

export const getStaticProps: GetStaticProps = async ({ params }) => {
const hta =
getCenter(phase1Centers, params?.id) ||
getCenter(phase2Centers, params?.id);
const hta = getCenter(centers as HtaCenters, params?.id);

return { props: { hta, id: params?.id } };
};
Expand Down
15 changes: 12 additions & 3 deletions pages/research-network.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import _ from 'lodash';
import React from 'react';
import { Container, Row } from 'react-bootstrap';

import PageWrapper from '../components/PageWrapper';
import PreReleaseBanner from '../components/PreReleaseBanner';
import phase1Centers from '../data/phase1_centers.json';
import phase2Centers from '../data/phase2_centers.json';
import centers from '../data/research_network.json';
import styles from './centercard.module.css';
import { HtaCenters } from '../types';
import { HtaCenter, HtaCenterPhase, HtaCenters } from '../types';

const Cards = (props: { data: HtaCenters }) => {
return (
Expand Down Expand Up @@ -37,6 +37,15 @@ const Cards = (props: { data: HtaCenters }) => {
};

const ResearchNetwork = () => {
const phase1Centers = _.pickBy<HtaCenter>(
centers,
(center) => center.phase === HtaCenterPhase.Phase1
) as HtaCenters;
const phase2Centers = _.pickBy<HtaCenter>(
centers,
(center) => center.phase === HtaCenterPhase.Phase2
) as HtaCenters;

return (
<>
<PreReleaseBanner />
Expand Down
134 changes: 0 additions & 134 deletions pages/static/hta1.html

This file was deleted.

109 changes: 0 additions & 109 deletions pages/static/hta10.html

This file was deleted.

Loading

0 comments on commit 5b0c21b

Please sign in to comment.