Skip to content

Commit

Permalink
Use Link component from context provider
Browse files Browse the repository at this point in the history
  • Loading branch information
vgeorge committed Jan 7, 2025
1 parent 06cf39f commit b59aee0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 4 additions & 5 deletions app/scripts/components/exploration/container.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useState } from 'react';
import { TourProvider } from '@reactour/tour';
import { Link } from 'react-router-dom';
import { DevTools } from 'jotai-devtools';
import { useAtom, useSetAtom } from 'jotai';
import { PopoverTourComponent, TourManager } from './tour-manager';
Expand All @@ -16,6 +15,7 @@ import { PageMainContent } from '$styles/page';
import { LayoutProps } from '$components/common/layout-root';
import PageHero from '$components/common/page-hero';
import { DATASETS_PATH, EXPLORATION_PATH } from '$utils/routes';
import { useVedaUI } from '$context/veda-ui-provider';

/**
* @VEDA2-REFACTOR-WORK
Expand All @@ -33,6 +33,8 @@ const tourProviderStyles = {
};

export default function ExplorationAndAnalysisContainer() {
const { Link } = useVedaUI();

const setExternalDatasets = useSetAtom(externalDatasetsAtom);
setExternalDatasets(allExploreDatasets);
const [timelineDatasets, setTimelineDatasets] = useTimelineDatasetAtom();
Expand Down Expand Up @@ -82,10 +84,7 @@ export default function ExplorationAndAnalysisContainer() {
This tool allows the exploration and analysis of time-series
datasets in raster format. For a comprehensive list of available
datasets, please visit the{' '}
<Link to={DATASETS_PATH}>
Data Catalog
</Link>
.
<Link to={DATASETS_PATH}>Data Catalog</Link>.
</p>
</>
}
Expand Down
4 changes: 3 additions & 1 deletion app/scripts/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ const composingComponents = [
envApiRasterEndpoint: process.env.API_RASTER_ENDPOINT ?? '',
navigation: {
LinkComponent: Link,
linkPropName: 'to'
linkProps: {
pathAttributeKeyName: 'to'
}
}
}}
>
Expand Down

0 comments on commit b59aee0

Please sign in to comment.