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

Add precipitation dataset placeholders for Mobile Climate Mapper #76

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
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
9 changes: 5 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"trailingComma": "none",
"tabWidth": 4,
"semi": true,
"singleQuote": true
}
"trailingComma": "none",
"singleQuote": true,
"jsxSingleQuote": true,
"printWidth": 80
}
79 changes: 27 additions & 52 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,62 +1,37 @@
import { useState } from 'react';
import Map from './components/Map';
import Panel from './components/Panel';
import EICLogo from './components/Logo';
import {
MapViewContext,
ChartDataContext,
DataSelectionContext,
ErrorContext
} from './contexts/AppContext';
import { VideoProvider } from './contexts/VideoContext';
import { DataFetchingProvider } from './contexts/DataFetchingContext';
import config from './config.json';
import { AppProvider, useAppContext } from './contexts';
import RotateOverlay from './components/RotateOverlay';
import Tour from './components/Tour';

export default function App() {
const defaultDataset = config.datasets[0];
const defaultVariable = defaultDataset.variables[1];
const [dataSelection, setDataSelection] = useState([
defaultDataset,
defaultVariable
]);
const [mapView, setMapView] = useState(null);
const [chartData, setChartData] = useState([]);
const [hasWebGLError, setHasWebGLError] = useState(false);
function AppContent() {
const { hasWebGLError } = useAppContext();

if (hasWebGLError) {
return (
<ErrorContext.Provider value={{ hasWebGLError, setHasWebGLError }}>
<MapViewContext.Provider value={{ mapView, setMapView }}>
<DataSelectionContext.Provider
value={{ dataSelection, setDataSelection }}
>
<VideoProvider>
<ChartDataContext.Provider
value={{ chartData, setChartData }}
>
<DataFetchingProvider>
{hasWebGLError ? (
<div>
Your WebGL implementation doesn't seem
to support hardware accelerated
rendering. Check your browser settings
or if your GPU is in a blocklist.
</div>
) : (
<>
<Tour />
<RotateOverlay />
<EICLogo />
<Panel />
<Map />
</>
)}
</DataFetchingProvider>
</ChartDataContext.Provider>
</VideoProvider>
</DataSelectionContext.Provider>
</MapViewContext.Provider>
</ErrorContext.Provider>
<div>
Your WebGL implementation doesn't seem to support hardware accelerated
rendering. Check your browser settings or if your GPU is in a blocklist.
</div>
);
}

return (
<>
<Tour />
<RotateOverlay />
<EICLogo />
<Panel />
<Map />
</>
);
}

export default function App() {
return (
<AppProvider>
<AppContent />
</AppProvider>
);
}
Loading
Loading