Skip to content

Commit

Permalink
Merge pull request #11 from developmentseed/test-branch
Browse files Browse the repository at this point in the history
Use hook from library to set timelinedatasets
  • Loading branch information
sandrahoang686 authored Nov 6, 2024
2 parents 04f2337 + f6c3264 commit c9c2bc0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
22 changes: 13 additions & 9 deletions app/(datasets)/exploration/exploration.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
'use client';
import React, { useState } from 'react';
import { useAtom } from 'jotai';
import Link from 'next/link';
import { ExplorationAndAnalysis, timelineDatasetsAtom, DatasetSelectorModal } from 'app/lib';
import { ExplorationAndAnalysis, DatasetSelectorModal, useTimelineDatasetAtom } from 'app/lib';

export default function ExplorationAnalysis({
datasets
}: {
datasets: any;
}) {
const [explorationDatasets, setExplorationDatasets] = useAtom(timelineDatasetsAtom);
const [timelineDatasets, setTimelineDatasets] = useTimelineDatasetAtom();
const [datasetModalRevealed, setDatasetModalRevealed] = useState(
!!datasets.length
!timelineDatasets.length
);


Expand Down Expand Up @@ -42,21 +41,26 @@ export default function ExplorationAnalysis({

return (
<>
{
datasetModalRevealed && (


<DatasetSelectorModal
revealed={datasetModalRevealed}
close={closeModal}
linkProperties={{
LinkElement: Link,
pathAttributeKeyName: 'href'
}}
timelineDatasets={timelineDatasets}
setTimelineDatasets={setTimelineDatasets}
datasetPathName={'data-catalog'}
datasets={transformed}
/>
)
}
<ExplorationAndAnalysis datasets={explorationDatasets} setDatasets={setExplorationDatasets} openDatasetsSelectionModal={openModal} />


<ExplorationAndAnalysis
datasets={timelineDatasets}
setDatasets={setTimelineDatasets}
openDatasetsSelectionModal={openModal} />
</>
)
};
1 change: 0 additions & 1 deletion app/(datasets)/exploration/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { PageHero } from 'app/lib';

export default function Page() {
const datasets: any[] = getDatasets();

// @TODO: Investigate why we need to set 100vh
return (
<section style={{height: "100vh"}}>
Expand Down
2 changes: 1 addition & 1 deletion app/blog/datasets/no2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ layers:
stacCol: no2-monthly
name: No2 PT
media:
src: ::file ./img-placeholder-3.jpg
src: /images/dataset/no2--dataset-cover.jpg
alt: Placeholder Image
type: raster
projection:
Expand Down
3 changes: 2 additions & 1 deletion app/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client';
import { CatalogView, PageHero, useFiltersWithQS, ExplorationAndAnalysis, DatasetSelectorModal, timelineDatasetsAtom } from '@developmentseed/veda-ui';
import { CatalogView, PageHero, useFiltersWithQS, ExplorationAndAnalysis, DatasetSelectorModal, timelineDatasetsAtom, useTimelineDatasetAtom } from '@developmentseed/veda-ui';

export {
CatalogView,
Expand All @@ -8,4 +8,5 @@ export {
ExplorationAndAnalysis,
DatasetSelectorModal,
timelineDatasetsAtom,
useTimelineDatasetAtom
}
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
},
];
},
reactStrictMode: false,
webpack: (config) => {
config.resolve.alias = {
...(config.resolve.alias || {}),
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@
style-mod "^4.1.0"
w3c-keyname "^2.2.4"

"@developmentseed/veda-ui@v5.7.0-alpha.1":
version "5.7.0-alpha.1"
resolved "http://verdaccio.ds.io:4873/@developmentseed%2fveda-ui/-/veda-ui-5.7.0-alpha.1.tgz#8383fd94525b38fe5d5a9cb2a77165488825a6ab"
integrity sha512-7GWI3oM8MiRO9gQklHtV7MEUf0kbipTvvjvTmPdZGtYS/SV+EA9WiHLoL6tg9oGN90gW0OBsuwJDHt6CbWuzDQ==
"@developmentseed/veda-ui@v5.8.0-ea.0":
version "5.8.0-ea.0"
resolved "http://verdaccio.ds.io:4873/@developmentseed%2fveda-ui/-/veda-ui-5.8.0-ea.0.tgz#321e5f476c04b97348844ece720458e9e4995058"
integrity sha512-dglUBWmajbPRz4XhCIsu13FtTDk9OpD4STL/Mitk1E0fFp/XRr0DrYwD4+CN7wUF/+0RatlhSpFT6fcCVf1Elg==
dependencies:
"@codemirror/lang-markdown" "^6.1.1"
"@codemirror/state" "^6.2.1"
Expand Down

0 comments on commit c9c2bc0

Please sign in to comment.