diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..30de70f
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "editor.acceptSuggestionOnEnter": "on"
+}
\ No newline at end of file
diff --git a/app/context/store.tsx b/app/context/store.tsx
index c4f8af3..74324f6 100644
--- a/app/context/store.tsx
+++ b/app/context/store.tsx
@@ -1,5 +1,5 @@
"use client";
-import { createContext, useContext, useState, ReactNode } from "react";
+import { createContext, useContext, useState, ReactNode, useEffect } from "react";
import { AllPropsFromLayout, Theme, themeContext } from "@/types";
const ThemeContext = createContext({
@@ -10,8 +10,19 @@ const ThemeContext = createContext({
export const ThemeContextProvider = ({ children }: AllPropsFromLayout) => {
const [theme, setTheme] = useState("dark");
+ useEffect(() => {
+ // get the theme from localStorage on initial render
+ const storedTheme = localStorage.getItem("theme");
+ if (storedTheme) {
+ setTheme(storedTheme);
+ }
+ }, []);
+
const handleThemeSwitch = () => {
- setTheme(theme === "dark" ? "light" : "dark");
+ // toggle the theme and store it in localStorage
+ const newTheme = theme === "dark" ? "light" : "dark";
+ setTheme(newTheme);
+ localStorage.setItem("theme", newTheme);
};
return (
diff --git a/app/layout.tsx b/app/layout.tsx
index fe46873..14f9e49 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -4,6 +4,9 @@ import Navbar from "@/components/Navbar";
import { ThemeContextProvider } from "./context/store";
import NavigationLinks from "@/components/NavigationLinks";
import Footer from "@/components/Footer";
+import Announcement from "@/components/Announcement";
+
+
const inter = Inter({ subsets: ["latin"] });
@@ -13,11 +16,13 @@ export const metadata = {
"A website where essential tools, prompts, and datasets are thoughtfully curated and combined in one place for your convenience.",
};
+
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
+
return (
@@ -54,16 +59,21 @@ export default function RootLayout({
-
-
- {children}
+
+
+
+
+ {children}
+
+
);
}
+
diff --git a/app/page.tsx b/app/page.tsx
index 7a67186..ccea6ce 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -3,6 +3,7 @@ import { useEffect } from "react";
import { useThemeContext } from "./context/store";
import Image from "next/image";
import PoweredByVercel from "../public/powered-by-vercel.svg";
+import Undraw from "../public/undraw.svg";
export default function Home() {
const { theme } = useThemeContext();
@@ -29,7 +30,7 @@ export default function Home() {
-
+
diff --git a/components/Announcement.tsx b/components/Announcement.tsx
new file mode 100644
index 0000000..542eede
--- /dev/null
+++ b/components/Announcement.tsx
@@ -0,0 +1,37 @@
+"use client";
+import { useState } from "react";
+import { RxCross2 } from "react-icons/rx";
+
+
+async function getCurrentVersion() {
+ const response = await fetch(
+ "https://api.github.com/repos/PriyansuMaurya/AI-Fusion/releases/latest"
+ );
+ const data = await response.json();
+ return data.tag_name;
+ // return v1.2.4-beta
+}
+
+
+export default function Announcement() {
+ const [announcement, setAnnouncement] = useState(true);
+
+ return (
+ announcement &&
+
+
+
{
+ [
+ <>Check what has changed in the
{getCurrentVersion()} >,
+ <>⭐️ If you like AI Fusion, give it a star on
GitHub >
+ ][Math.floor(Math.random() * 2)]
+ }
+
+ {/*
*/}
+
+
setAnnouncement(false)}>
+
+
+ )
+}
+
diff --git a/public/undraw.png b/public/undraw.png
deleted file mode 100755
index 46cec29..0000000
Binary files a/public/undraw.png and /dev/null differ
diff --git a/public/undraw.svg b/public/undraw.svg
new file mode 100644
index 0000000..9c0e81f
--- /dev/null
+++ b/public/undraw.svg
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+