Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/calblueprint/ace-ny into 37…
Browse files Browse the repository at this point in the history
…-feat-parse-ores-data-from-html
  • Loading branch information
deenasun committed Nov 15, 2024
2 parents ed8c2c8 + 795b342 commit 6b0ddad
Show file tree
Hide file tree
Showing 35 changed files with 1,495 additions and 200 deletions.
5 changes: 4 additions & 1 deletion api/maps/AddMarkers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ export default function AddMarker({
) => {
setSelectedProjectId(prevId => (prevId === projectId ? null : projectId)); // close modal if same, open if different
map?.panTo(position); // change center of map to selected marker
if (selectedProjectId === projectId) {
document.title = 'ACE NY';
}
};

const closeModal = () => {
document.title = 'ACE NY';
setSelectedProjectId(null); // close modal
};

Expand All @@ -45,7 +49,6 @@ export default function AddMarker({
lng: project.longitude,
}}
projectName={project.project_name}
projectDev={project.developer}
technology={project.renewable_energy_technology}
projectId={project.id}
onMarkerClick={handleMarkerClick}
Expand Down
8 changes: 3 additions & 5 deletions api/maps/MarkerInfoWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Pin,
useAdvancedMarkerRef,
} from '@vis.gl/react-google-maps';
import { TagText1 } from '@/styles/texts';
import energyStorage from '../../assets/Custom-Markers/energy_storage.svg';
import geothermal from '../../assets/Custom-Markers/geothermal.svg';
import hydroelectric from '../../assets/Custom-Markers/hydroelectric.svg';
Expand All @@ -22,14 +23,13 @@ const technologyToPin: Record<string, string> = {
'Land-Based Wind': landbased_wind,
'Offshore Wind': offshore_wind,
'Pumped Storage': pumped_storage,
Solar: solarPower,
'Solar PV': solarPower,
};

export const MarkerInfoWindow = ({
position,
projectId,
projectName,
projectDev,
technology,
onMarkerClick,
clusterer,
Expand All @@ -38,7 +38,6 @@ export const MarkerInfoWindow = ({
position: { lat: number; lng: number };
projectId: number;
projectName: string;
projectDev: string;
technology: string;
onMarkerClick: (
projectId: number,
Expand Down Expand Up @@ -112,8 +111,7 @@ export const MarkerInfoWindow = ({
</AdvancedMarker>
{infoWindowShown && (
<InfoWindow anchor={marker} onClose={handleClose} disableAutoPan={true}>
<h2>{projectName}</h2>
<p>Developer: {projectDev}</p>
<TagText1>{projectName}</TagText1>
</InfoWindow>
)}
</>
Expand Down
8 changes: 5 additions & 3 deletions api/supabase/queries/query.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { Project } from '../../../types/schema';
import supabase from '../createClient';

export default async function queryProjects() {
export default async function queryProjects(): Promise<Project[]> {
const { data: projects, error } = await supabase
.from('Projects')
.select('*')
.eq('approved', true);

console.log('PROJECTS', projects, 'ERROR', error);
if (error) {
throw new Error(`Error fetching projects: ${error.message}`);
}

return { projects, error };
return projects;
}

export async function queryProjectbyId(id: number): Promise<Project> {
Expand Down
Binary file added app/icon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const sans = Inter({

// site metadata - what shows up on embeds
export const metadata: Metadata = {
title: 'Project Name',
title: 'ACE NY',
description: 'Description of project',
};

Expand Down
6 changes: 3 additions & 3 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { CSSProperties, useEffect, useState } from 'react';
import Map from '@/components/Map';
import MapViewScreen from '@/components/MapViewScreen';
import queryProjects from '../api/supabase/queries/query';
import { Project } from '../types/schema';

Expand All @@ -12,15 +12,15 @@ export default function Home() {
useEffect(() => {
queryProjects()
.then(data => {
setProjects(data.projects);
setProjects(data);
})
.catch(err => setError(err));
}, []);

return (
<main style={mainStyles}>
{error ? <div style={errorStyles}>{error}</div> : null}
{projects ? <Map projects={projects} /> : null}
{projects ? <MapViewScreen projects={projects} /> : null}
</main>
);
}
Expand Down
23 changes: 23 additions & 0 deletions app/testing/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use client';

import { CSSProperties } from 'react';
import ProjectItem from '@/components/ProjectItem';

export default function Home() {
return (
<main style={mainStyles}>
<ProjectItem project_id={20}></ProjectItem>
</main>
);
}

// CSS styles

const mainStyles: CSSProperties = {
width: '100%',
height: '100%',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
};
97 changes: 97 additions & 0 deletions assets/Dropdown-Icons/icons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
export const StatusIcon = () => (
<svg
width="12"
height="12"
viewBox="0 0 12 12"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 12C2.68629 12 0 9.31371 0 6C0 2.68629 2.68629 0 6 0C9.31371 0 12 2.68629 12 6C11.9964 9.3122 9.3122 11.9964 6 12ZM5.9904 10.8H6C8.65003 10.7973 10.7965 8.64763 10.7952 5.9976C10.7939 3.34757 8.64523 1.2 5.9952 1.2C3.34517 1.2 1.19653 3.34757 1.1952 5.9976C1.19388 8.64763 3.34037 10.7973 5.9904 10.8ZM4.8 9L2.4 6.6L3.246 5.754L4.8 7.302L8.754 3.348L9.6 4.2L4.8 9Z"
fill="#2E3A59"
fill-opacity="0.85"
/>
</svg>
);

export const TechnologyIcon = () => (
<svg
width="13"
height="14"
viewBox="0 0 13 14"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6.83268 1.3814C6.87201 1.04607 6.47802 0.863407 6.27602 1.12274L1.07409 7.79798C0.902095 8.01797 1.04876 8.35264 1.31676 8.35264H5.97536C6.16536 8.35264 6.31269 8.53063 6.28869 8.73263L5.83536 12.6192C5.79536 12.9539 6.18869 13.1366 6.39135 12.8772L11.5926 6.202C11.7646 5.982 11.6179 5.64734 11.35 5.64734H6.69135C6.50135 5.64734 6.35402 5.46934 6.37802 5.26735L6.83268 1.3814Z"
stroke="#2E3A59"
stroke-opacity="0.85"
stroke-width="1.25"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
);

export const ProjectSizeIcon = () => (
<svg
width="10"
height="12"
viewBox="0 0 10 12"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6.70673 12H3.10673V10.8H6.70673V12ZM6.70673 10.2H3.10673L2.97293 9C2.90095 8.60308 2.78191 8.21615 2.61833 7.8474C2.40593 7.5474 2.18453 7.2912 1.97033 7.041C1.18319 6.30318 0.727517 5.27867 0.706726 4.2C0.706726 1.8804 2.58713 0 4.90673 0C7.22632 0 9.10673 1.8804 9.10673 4.2C9.08232 5.27208 8.63014 6.28986 7.85093 7.0266L7.84073 7.0386C7.62713 7.2888 7.40633 7.548 7.19813 7.845C7.03469 8.21473 6.91527 8.60239 6.84233 9L6.70673 10.2ZM4.90673 1.2C3.25069 1.20198 1.90871 2.54397 1.90673 4.2C1.90673 5.1264 2.29313 5.5758 2.87753 6.2568C3.09953 6.516 3.35153 6.8088 3.59753 7.1514C3.89607 7.7315 4.10004 8.35556 4.20173 9H5.61233C5.71664 8.35742 5.92027 7.73498 6.21593 7.155C6.45593 6.8124 6.70733 6.5178 6.92873 6.2586L6.93773 6.2478C7.52093 5.5638 7.90673 5.112 7.90673 4.2C7.90474 2.54397 6.56276 1.20198 4.90673 1.2Z"
fill="#2E3A59"
fill-opacity="0.85"
/>
</svg>
);

export const LocationIcon = () => (
<svg
width="10"
height="12"
viewBox="0 0 10 12"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M4.79241 12C3.95054 11.2819 3.17021 10.4947 2.45956 9.64649C1.39312 8.37275 0.12671 6.47581 0.12671 4.66818C0.125764 2.78027 1.26264 1.07785 3.00683 0.355333C4.75102 -0.36718 6.75872 0.0326284 8.09307 1.36819C8.97052 2.24175 9.46206 3.43003 9.45814 4.66818C9.45814 6.47581 8.19171 8.37275 7.12527 9.64649C6.41462 10.4947 5.63429 11.2819 4.79241 12ZM4.79241 1.33553C2.95276 1.33774 1.46197 2.82852 1.45977 4.66818C1.45977 5.44535 1.81103 6.79107 3.48268 8.79133C3.89469 9.28326 4.33185 9.75357 4.79241 10.2004C5.25302 9.7541 5.69039 9.28447 6.10281 8.79333C7.7738 6.79041 8.12506 5.44469 8.12506 4.66818C8.12286 2.82852 6.63207 1.33774 4.79241 1.33553ZM4.79241 6.66777C3.68807 6.66777 2.79283 5.77252 2.79283 4.66818C2.79283 3.56384 3.68807 2.66859 4.79241 2.66859C5.89676 2.66859 6.792 3.56384 6.792 4.66818C6.792 5.1985 6.58133 5.70711 6.20634 6.0821C5.83134 6.4571 5.32274 6.66777 4.79241 6.66777Z"
fill="#2E3A59"
fill-opacity="0.85"
/>
</svg>
);

export const DropIcon = () => (
<svg
width="13"
height="8"
viewBox="0 0 13 8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
opacity="0.5"
d="M6.69671 7.71248L12.7067 1.70248L11.2937 0.287476L6.69671 4.88748L2.10071 0.287476L0.686707 1.70148L6.69671 7.71248Z"
fill="#2E3A59"
/>
</svg>
);

export const ExitIcon = () => (
<svg
width="10"
height="10"
viewBox="0 0 10 10"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8.99286 0L5 3.99286L1.00714 0L0 1.00714L3.99286 5L0 8.99286L1.00714 10L5 6.00714L8.99286 10L10 8.99286L6.00714 5L10 1.00714L8.99286 0Z"
fill="#2E3A59"
/>
</svg>
);
17 changes: 17 additions & 0 deletions assets/Size-Icons/icons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export const SmallSizeIcon = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="6"
height="9"
viewBox="0 0 6 9"
fill="none"
>
<path
d="M0.590391 4.57726L4.22789 0.45262L3.63751 3.54051L5.60318 3.90278L1.96568 8.02742L2.55606 4.93954L0.590391 4.57726Z"
stroke="#2E3A59"
strokeOpacity="0.5"
strokeWidth="0.75"
strokeLinejoin="round"
/>
</svg>
);
40 changes: 40 additions & 0 deletions assets/Status-Tag-Icons/icons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
export const CalendarIcon = () => (
<svg
width="7"
height="8"
viewBox="0 0 7 8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M1.54412 0.5C1.62602 0.5 1.70457 0.532537 1.76249 0.590452C1.8204 0.648368 1.85294 0.726918 1.85294 0.808824V1.11765H4.52941V0.808824C4.52941 0.726918 4.56195 0.648368 4.61986 0.590452C4.67778 0.532537 4.75633 0.5 4.83824 0.5C4.92014 0.5 4.99869 0.532537 5.05661 0.590452C5.11452 0.648368 5.14706 0.726918 5.14706 0.808824V1.12094C5.20965 1.12259 5.26798 1.12561 5.32206 1.13C5.47853 1.14235 5.62512 1.17035 5.76388 1.24118C5.97699 1.34975 6.15025 1.52301 6.25882 1.73612C6.32965 1.87488 6.35765 2.02147 6.37 2.17794C6.38235 2.32824 6.38235 2.51147 6.38235 2.73176V5.88588C6.38235 6.10618 6.38235 6.28941 6.37 6.43971C6.35765 6.59618 6.32965 6.74276 6.25882 6.88153C6.15036 7.09458 5.97725 7.26783 5.76429 7.37647C5.62512 7.44729 5.47853 7.47529 5.32206 7.48765C5.17177 7.5 4.98853 7.5 4.76865 7.5H1.61412C1.39382 7.5 1.21059 7.5 1.06029 7.48765C0.903824 7.47529 0.757235 7.44729 0.618471 7.37647C0.405486 7.26812 0.23224 7.09516 0.12353 6.88235C0.052706 6.74318 0.024706 6.59659 0.012353 6.44012C8.6613e-08 6.28982 0 6.10659 0 5.88671V2.73176C0 2.51147 8.6613e-08 2.32824 0.012353 2.17794C0.024706 2.02147 0.052706 1.87488 0.12353 1.73612C0.2321 1.52301 0.40536 1.34975 0.618471 1.24118C0.757235 1.17035 0.903824 1.14235 1.06029 1.13C1.11437 1.12561 1.17271 1.12259 1.23529 1.12094V0.808824C1.23529 0.768268 1.24328 0.72811 1.2588 0.690642C1.27432 0.653174 1.29707 0.619129 1.32575 0.590452C1.35442 0.561775 1.38847 0.539028 1.42594 0.523508C1.4634 0.507988 1.50356 0.5 1.54412 0.5ZM5.76471 3.38235H0.617647V5.87353C0.617647 6.10906 0.617647 6.26759 0.627941 6.38906C0.637412 6.50765 0.654706 6.56406 0.673647 6.60112C0.723059 6.69829 0.801706 6.77694 0.898882 6.82635C0.935941 6.84529 0.992353 6.86259 1.11053 6.87206C1.23241 6.88194 1.39053 6.88235 1.62647 6.88235H4.75588C4.99141 6.88235 5.14994 6.88235 5.27141 6.87206C5.39 6.86259 5.44641 6.84529 5.48347 6.82635C5.58048 6.77698 5.65933 6.69812 5.70871 6.60112C5.72765 6.56406 5.74494 6.50765 5.75441 6.38906C5.76429 6.26759 5.76471 6.10906 5.76471 5.87353V3.38235ZM2.16176 2.04412C2.07986 2.04412 2.00131 2.07665 1.94339 2.13457C1.88548 2.19249 1.85294 2.27104 1.85294 2.35294C1.85294 2.43485 1.88548 2.5134 1.94339 2.57131C2.00131 2.62923 2.07986 2.66176 2.16176 2.66176H4.22059C4.30249 2.66176 4.38104 2.62923 4.43896 2.57131C4.49688 2.5134 4.52941 2.43485 4.52941 2.35294C4.52941 2.27104 4.49688 2.19249 4.43896 2.13457C4.38104 2.07665 4.30249 2.04412 4.22059 2.04412H2.16176Z"
fill="#4974E0"
/>
</svg>
);

export const GreenDotOperationalIcon = () => (
<svg
width="5"
height="6"
viewBox="0 0 5 6"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="2.5" cy="3" r="2.5" fill="#1BA546" />
</svg>
);

export const GreyDotInProgressIcon = () => (
<svg
width="5"
height="6"
viewBox="0 0 5 6"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="2.5" cy="3" r="2.5" fill="#D6D6D6" />
</svg>
);
Loading

0 comments on commit 6b0ddad

Please sign in to comment.