-
Notifications
You must be signed in to change notification settings - Fork 0
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
[DRAFT - experimental] Migrate from next12 pages to next13 app dir #145
base: stable
Are you sure you want to change the base?
Conversation
- Added a Disclaimer to the Data top bar - Updated the Data top bar styles to account for the disclaimer - Created disclaimer styles to be responsive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great - i just put some small cleanup suggestions in the other PR to this PR
helpers/dataLoader.js
Outdated
// // import fetch from 'isomorphic-unfetch' | ||
|
||
// // six seconds | ||
// const updateTime = 6 * 60 * 1000 | ||
|
||
// const dataFetchParams = { | ||
// method: 'GET', | ||
// mode: 'cors', | ||
// cache: 'no-cache', | ||
// credentials: 'same-origin', | ||
// headers: { 'Content-Type': 'application/json', 'Accept-Encoding': 'gzip' }, | ||
// // referrer: 'no-referrer' | ||
// }; | ||
|
||
// export const fetchSamplesData = () => | ||
// fetch(ENDPOINTS.samples, dataFetchParams) | ||
// .then((response) => { | ||
// if (response.ok) return response.json(); | ||
// throw new Error(`Request rejected with status ${response.status}`); | ||
// }) | ||
// .then((json) => { | ||
// if (!json.version) return { samples: json }; | ||
// return json; | ||
// }); | ||
|
||
// export const dataFetchProcess = (() => { | ||
// let dataFetchProcess = null | ||
|
||
// const fetching = update => () => { | ||
// console.log('Fetching new data ...') | ||
// fetchSamplesData().then(data => { | ||
// console.log('New data received. Loading ...') | ||
// console.log(data); | ||
// update(data) | ||
// }) | ||
// } | ||
|
||
// const start = update => { | ||
// if (dataFetchProcess === null) { | ||
// console.log('Begining data fetching.') | ||
// const fetcher = fetching(update) | ||
// fetcher() // first instance | ||
// dataFetchProcess = setInterval(fetcher, updateTime) | ||
// } else { | ||
// console.log('Data fetching already running.') | ||
// } | ||
// } | ||
|
||
// const stop = () => { clearInterval(dataFetchProcess) } | ||
|
||
// return { start, stop } | ||
// })() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to delete
providers/DataProvider.js
Outdated
} | ||
}, [setSamples, setUnits, setSources]); | ||
|
||
useInterval(fetchData, 6000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets bump this to like 1-3 minutes, its unnecessarily responsive
- Created a new hook: useIsMobile - which executes on the client side - Refactored DateRangePicker to a functional component so it can use the new `useIsMobile` hook when mounting - Removed the usage of isMobile layout helper that was trying to access the window width directly on React hydration after server render, which caused different rendered content issues. - the new isMobile hook uses `useEffect` which fires after mount, preventing hydration mismatches Co-authored-by: Amir Kaudinov <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Keeping this PR open as an experimental draft of Next.js 13 experimental app directory |
Moved pages out of pages directory and into new next13 app directory
Created a DataProvider
Global styles moved from pages/global.css to styles/globals.css