Sidebar links changes, getstaticprops tries

This commit is contained in:
mrfry 2020-12-21 10:22:50 +01:00
parent a13fee6f84
commit c6ba225fd8
8 changed files with 2193 additions and 4508 deletions

View file

@ -1,5 +1,6 @@
// import App from 'next/app'
import React from 'react'
import '../defaultStyles.css'
import Layout from '../components/layout'
import constants from '../constants.json'
@ -57,6 +58,7 @@ function fetchData() {
}
function MyApp({ Component, pageProps, router }) {
console.log(pageProps)
return (
<Layout route={router.route}>
<Component {...pageProps} router={router} getData={fetchData} />
@ -64,6 +66,21 @@ function MyApp({ Component, pageProps, router }) {
)
}
export async function getStaticProps() {
console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
const res = await fetch('https://stuff.frylabs.net/asd.json', {
credentials: 'include',
})
const resp = await res.json()
console.log('aaaaaaaaaaaaa', resp)
return {
props: {
msg: 'aaaaa',
fetched: resp,
},
}
}
// Only uncomment this method if you have blocking data requirements for
// every single page in your application. This disables the ability to
// perform automatic static optimization, causing every page in your app to