From 73d0b1d3cf557bca1068c1829e45029bcbc49641 Mon Sep 17 00:00:00 2001 From: Saket Aryan <94069182+whysosaket@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:45:43 +0530 Subject: [PATCH 1/2] Update NewsletterPage.jsx --- my-app/src/pages/NewsletterPage.jsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/my-app/src/pages/NewsletterPage.jsx b/my-app/src/pages/NewsletterPage.jsx index 165473c..4cf8843 100644 --- a/my-app/src/pages/NewsletterPage.jsx +++ b/my-app/src/pages/NewsletterPage.jsx @@ -6,6 +6,7 @@ import "react-pdf/dist/esm/Page/AnnotationLayer.css"; import "react-pdf/dist/esm/Page/TextLayer.css"; import { IoChevronBack, IoChevronForward } from "react-icons/io5"; import { API_URL } from "../lib/constants"; +import { FaRegEye } from "react-icons/fa"; import "../styles/newsletter.css"; import Newsletter from "../components/Newsletter"; @@ -22,6 +23,7 @@ const NewsletterPage = () => { const [containerRef, setContainerRef] = useState(null); const [containerWidth, setContainerWidth] = useState(); const [loading, setLoading] = useState(true); + const [views, setViews] = useState(0); // Memoize the options object to prevent unnecessary reloads const options = useMemo( @@ -75,6 +77,7 @@ const NewsletterPage = () => { const data = await response.json(); if(data.success){ + setViews(data.newsletter.views); const pdfResponse = await fetch(data.newsletter.link); const blob = await pdfResponse.blob(); const fileUrl = URL.createObjectURL(blob); @@ -112,7 +115,7 @@ const NewsletterPage = () => {

Newsletters

-
+
} + { + !loading&&file&& +
+ + {views} +
+ } {!loading&&file&&
From bad62c11fde39de72bf424c66e0f362a0fe6cdf2 Mon Sep 17 00:00:00 2001 From: Saket Aryan <94069182+whysosaket@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:48:13 +0530 Subject: [PATCH 2/2] Rollback Feature Until Release --- my-app/src/App.jsx | 4 ++-- my-app/src/data.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/my-app/src/App.jsx b/my-app/src/App.jsx index 02cc783..1856ad5 100644 --- a/my-app/src/App.jsx +++ b/my-app/src/App.jsx @@ -8,7 +8,7 @@ import Events from "./pages/Events"; import Base from "./layouts/Base"; import Subscribe from "./components/Subscribe"; import { useState } from "react"; -import NewsletterPage from "./pages/NewsletterPage"; +// import NewsletterPage from "./pages/NewsletterPage"; export default function App() { const [isVisible, setIsVisible] = useState(false); @@ -28,7 +28,7 @@ export default function App() { } /> } /> } /> - } /> + {/* } /> */} } /> diff --git a/my-app/src/data.js b/my-app/src/data.js index 8b123ef..1dd8c39 100644 --- a/my-app/src/data.js +++ b/my-app/src/data.js @@ -2,7 +2,8 @@ const navigation = [ { name: "Home", to: "/" }, { name: "Community", to: "/community" }, { name: "Events", to: "/events" }, - { name: "Newsletter", to: "/newsletter" }, + // { name: "Newsletter", to: "/newsletter" }, { name: "About us", to: "about-us" }, + { name: "Contact us", to: "/contact-us" }, ]; export { navigation };