- {owner.avatar !== undefined && (
+ {header.avatar !== undefined && (
)}
-
{owner.fullName}
+
{header.fullName}
-
{owner.description}
+
{header.description}
{socials.map((social) => (
diff --git a/src/app/(landing)/page.tsx b/src/app/(landing)/page.tsx
index 5633c0e..167ed91 100644
--- a/src/app/(landing)/page.tsx
+++ b/src/app/(landing)/page.tsx
@@ -1,3 +1,4 @@
+import { Footer } from "../Footer";
import { Header } from "./Header";
import Landing from "@models/landing";
@@ -15,7 +16,8 @@ export default async function Page() {
return (
<>
-
+
+
>
);
}
diff --git a/src/app/Footer.tsx b/src/app/Footer.tsx
new file mode 100644
index 0000000..5a96225
--- /dev/null
+++ b/src/app/Footer.tsx
@@ -0,0 +1,12 @@
+import { Component } from "@typings/component";
+
+export const Footer: Component = () => {
+ return (
+
+ );
+};
diff --git a/src/app/ThemeSwitcher.tsx b/src/app/ThemeSwitcher.tsx
new file mode 100644
index 0000000..e213fd5
--- /dev/null
+++ b/src/app/ThemeSwitcher.tsx
@@ -0,0 +1,37 @@
+"use client";
+
+import { Switch } from "@nextui-org/react";
+import { Component } from "@typings/component";
+import { useTheme } from "next-themes";
+
+import { useEffect, useState } from "react";
+import { FiMoon, FiSun } from "react-icons/fi";
+
+export const ThemeSwitcher: Component = () => {
+ const [mounted, setMounted] = useState(false);
+ const { theme, setTheme } = useTheme();
+
+ useEffect(() => {
+ setMounted(true);
+ }, []);
+
+ if (!mounted) return null;
+
+ return (
+
+ The current theme is: {theme}
+ {
+ value ? setTheme("dark") : setTheme("light");
+ }}
+ startContent={}
+ endContent={}
+ >
+ Dark mode
+
+
+ );
+};
diff --git a/src/app/error.tsx b/src/app/error.tsx
index bf16918..46af61b 100644
--- a/src/app/error.tsx
+++ b/src/app/error.tsx
@@ -11,13 +11,15 @@ const MainErrorPage: ErrorPage = ({ error, reset }) => {
}, [error]);
return (
-
-
Something went loading the page!
-
{error.toString()}
+
-
reset()}>
- Try again
-
+
Something went loading the page!
+
{error.toString()}
+
+ reset()}>
+ Try again
+
+
);
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 9adb8b3..d3324eb 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -1,5 +1,6 @@
import { Metadata } from "next";
+import { Footer } from "./Footer";
import { Providers } from "./providers";
import "@styles/global.scss";
@@ -10,7 +11,7 @@ export default function RootLayout({
children: React.ReactNode;
}) {
return (
-
+
{children}
diff --git a/src/app/providers.tsx b/src/app/providers.tsx
index 279d01e..67f9ab1 100644
--- a/src/app/providers.tsx
+++ b/src/app/providers.tsx
@@ -1,7 +1,15 @@
"use client";
import { NextUIProvider } from "@nextui-org/react";
+import { Component } from "@typings/component";
+import { ThemeProvider as NextThemesProvider } from "next-themes";
-export function Providers({ children }: { children: React.ReactNode }) {
- return
{children};
-}
+export const Providers: Component = ({ children }) => {
+ return (
+
+
+ {children}
+
+
+ );
+};
diff --git a/src/models/footer.ts b/src/models/footer.ts
new file mode 100644
index 0000000..d38b3f5
--- /dev/null
+++ b/src/models/footer.ts
@@ -0,0 +1,7 @@
+import z from "zod";
+
+export const FooterPropsModel = z.object({});
+
+export type FooterProps = z.infer
;
+
+export default FooterProps;
diff --git a/src/models/owner.ts b/src/models/header.ts
similarity index 64%
rename from src/models/owner.ts
rename to src/models/header.ts
index 218e263..43cc38f 100644
--- a/src/models/owner.ts
+++ b/src/models/header.ts
@@ -1,6 +1,6 @@
import z from "zod";
-export const OwnerModel = z.object({
+export const HeaderPropsModel = z.object({
fullName: z.string(),
name: z.string(),
avatar: z.string().optional(),
@@ -12,6 +12,6 @@ export const OwnerModel = z.object({
})
});
-export type Owner = z.infer;
+export type HeaderProps = z.infer;
-export default Owner;
+export default HeaderProps;
diff --git a/src/models/landing.ts b/src/models/landing.ts
index 26a5af7..cc13e05 100644
--- a/src/models/landing.ts
+++ b/src/models/landing.ts
@@ -1,9 +1,11 @@
import z from "zod";
-import { OwnerModel } from "./owner";
+import { FooterPropsModel } from "./footer";
+import { HeaderPropsModel } from "./header";
export const LandingModel = z.object({
- owner: OwnerModel
+ header: HeaderPropsModel,
+ footer: FooterPropsModel
});
export type Landing = z.infer;
diff --git a/src/styles/global.scss b/src/styles/global.scss
index 919fb77..b5c61c9 100644
--- a/src/styles/global.scss
+++ b/src/styles/global.scss
@@ -1,23 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
-
-.container {
- display: flex;
- min-width: 100%;
- flex-direction: column;
- justify-content: center;
-
- padding-right: 1rem;
- padding-left: 1rem;
-
- @media screen and (width >=800px) {
- padding-right: 4rem;
- padding-left: 4rem;
- }
-
- @media screen and (width >=1200px) {
- padding-right: 16rem;
- padding-left: 16rem;
- }
-}
diff --git a/src/typings/component.ts b/src/typings/component.ts
index 3f353b4..0764147 100644
--- a/src/typings/component.ts
+++ b/src/typings/component.ts
@@ -1,3 +1,3 @@
import { FC, PropsWithChildren } from "react";
-export type Component = FC>;
+export type Component = FC>;
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index decb3e2..b02c323 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -1,3 +1 @@
-import path from "path";
-
export const dataDirLocation = process.env.DATA_DIR ?? "/app/data";