From 6426ec96d7bcf0bbaf62c1e15b64acdb13a4dc2e Mon Sep 17 00:00:00 2001 From: Kata Martin Date: Wed, 30 Oct 2024 16:11:10 -0400 Subject: [PATCH 1/3] Update intro text --- articles/ab1305-initial-disclosures/database.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/ab1305-initial-disclosures/database.md b/articles/ab1305-initial-disclosures/database.md index e684e493..14d6d0c6 100644 --- a/articles/ab1305-initial-disclosures/database.md +++ b/articles/ab1305-initial-disclosures/database.md @@ -13,7 +13,7 @@ components: # AB1305 Database -California’s AB1305 offset disclosure law will go into full effect in January 2025, but a handful of companies have already posted AB1305-compliant disclosures online. We tracked down 25 of these early disclosures and transcribed their data, which you can [download](https://carbonplan-ab1305-initial-disclosures.s3.us-west-2.amazonaws.com/ab1305-raw-data.csv) or explore below. +California’s AB1305 offset disclosure law will go into full effect in January 2025, but a handful of companies have already posted AB1305-compliant disclosures online. We tracked down 25 of these early disclosures and transcribed their data, which you can [download](https://carbonplan-ab1305-initial-disclosures.s3.us-west-2.amazonaws.com/ab1305-raw-data.csv) or explore below. Where possible, we provide links to additional offset project information either on [OffsetsDB](https://carbonplan.org/research/offsets-db) (colored project badges) or alternative websites. From 07863aec2d99ac0e61bec2f3202439887d4381e9 Mon Sep 17 00:00:00 2001 From: Kata Martin Date: Wed, 30 Oct 2024 16:18:02 -0400 Subject: [PATCH 2/3] Handle empty link objects --- .../components/database-table.js | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) 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 && (