Skip to content

Commit 074684a

Browse files
authored
Merge pull request #1 from Infvyr/migrate_next_swr
next and swr migration
2 parents 89e08c3 + 320ce35 commit 074684a

File tree

11 files changed

+1695
-1587
lines changed

11 files changed

+1695
-1587
lines changed

app/head.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/layout.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import { LayoutProvider } from "context/layout";
77
import { theme, navigationHeight, footerHeight } from "util/theme-config";
88
import Loading from "./loading";
99

10+
// export const metadata = { ...AppMetadata };
11+
1012
export default function RootLayout({ children }) {
1113
return (
1214
<html lang="en">
13-
<head />
1415
<body>
1516
<ChakraProvider theme={theme}>
1617
<AppHeader />

app/projects/head.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/projects/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function Page() {
1717
const filterUrl = `${process.env.NEXT_PUBLIC_SANITY_URL}?query=*%5B_type%20%3D%3D%20%22projects%22%20%26%26%20category%5B0%5D-%3Etitle%20%3D%3D%20%22${category}%22%5D%7B%0A%20%20_id%2C%0A%20%20createdAt%2C%0A%20%20%22category%22%3A%20category%5B0%5D-%3Etitle%2C%0A%20%20description%2C%0A%20%20title%2C%0A%20%20%22poster%22%3A%20poster.asset-%3Eurl%2C%0A%20%20liveUrl%2C%0A%20%20repoUrl%2C%0A%20%20%22images%22%3A%20images%5B%5D.asset-%3Eurl%2C%0A%20%20%22stack%22%3A%20stack%5B%5D-%3Etitle%0A%7D%20%7C%20order(createdAt%20desc)`;
1818

1919
const fetchUrl = category ? filterUrl : url;
20-
const { data: filteredProjs } = useSWR(fetchUrl, fetcher, { suspense: true });
20+
const { data: filteredProjs } = useSWR(fetchUrl, fetcher);
2121
const filteredProjects = filteredProjs?.result;
2222

2323
const onClick = (catName) => setCategory(catName);

app/sections/project/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function ProjectsSection() {
1818
const btnRef = useRef(null);
1919
const isBtnInView = useInView(btnRef, { once: true });
2020

21-
const { data, error } = useSWR(url, fetcher, { suspense: true });
21+
const { data, error } = useSWR(url, fetcher);
2222
const projects = data?.result;
2323

2424
if (error && !data) {

components/AppMetadata.jsx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
const author = "Vasile Novatchii";
2+
const description =
3+
"A front-end developer from Moldova, who loves to develop beautiful websites, single page applications, customer relationship management or code from scratch using React and Next.js";
4+
const url = "https://vasile-novatchii.netlify.app";
5+
export const AppMetadata = {
6+
title: {
7+
default: `${author} | Portfolio`
8+
},
9+
description: description,
10+
icons: {
11+
icon: "/favicon.png"
12+
},
13+
keywords: [
14+
"Vasile Novatchii",
15+
"Portfolio website",
16+
"React Portfolio",
17+
"Next.js Portfolio",
18+
"Frontend Developer Portfolio",
19+
"Chakra Portfolio"
20+
],
21+
creator: author,
22+
authors: [{ name: author, url: url }],
23+
openGraph: {
24+
title: `${author} | Portfolio`,
25+
description: description,
26+
url: url,
27+
siteName: `${author} | Portfolio`,
28+
images: [
29+
{
30+
url: "https://vasile-novatchii.netlify.app/screenshot.webp",
31+
width: 800,
32+
height: 600,
33+
alt: "My personal portfolio website"
34+
},
35+
{
36+
url: "https://vasile-novatchii.netlify.app/screenshot.webp",
37+
width: 1800,
38+
height: 1600,
39+
alt: "My personal portfolio website"
40+
}
41+
],
42+
locale: "en-US",
43+
type: "website"
44+
}
45+
};

components/Head.jsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

components/Seo.jsx

Lines changed: 0 additions & 27 deletions
This file was deleted.

components/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export { AppHead } from "./Head";
1+
export { AppMetadata } from "./AppMetadata";
22
export { AppHeader } from "./Header";
33
export { AppFooter } from "./Footer";
44
export { Loader } from "./Loader";
@@ -8,5 +8,4 @@ export { Menu } from "./Menu";
88
export { ColorMode } from "./ColorMode";
99
export { MobileMenu } from "./MobileMenu";
1010
export { HeadingDivider } from "./HeadingDivider";
11-
export { Seo } from "./Seo";
1211
export { ScrollTop } from "./ScrollTop";

0 commit comments

Comments
 (0)