Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AB1305 links #309

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 9 additions & 36 deletions articles/ab1305-initial-disclosures/components/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down Expand Up @@ -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"
},
{
Expand Down Expand Up @@ -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"
},
{
Expand All @@ -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"
},
{
Expand Down
32 changes: 21 additions & 11 deletions articles/ab1305-initial-disclosures/components/database-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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',
Expand All @@ -199,25 +201,33 @@ 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' },
},
}
: {},
}}
>
<ProjectCell start={1} width={2} href={customLink ? undefined : link.url}>
{project_id && link.url.includes('offsets-db') ? (
<ProjectCell
start={1}
width={2}
href={standardLink ? link.url : undefined}
>
{project_id && link.url?.includes('offsets-db') ? (
<Badge sx={{ color: COLORS[category] ?? COLORS.other }}>
{project_id}
</Badge>
) : (
<>{project_id ?? <Empty />}</>
)}
</ProjectCell>
<ProjectCell start={3} width={2} href={customLink ? undefined : link.url}>
<ProjectCell
start={3}
width={2}
href={standardLink ? link.url : undefined}
>
{name ?? <Empty />}
{customLink && (
<>
Expand All @@ -236,7 +246,7 @@ const ProjectRow = ({
start={5}
width={2}
sx={{ textTransform: 'uppercase' }}
href={customLink ? undefined : link.url}
href={standardLink ? link.url : undefined}
>
<Flex
sx={{
Expand All @@ -246,7 +256,7 @@ const ProjectRow = ({
}}
>
{protocol ?? <Empty />}
{!customLink && (
{standardLink && (
<Button
suffix={<RotatingArrow />}
size='xs'
Expand Down
2 changes: 1 addition & 1 deletion articles/ab1305-initial-disclosures/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<DatabaseTable />

Expand Down
Loading