diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..e9ee3cb --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps=true \ No newline at end of file diff --git a/app/dashboard/layout.js b/app/(index)/layout.js similarity index 57% rename from app/dashboard/layout.js rename to app/(index)/layout.js index 4de18a8..7b8d936 100644 --- a/app/dashboard/layout.js +++ b/app/(index)/layout.js @@ -1,9 +1,12 @@ import Navbar from '../../components/Navbar'; import '../../styles/globals.css'; +/** + * Child layout that wraps the index page -- main page -- with specific styles + */ export default async function Layout({ children }) { return ( -
+
{children}
diff --git a/app/(index)/loading.js b/app/(index)/loading.js new file mode 100644 index 0000000..731ea6c --- /dev/null +++ b/app/(index)/loading.js @@ -0,0 +1,9 @@ +import React from 'react'; +import ProgressBar from '../../components/ProgressBar'; + +//Separated Loading components for each grouped route +//this fixed an issue where sometimes the managed suspense would continue to show the loading status +//even though the route segment was ready to render. This issue was occurring in dev mode, where there's no route prefetch +export default function Loading() { + return +} \ No newline at end of file diff --git a/app/dashboard/page.js b/app/(index)/page.js similarity index 96% rename from app/dashboard/page.js rename to app/(index)/page.js index 330320c..adb1e68 100644 --- a/app/dashboard/page.js +++ b/app/(index)/page.js @@ -18,7 +18,7 @@ const Dashboard = () => { const [tooltipSlug, setTooltipSlug] = useState(); const [sample, range, timestamp, setTimestamp] = useSample(samples); - const [showBanner, setShowBanner] = useState(true); + const [showBanner, setShowBanner] = useState(false); const hideBanner = () => setShowBanner(false); diff --git a/app/about/page.js b/app/(other)/about/page.js similarity index 82% rename from app/about/page.js rename to app/(other)/about/page.js index 56bac70..2e90574 100644 --- a/app/about/page.js +++ b/app/(other)/about/page.js @@ -1,5 +1,5 @@ -import AboutSection from '../../components/AboutSection'; -import content from '../../content'; +import AboutSection from '../../../components/AboutSection'; +import content from '../../../content'; const About = () => { const aboutSection = (section, index) => ( diff --git a/app/data/page.js b/app/(other)/data/page.js similarity index 83% rename from app/data/page.js rename to app/(other)/data/page.js index bed38cf..b9d3ac3 100644 --- a/app/data/page.js +++ b/app/(other)/data/page.js @@ -1,9 +1,9 @@ 'use client'; import React, { useState, useContext } from 'react'; -import Graphs from '../../components/Graphs'; -import Tooltip from '../../components/Tooltip'; -import { DataContext } from '../../providers/DataProvider'; +import Graphs from '../../../components/Graphs'; +import Tooltip from '../../../components/Tooltip'; +import { DataContext } from '../../../providers/DataProvider'; const Data = () => { const { samples, sources, units } = useContext(DataContext); diff --git a/app/about/layout.js b/app/(other)/layout.js similarity index 58% rename from app/about/layout.js rename to app/(other)/layout.js index e0318be..9cdf2b4 100644 --- a/app/about/layout.js +++ b/app/(other)/layout.js @@ -1,11 +1,16 @@ import Navbar from '../../components/Navbar'; import '../../styles/globals.css'; +/** + * Child layout that wraps all pages that are not index + * and has no index specific container styles + */ export default async function Layout({ children }) { return ( -
+
{children}
); } + diff --git a/app/(other)/loading.js b/app/(other)/loading.js new file mode 100644 index 0000000..e83db8f --- /dev/null +++ b/app/(other)/loading.js @@ -0,0 +1,10 @@ +import React from 'react'; +import ProgressBar from '../../components/ProgressBar'; + + +//Separated Loading components for each grouped route +//this fixed an issue where sometimes the managed suspense would continue to show the loading status +//even though the route segment was ready to render. This issue was occurring in dev mode, where there's no route prefetch +export default function Loading() { + return +} \ No newline at end of file diff --git a/app/data/layout.js b/app/data/layout.js deleted file mode 100644 index 71eb7a3..0000000 --- a/app/data/layout.js +++ /dev/null @@ -1,11 +0,0 @@ -import Navbar from '../../components/Navbar'; -import '../../styles/globals.css'; - -export default async function Layout({ children }) { - return ( -
- - {children} -
- ); -} diff --git a/app/googleAnalytics.js b/app/googleAnalytics.js new file mode 100644 index 0000000..1904668 --- /dev/null +++ b/app/googleAnalytics.js @@ -0,0 +1,25 @@ +'use client' //use client so the script doesn't get loaded on the server + +import React from 'react'; +import Script from 'next/script'; +import { GA_TRACKING_ID } from '../helpers/constants'; + +const GoogleAnalytics = () => ( + <> + + +); + +export default GoogleAnalytics; diff --git a/app/head.js b/app/head.js index cb96b04..f29fe3c 100644 --- a/app/head.js +++ b/app/head.js @@ -5,8 +5,8 @@ export default function Head() { <> {content.social.title} - - + + diff --git a/app/layout.js b/app/layout.js index 94e3e9c..ac1007f 100644 --- a/app/layout.js +++ b/app/layout.js @@ -1,38 +1,23 @@ -import { GA_TRACKING_ID } from '../helpers/constants'; -import Script from 'next/script'; - +import { getData } from '/helpers/dataLoader'; import DataContextProvider from '../providers/DataProvider'; -import { getData } from '../helpers/dataLoader'; - +import GoogleAnalytics from './googleAnalytics'; import '../styles/globals.css'; -const GoogleAnalytics = () => ( - <> - - -); - -export default async function RootLayout({ children }) { +/** + * Root Layout that gets data and wraps the app with the Context Provider + */ +export default async function RootLayout ({ children }) { let data = await getData(); return ( - - - - {children} - + + + + + + {children} + + ); } diff --git a/app/loading.js b/app/loading.js deleted file mode 100644 index 643f6a9..0000000 --- a/app/loading.js +++ /dev/null @@ -1,11 +0,0 @@ -import ProgressBar from '../components/ProgressBar'; -import Navbar from '../components/Navbar'; - -export default function Loading() { - return ( -
- - -
- ); -} diff --git a/app/page.js b/app/page.js deleted file mode 100644 index 35e4ef4..0000000 --- a/app/page.js +++ /dev/null @@ -1,7 +0,0 @@ -import { redirect } from 'next/navigation'; - -const Index = () => { - redirect('/dashboard'); -}; - -export default Index; diff --git a/components/AboutSection/index.js b/components/AboutSection/index.js index e762811..98d1b85 100644 --- a/components/AboutSection/index.js +++ b/components/AboutSection/index.js @@ -5,7 +5,7 @@ const AboutSection = ({ side, image, title, body, cta, carousel }) => (
{image && (
- +
)}
diff --git a/components/Carousel/index.js b/components/Carousel/index.js index db6704b..155857d 100644 --- a/components/Carousel/index.js +++ b/components/Carousel/index.js @@ -15,7 +15,7 @@ import styles from './Carousel.module.css'; const slides = [ { - image: '/static/img/about/image-billionoyster.jpg', + image: '/img/about/image-billionoyster.jpg', description: 'four people, knee deep in a river, frontmost person smiling and holding a basket full of oysters', title: 'Billion Oyster Project', @@ -31,7 +31,7 @@ const slides = [ ), }, { - image: '/static/img/about/image-nywatertrails.jpg', + image: '/img/about/image-nywatertrails.jpg', title: 'New York Water Trail Association', description: 'four people, knee deep in a river, frontmost person smiling and holding a basket full of oysters', @@ -53,7 +53,7 @@ const slides = [ ), }, { - image: '/static/img/about/image-riverkeeper.jpg', + image: '/img/about/image-riverkeeper.jpg', description: 'a 20-foot boat named riverkeeper', title: 'Riverkeeper', body: ( @@ -76,7 +76,7 @@ const slides = [ ), }, { - image: '/static/img/about/image-newtoncreek.jpg', + image: '/img/about/image-newtoncreek.jpg', title: 'Newtown Creek Alliance', description: 'a 20-foot boat with the manhattan skyline behind it', body: ( @@ -100,7 +100,7 @@ const slides = [ ), }, { - image: '/static/img/about/image-gowanuscanal.jpg', + image: '/img/about/image-gowanuscanal.jpg', description: 'a two person kayak, paddling in front of an overpass in the gowanus canal', title: 'Gowanus Canal Conservancy', @@ -122,7 +122,7 @@ const slides = [ ), }, { - image: '/static/img/about/image-bronxalliance.jpg', + image: '/img/about/image-bronxalliance.jpg', description: 'Four people in the middle of weeds that are taller than all of them. the rightmost person is leaning on a bird house', title: 'Bronx River Alliance', @@ -145,8 +145,9 @@ const slides = [ }, ]; -const getConfig = () => { - const width = typeof window !== 'undefined' ? window.innerWidth : 1200; +//get width from the component instead of trying to access it on the server +//and causing hydration errors +const getConfig = (width) => { if (width < 560) { return { @@ -188,6 +189,7 @@ const CarouselSlide = ({ index, children }) => ( ); + class Carousel extends React.Component { constructor(props) { super(props); @@ -206,7 +208,7 @@ class Carousel extends React.Component { } onResize() { - const config = getConfig(); + const config = getConfig(window.innerWidth); this.setState({ config }); } diff --git a/components/GoogleAnalytics/index.js b/components/GoogleAnalytics/index.js new file mode 100644 index 0000000..e69de29 diff --git a/components/Graph/index.js b/components/Graph/index.js index 0f175fd..eb3fb77 100644 --- a/components/Graph/index.js +++ b/components/Graph/index.js @@ -1,3 +1,4 @@ +'use client' import Circle from '../../icons/Circle' import CloseCircle from '../../icons/CloseCircle' @@ -12,54 +13,59 @@ import dayjs from 'dayjs' import relativeTime from 'dayjs/plugin/relativeTime' import styles from './Graph.module.css'; import { useEffect } from 'react'; +import dynamic from 'next/dynamic' -dayjs.extend(relativeTime); +const DynamicLineGraph = dynamic(() => import('../LineGraph/'), { + ssr: false +}) -const LineGraph = ({ - x, - y, - label, - unit, - data, - color, - domain: [xMin, xMax], - props, - overlayGraph, - dataPoint, -}) => { - const dataRender = [{ id: label, data: formXYSeries(data, x, y) }]; - const defaultProps = { - curve: 'linear', - margin: { top: 10, right: 40, bottom: 50, left: 40 }, - xScale: { - type: 'linear', - min: xMin, - max: xMax, - }, - yScale: { - type: 'linear', - stacked: false, - min: dataPoint.min || 'auto', - max: dataPoint.max || 'auto', - }, - enableGridX: false, - lineWidth: 1, - pointSize: 0, - tooltip: (props) => - GraphTooltip({ label, unit, overlayGraph, data, ...props }), - axisBottom: { - format: (d) => dayjs(d).format('MMM D, YYYY'), - tickValues: 3, - tickSize: 5, - tickPadding: 5, - tickRotation: 30, - }, - data: dataRender, - colors: [color], - }; +dayjs.extend(relativeTime); - return ; -}; +// const LineGraph = ({ +// x, +// y, +// label, +// unit, +// data, +// color, +// domain: [xMin, xMax], +// props, +// overlayGraph, +// dataPoint, +// }) => { +// const dataRender = [{ id: label, data: formXYSeries(data, x, y) }]; +// const defaultProps = { +// curve: 'linear', +// margin: { top: 10, right: 40, bottom: 50, left: 40 }, +// xScale: { +// type: 'linear', +// min: xMin, +// max: xMax, +// }, +// yScale: { +// type: 'linear', +// stacked: false, +// min: dataPoint.min || 'auto', +// max: dataPoint.max || 'auto', +// }, +// enableGridX: false, +// lineWidth: 1, +// pointSize: 0, +// tooltip: (props) => +// GraphTooltip({ label, unit, overlayGraph, data, ...props }), +// axisBottom: { +// format: (d) => dayjs(d).format('MMM D, YYYY'), +// tickValues: 3, +// tickSize: 5, +// tickPadding: 5, +// tickRotation: 30, +// }, +// data: dataRender, +// colors: [color], +// }; +// +// return ; +// }; const Graph = ({ graph, @@ -141,7 +147,7 @@ const Graph = ({
- {overlayGraph && (
- { + const dataRender = [{ id: label, data: formXYSeries(data, x, y) }]; + const defaultProps = { + curve: 'linear', + margin: { top: 10, right: 40, bottom: 50, left: 40 }, + xScale: { + type: 'linear', + min: xMin, + max: xMax, + }, + yScale: { + type: 'linear', + stacked: false, + min: dataPoint.min || 'auto', + max: dataPoint.max || 'auto', + }, + enableGridX: false, + lineWidth: 1, + pointSize: 0, + tooltip: (props) => + GraphTooltip({ label, unit, overlayGraph, data, ...props }), + axisBottom: { + format: (d) => dayjs(d).format('MMM D, YYYY'), + tickValues: 3, + tickSize: 5, + tickPadding: 5, + tickRotation: 30, + }, + data: dataRender, + colors: [color], + }; + + return ; +}; + +export default LineGraph; \ No newline at end of file diff --git a/components/Navbar/Navbar.module.css b/components/Navbar/Navbar.module.css index d61a63d..c535acf 100644 --- a/components/Navbar/Navbar.module.css +++ b/components/Navbar/Navbar.module.css @@ -65,7 +65,7 @@ width: 14px; height: 14px; margin-right: 14px; - background-image: url('/static/img/logo-mobile@2x.png'); + background-image: url('/img/logo-mobile@2x.png'); background-repeat: no-repeat; background-position: center center; background-size: contain; @@ -73,7 +73,7 @@ @media (min-width: 850px) { .logo { - background-image: url('/static/img/logo-desktop@2x.png'); + background-image: url('/img/logo-desktop@2x.png'); width: 74px; height: 14px; } diff --git a/components/Navbar/index.js b/components/Navbar/index.js index b470bd1..6d68d63 100644 --- a/components/Navbar/index.js +++ b/components/Navbar/index.js @@ -1,6 +1,6 @@ 'use client'; -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import content from '../../content'; @@ -9,6 +9,7 @@ import styles from './Navbar.module.css'; const Navbar = () => { const currentPathName = usePathname(); + const [linkName, setLinkName] = useState(); const [isOpen, setIsOpen] = useState(); const toggleIsOpen = () => { @@ -17,11 +18,28 @@ const Navbar = () => { + //execute when currentPathName from next.js or linkName changes + useEffect(() => { + //if next.js currentPath name now matches the set linkName, close the navbar in mobile viewport + //especially helps if the component within a route segment isn't ready to render yet + if(currentPathName === linkName) { + setIsOpen(false) + } + }, [currentPathName, linkName, setIsOpen]); + + + //set current link name + const onNavClick = (e) => { + setLinkName(e.target.getAttribute('data-name')) + // can switch back to this if needed + // setIsOpen(false) + } + return (

- +
{content.nav.titleName}
@@ -71,9 +89,10 @@ const Navbar = () => { setIsOpen(false)} + onClick={onNavClick} > {label} {icon &&
{icon}
} diff --git a/content/nav.js b/content/nav.js index f2595e2..d2555ea 100644 --- a/content/nav.js +++ b/content/nav.js @@ -6,7 +6,7 @@ export default { links: [ { label: 'Dashboard', - pathname: '/dashboard', + pathname: '/', }, { label: 'Data', diff --git a/content/social.js b/content/social.js index d391ac6..9633432 100644 --- a/content/social.js +++ b/content/social.js @@ -4,5 +4,5 @@ export default { url: BASE_URL, title: '+ POOL Water Quality Data Dashboard', description: 'A detailed dashboard for visualizing the components of water quality in the + POOL floating pool in the East River of NYC.', - imageUrl: `${BASE_URL}/static/img/og-image.png` + imageUrl: `${BASE_URL}/img/og-image.png` } diff --git a/helpers/dataLoader.js b/helpers/dataLoader.js index f4ea46e..3d72290 100644 --- a/helpers/dataLoader.js +++ b/helpers/dataLoader.js @@ -4,7 +4,7 @@ export const getData = async () => { const res = await fetch(ENDPOINTS.samples, { method: 'GET', mode: 'cors', - cache: 'no-cache', + // cache: 'no-cache', credentials: 'same-origin', headers: { 'Content-Type': 'application/json', diff --git a/hooks/useIsMobile.js b/hooks/useIsMobile.js index 2b2f763..e3a96ed 100644 --- a/hooks/useIsMobile.js +++ b/hooks/useIsMobile.js @@ -1,7 +1,14 @@ import React, { useEffect, useState } from 'react'; +import { throttle } from 'lodash'; const breakpoint = 560; +/** + * Throttled hook that listens to window width changes + * and returns true if window width is below breakpoint: 560 + * @returns {boolean} + */ + export default function useIsMobile() { const [state, setState] = useState(false); @@ -9,9 +16,9 @@ export default function useIsMobile() { //check the window width right on mount to see if it's already in mobile -- navigated to the page using a mobile viewport setState(window.innerWidth < breakpoint) - function handleWidth() { - setState(window.innerWidth < breakpoint); - } + + //throttle/rate limit the width handling function to every 16 milliseconds + const handleWidth = throttle(() => setState(window.innerWidth < breakpoint), 1000 / 60) window.addEventListener('resize', handleWidth) diff --git a/hooks/useWindowWidth.js b/hooks/useWindowWidth.js new file mode 100644 index 0000000..6a57aab --- /dev/null +++ b/hooks/useWindowWidth.js @@ -0,0 +1,27 @@ +import React, { useEffect, useState } from 'react'; +import { throttle } from 'lodash'; + +/** + * A throttled hook that returns the window width + * @returns {null|number} + */ +export default function useWindowWidth() { + const [state, setState] = useState(null); + + useEffect(() => { + //set window width right on mount + setState(window.innerWidth) + + //throttle/rate limit the width handling function to every 16 milliseconds + const handleWidth = throttle(() => setState(window.innerWidth), 1000 / 60) + + + window.addEventListener('resize', handleWidth) + + //clean up the event listener on un-mount and between re-renders + return () => window.removeEventListener('resize', handleWidth); + }, [setState]); + + return state; +} + diff --git a/package-lock.json b/package-lock.json index 02b3e44..763a2e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9872,6 +9872,186 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/@next/swc-android-arm-eabi": { + "version": "13.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.1.6.tgz", + "integrity": "sha512-F3/6Z8LH/pGlPzR1AcjPFxx35mPqjE5xZcf+IL+KgbW9tMkp7CYi1y7qKrEWU7W4AumxX/8OINnDQWLiwLasLQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-android-arm64": { + "version": "13.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.1.6.tgz", + "integrity": "sha512-cMwQjnB8vrYkWyK/H0Rf2c2pKIH4RGjpKUDvbjVAit6SbwPDpmaijLio0LWFV3/tOnY6kvzbL62lndVA0mkYpw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "13.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.1.6.tgz", + "integrity": "sha512-/uOky5PaZDoaU99ohjtNcDTJ6ks/gZ5ykTQDvNZDjIoCxFe3+t06bxsTPY6tAO6uEAw5f6vVFX5H5KLwhrkZCA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-freebsd-x64": { + "version": "13.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.1.6.tgz", + "integrity": "sha512-qaEALZeV7to6weSXk3Br80wtFQ7cFTpos/q+m9XVRFggu+8Ib895XhMWdJBzew6aaOcMvYR6KQ6JmHA2/eMzWw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm-gnueabihf": { + "version": "13.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.1.6.tgz", + "integrity": "sha512-OybkbC58A1wJ+JrJSOjGDvZzrVEQA4sprJejGqMwiZyLqhr9Eo8FXF0y6HL+m1CPCpPhXEHz/2xKoYsl16kNqw==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "13.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.1.6.tgz", + "integrity": "sha512-yCH+yDr7/4FDuWv6+GiYrPI9kcTAO3y48UmaIbrKy8ZJpi7RehJe3vIBRUmLrLaNDH3rY1rwoHi471NvR5J5NQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "13.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.1.6.tgz", + "integrity": "sha512-ECagB8LGX25P9Mrmlc7Q/TQBb9rGScxHbv/kLqqIWs2fIXy6Y/EiBBiM72NTwuXUFCNrWR4sjUPSooVBJJ3ESQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "13.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.1.6.tgz", + "integrity": "sha512-GT5w2mruk90V/I5g6ScuueE7fqj/d8Bui2qxdw6lFxmuTgMeol5rnzAv4uAoVQgClOUO/MULilzlODg9Ib3Y4Q==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "13.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.1.6.tgz", + "integrity": "sha512-keFD6KvwOPzmat4TCnlnuxJCQepPN+8j3Nw876FtULxo8005Y9Ghcl7ACcR8GoiKoddAq8gxNBrpjoxjQRHeAQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "13.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.1.6.tgz", + "integrity": "sha512-OwertslIiGQluFvHyRDzBCIB07qJjqabAmINlXUYt7/sY7Q7QPE8xVi5beBxX/rxTGPIbtyIe3faBE6Z2KywhQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "13.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.1.6.tgz", + "integrity": "sha512-g8zowiuP8FxUR9zslPmlju7qYbs2XBtTLVSxVikPtUDQedhcls39uKYLvOOd1JZg0ehyhopobRoH1q+MHlIN/w==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "13.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.1.6.tgz", + "integrity": "sha512-Ls2OL9hi3YlJKGNdKv8k3X/lLgc3VmLG3a/DeTkAd+lAituJp8ZHmRmm9f9SL84fT3CotlzcgbdaCDfFwFA6bA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } } } } diff --git a/providers/DataProvider.js b/providers/DataProvider.js index 3bbdef0..19a9dac 100644 --- a/providers/DataProvider.js +++ b/providers/DataProvider.js @@ -26,7 +26,7 @@ const DataContextProvider = ({ children, data }) => { } }, [setSamples, setUnits, setSources]); - useInterval(fetchData, 600000); + useInterval(fetchData, 1000 * 600); //10 minutes in milliseconds return (