diff --git a/articles/ab1305-initial-disclosures/components/data.json b/articles/ab1305-initial-disclosures/components/data.json index 1025889c..fef164a9 100644 --- a/articles/ab1305-initial-disclosures/components/data.json +++ b/articles/ab1305-initial-disclosures/components/data.json @@ -415,20 +415,14 @@ "project_id": 193828, "name": "BioLite Improved Stove Programme", "protocol": "gold standard ver", - "link": { - "link_type": "project", - "url": "https://carbonplan.org/research/offsets-db/projects/193828" - }, + "link": {}, "category": "other" }, { "project_id": 193827, "name": "Vida Mejor Improved Cookstoves", "protocol": "gold standard ver", - "link": { - "link_type": "project", - "url": "https://carbonplan.org/research/offsets-db/projects/193827" - }, + "link": {}, "category": "other" }, { @@ -1060,10 +1054,7 @@ "project_id": null, "name": "Running Tide", "protocol": "running tide framework protocol 2023", - "link": { - "link_type": "project", - "url": "https://carbonplan.org/research/offsets-db/projects/nan" - }, + "link": {}, "category": "other" }, { @@ -1415,30 +1406,21 @@ "project_id": null, "name": "LaGeo, S. A. de C. V., Berline Geothermal Project, Phase Two", "protocol": null, - "link": { - "link_type": "project", - "url": "https://carbonplan.org/research/offsets-db/projects/nan" - }, + "link": {}, "category": "other" }, { "project_id": null, "name": "Piedra Larga Wind Farm", "protocol": null, - "link": { - "link_type": "project", - "url": "https://carbonplan.org/research/offsets-db/projects/nan" - }, + "link": {}, "category": "other" }, { "project_id": null, "name": "Switching of fuel from coal to palm oil mill biomass waste residues at Industrial de Oleaginosas Americanas S.A. (INOLASA)", "protocol": null, - "link": { - "link_type": "project", - "url": "https://carbonplan.org/research/offsets-db/projects/nan" - }, + "link": {}, "category": "other" }, { @@ -1455,30 +1437,21 @@ "project_id": null, "name": "Guacamaya Small Scale Hydropower Programme of Activities", "protocol": null, - "link": { - "link_type": "project", - "url": "https://carbonplan.org/research/offsets-db/projects/nan" - }, + "link": {}, "category": "other" }, { "project_id": null, "name": "Potero Hydropower Plant, Peru", "protocol": null, - "link": { - "link_type": "project", - "url": "https://carbonplan.org/research/offsets-db/projects/nan" - }, + "link": {}, "category": "other" }, { "project_id": null, "name": "Candelaria Hydroelectric Project", "protocol": null, - "link": { - "link_type": "project", - "url": "https://carbonplan.org/research/offsets-db/projects/nan" - }, + "link": {}, "category": "other" }, { diff --git a/articles/ab1305-initial-disclosures/components/database-table.js b/articles/ab1305-initial-disclosures/components/database-table.js index c91e4ecf..6828a1be 100644 --- a/articles/ab1305-initial-disclosures/components/database-table.js +++ b/articles/ab1305-initial-disclosures/components/database-table.js @@ -164,7 +164,9 @@ const ProjectRow = ({ company, category, }) => { + const standardLink = link.link_type === 'project' const customLink = link.link_type === 'provided' + const handleClick = useCallback( (e) => { if (e.metaKey || e.ctrlKey) { @@ -180,7 +182,7 @@ const ProjectRow = ({ as='tr' columns={6} tabIndex={0} - onClick={customLink ? undefined : handleClick} + onClick={standardLink ? handleClick : undefined} sx={{ ...styles.row, borderTopWidth: index === 0 ? 0 : '1px', @@ -199,17 +201,21 @@ const ProjectRow = ({ '& td a': { transition: '0.2s all', }, - cursor: customLink ? 'initial' : 'pointer', - '&:hover': customLink - ? {} - : { + cursor: standardLink ? 'pointer' : 'initial', + '&:hover': standardLink + ? { 'td a': { color: 'primary' }, '#suffix': { transform: 'rotate(45deg)', color: 'primary' }, - }, + } + : {}, }} > - - {project_id && link.url.includes('offsets-db') ? ( + + {project_id && link.url?.includes('offsets-db') ? ( {project_id} @@ -217,7 +223,11 @@ const ProjectRow = ({ <>{project_id ?? } )} - + {name ?? } {customLink && ( <> @@ -236,7 +246,7 @@ const ProjectRow = ({ start={5} width={2} sx={{ textTransform: 'uppercase' }} - href={customLink ? undefined : link.url} + href={standardLink ? link.url : undefined} > {protocol ?? } - {!customLink && ( + {standardLink && (