diff --git a/renderer/atoms/newsAtom.tsx b/renderer/atoms/newsAtom.tsx new file mode 100644 index 0000000..6d85074 --- /dev/null +++ b/renderer/atoms/newsAtom.tsx @@ -0,0 +1,3 @@ +import { atomWithStorage } from "jotai/utils"; + +export const newsAtom = atomWithStorage("newsAtom", ""); diff --git a/renderer/components/NewsModal.tsx b/renderer/components/NewsModal.tsx new file mode 100644 index 0000000..10a1943 --- /dev/null +++ b/renderer/components/NewsModal.tsx @@ -0,0 +1,39 @@ +import React from "react"; + +export const NewsModal = ({ show, setShow }) => { + return ( + +
+ +
+ +
+ +
+
+ ); +}; diff --git a/renderer/pages/index.tsx b/renderer/pages/index.tsx index 2661ab9..862a8a2 100644 --- a/renderer/pages/index.tsx +++ b/renderer/pages/index.tsx @@ -30,6 +30,7 @@ import { DoubleUpscaylPayload, ImageUpscaylPayload, } from "@common/types/types"; +import { newsAtom } from "@/atoms/newsAtom"; const Home = () => { // LOCAL STATES @@ -67,13 +68,16 @@ const Home = () => { dontShowCloudModalAtom ); const noImageProcessing = useAtomValue(noImageProcessingAtom); + const [news, setNews] = useAtom(newsAtom); const { logit } = useLog(); // EFFECTS useEffect(() => { setVersion(navigator?.userAgent?.match(/Upscayl\/([\d\.]+\d+)/)[1]); - + if (!news) { + setNews(navigator?.userAgent?.match(/Upscayl\/([\d\.]+\d+)/)[1]); + } const handleErrors = (data: string) => { if (data.includes("invalid gpu")) { alert( @@ -226,6 +230,10 @@ const Home = () => { } }, []); + useEffect(() => { + // Fetch news + }, []); + // CHECK IF OUTPUT FOLDER IS REMEMBERED useEffect(() => { const rememberOutputFolder = localStorage.getItem("rememberOutputFolder"); diff --git a/renderer/public/news.json b/renderer/public/news.json new file mode 100644 index 0000000..e69de29