Skip to content

Commit

Permalink
feat: upgrade to next js 14
Browse files Browse the repository at this point in the history
  • Loading branch information
DevanshBajaj committed Jun 17, 2024
1 parent f852c82 commit 2915eeb
Show file tree
Hide file tree
Showing 11 changed files with 1,580 additions and 1,781 deletions.
2 changes: 1 addition & 1 deletion components/NavLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const NavLink = ({ href, children }) => {
className = `${className} ${utilStyles.active}`;
}

return <Link href={href}>{React.cloneElement(children, { className })}</Link>;
return <Link href={href} legacyBehavior>{React.cloneElement(children, { className })}</Link>;
};

export default NavLink;
2 changes: 1 addition & 1 deletion components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const Layout = ({ children, home }) => {
<div className={styles.profileimg}>
<Image
priority
src={profileimg}
src={"https://s3.devanshbajaj.dev/IMG_2137.JPG"}
height={144}
width={144}
alt={name}
Expand Down
14 changes: 12 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
module.exports = {
/* config options here */
module.exports = {
/* config options here */
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 's3.devanshbajaj.dev',
port: '',
pathname: '/*',
},
],
},
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"date-fns": "^2.23.0",
"framer-motion": "^4.1.17",
"gray-matter": "^4.0.3",
"next": "^12.0.4",
"next": "^14.2.4",
"next-themes": "^0.0.15",
"nextjs-progressbar": "^0.0.11",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^4.2.0",
"react-markdown": "^7.0.1",
"react-syntax-highlighter": "^15.4.4",
Expand All @@ -30,6 +30,6 @@
},
"devDependencies": {
"eslint": "7.32.0",
"eslint-config-next": "11.1.0"
"eslint-config-next": "^14.2.4"
}
}
104 changes: 52 additions & 52 deletions pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
import "../styles/global.css";
import { ThemeProvider } from "next-themes";
import { AnimatePresence } from "framer-motion";
import Footer from "../components/footer";
import NextNprogress from "nextjs-progressbar";
import Head from "next/head";
import Script from "next/script";

function App({ Component, pageProps }) {
return (
<ThemeProvider
themes={["dark", "light", "nord", "blue"]}
forcedTheme={Component.theme || undefined}
defaultTheme="blue"
>
<Script src="https://scripts.simpleanalyticscdn.com/latest.js" />
<noscript>
{/* eslint-disable @next/next/no-img-element */}
<img
src="https://queue.simpleanalyticscdn.com/noscript.gif"
alt=""
referrerPolicy="no-referrer-when-downgrade"
/>
</noscript>
<Head>
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=5.0, minimum-scale=0.86"
/>
</Head>
<NextNprogress
color="var(--theme-accent)"
startPosition={0.3}
stopDelayMs={200}
height={4}
showOnShallow={true}
options={{ easing: "ease", speed: 500, showSpinner: false }}
/>
<div className="container">
<AnimatePresence
initial={false}
onExitComplete={() => window.scrollTo(0, 0)}
>
<Component {...pageProps} />
</AnimatePresence>
</div>
<Footer />
</ThemeProvider>
);
}

export default App;
import "../styles/global.css";
import { ThemeProvider } from "next-themes";
import { AnimatePresence } from "framer-motion";
import Footer from "../components/footer";
import NextNprogress from "nextjs-progressbar";
import Head from "next/head";
import Script from "next/script";

function App({ Component, pageProps }) {
return (
<ThemeProvider
themes={["dark", "light", "nord", "blue"]}
forcedTheme={Component.theme || undefined}
defaultTheme="blue"
>
<Script src="https://scripts.simpleanalyticscdn.com/latest.js" />
<noscript>
{/* eslint-disable @next/next/no-img-element */}
<img
src="https://queue.simpleanalyticscdn.com/noscript.gif"
alt=""
referrerPolicy="no-referrer-when-downgrade"
/>
</noscript>
<Head>
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=5.0, minimum-scale=0.86"
/>
</Head>
<NextNprogress
color="var(--theme-accent)"
startPosition={0.3}
stopDelayMs={200}
height={4}
showOnShallow={true}
options={{ easing: "ease", speed: 500, showSpinner: false }}
/>
<div className="container">
<AnimatePresence
initial={false}
onExitComplete={() => window.scrollTo(0, 0)}
>
<Component {...pageProps} />
</AnimatePresence>
</div>
<Footer />
</ThemeProvider>
);
}

export default App;
Loading

0 comments on commit 2915eeb

Please sign in to comment.