From 9a9f4e61609af7f19cc8d2f47d761ae061571397 Mon Sep 17 00:00:00 2001
From: "amkayondo01@gmail.com"
Date: Tue, 21 May 2024 00:21:48 +0300
Subject: [PATCH] chore: Add lazy loading for images in layout components
This commit adds the `Head` component from the `next/head` package to the layout components in the `2023` and `2024` apps. The `Head` component is used to add a `link` tag that preconnects to the Google Fonts API, improving the performance of font loading. Additionally, the commit updates the `next.config.js` file to fix a bug related to rewrites for the `/2024` route. The missing rewrites were causing incorrect redirection, and this commit adds the necessary rewrites to ensure proper redirection.
Fixes #129
---
apps/2023/app/layout.tsx | 41 ++++++------------
apps/2024/app/layout.tsx | 43 ++++++++++---------
apps/2024/next.config.js | 10 ++---
.../components/shared/2023/layout/footer.tsx | 6 +--
4 files changed, 44 insertions(+), 56 deletions(-)
diff --git a/apps/2023/app/layout.tsx b/apps/2023/app/layout.tsx
index c10aa03..da1813e 100644
--- a/apps/2023/app/layout.tsx
+++ b/apps/2023/app/layout.tsx
@@ -3,6 +3,7 @@ import Navbar from "@repo/ui/components/shared/2023/layout/navbar";
import "@repo/ui/globals.css";
import type { Metadata } from "next";
import { Inter } from "next/font/google";
+import Head from "next/head";
const inter = Inter({ subsets: ["latin"] });
@@ -18,34 +19,20 @@ export default function RootLayout({
}): JSX.Element {
return (
- {/* */}
-
-
-
-
-
-
-
+
{children}
diff --git a/apps/2024/app/layout.tsx b/apps/2024/app/layout.tsx
index 2fa3922..9de7f0b 100644
--- a/apps/2024/app/layout.tsx
+++ b/apps/2024/app/layout.tsx
@@ -1,8 +1,9 @@
import "@repo/ui/globals.css";
import type { Metadata } from "next";
import { Inter } from "next/font/google";
-import Navbar from '@repo/ui/components/shared/2024/layout/Navbar'
+import Navbar from "@repo/ui/components/shared/2024/layout/Navbar";
import Footer from "@repo/ui/components/shared/2023/layout/footer";
+import Head from "next/head";
const inter = Inter({ subsets: ["latin"] });
@@ -19,34 +20,34 @@ export default function RootLayout({
}): JSX.Element {
return (
-
-
+
+
-
-
-
+
+
+
+
-
+
{children}
diff --git a/apps/2024/next.config.js b/apps/2024/next.config.js
index 2f521d0..8f5d3f0 100644
--- a/apps/2024/next.config.js
+++ b/apps/2024/next.config.js
@@ -8,29 +8,29 @@ module.exports = {
ignoreBuildErrors: true,
},
// fix the rewrites bug
- async rewrites() {
+async rewrites() {
return [
{
source: "/2023/:path*",
- destination: `${process.env.NODE_ENV
+ destination: `${(process.env.NODE_ENV || "development")
=== "development" ? "http://localhost:3002" : "https://ug.pycon.org"
}/:path*`,
},
{
source: "/2023",
- destination: `${process.env.NODE_ENV
+ destination: `${(process.env.NODE_ENV || "development")
=== "development" ? "http://localhost:3002" : "https://ug.pycon.org"
}/:path*`,
},
{
source: "/2024/:path*",
- destination: `${process.env.NODE_ENV
+ destination: `${(process.env.NODE_ENV || "development")
=== "development" ? "http://localhost:3001" : "https://ug.pycon.org"
}/:path*`,
},
{
source: "/:path*",
- destination: `${process.env.NODE_ENV
+ destination: `${(process.env.NODE_ENV || "development")
=== "development" ? "http://localhost:3001" : "https://ug.pycon.org"
}/:path*`,
},
diff --git a/packages/ui/src/components/shared/2023/layout/footer.tsx b/packages/ui/src/components/shared/2023/layout/footer.tsx
index 6ef87ab..1fa0226 100644
--- a/packages/ui/src/components/shared/2023/layout/footer.tsx
+++ b/packages/ui/src/components/shared/2023/layout/footer.tsx
@@ -54,8 +54,8 @@ export default function Footer() {
Health and Safety Guidelines
-
- Our PyCon Uganda Editions:
+
+
Our PyCon Uganda Editions:
-
PyCon Uganda 2024
@@ -64,7 +64,7 @@ export default function Footer() {
PyCon Uganda 2023
-
+