From 3f5b29be87416cb82fa61f64a2ee3d8a3832ac53 Mon Sep 17 00:00:00 2001 From: Tamal Das Date: Thu, 17 Oct 2024 10:36:57 +0530 Subject: [PATCH] fix: footer changes & remove sw (#1270) --- jsconfig.json | 31 ++++ src/components/private/landing/Landing.jsx | 4 +- src/components/shared/footer/Footer.jsx | 78 ++++++++--- src/components/shared/footer/Footer.scss | 8 +- src/pages/Test.jsx | 11 ++ src/utils/footerLinksConfig.js | 47 +++++++ src/utils/routesConfig.jsx | 2 + vite.config.js | 156 +++++++-------------- 8 files changed, 203 insertions(+), 134 deletions(-) create mode 100644 jsconfig.json create mode 100644 src/pages/Test.jsx create mode 100644 src/utils/footerLinksConfig.js diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 00000000..c1a14608 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@components/*": [ + "src/components/*" + ], + "@hooks/*": [ + "src/hooks/*" + ], + "@pages/*": [ + "src/pages/*" + ], + "@redux/*": [ + "src/redux/*" + ], + "@service/*": [ + "src/service/*" + ], + "@utils/*": [ + "src/utils/*" + ], + "@styles/*": [ + "src/styles/*" + ], + "@/*": [ + "src/*" + ] + } + } +} \ No newline at end of file diff --git a/src/components/private/landing/Landing.jsx b/src/components/private/landing/Landing.jsx index 73ef4b55..959d59e9 100644 --- a/src/components/private/landing/Landing.jsx +++ b/src/components/private/landing/Landing.jsx @@ -27,12 +27,12 @@ const Landing = () => { <>

We connect NGOs,

- Charities and you + Charities and you.

) : (

- We connect NGOs, charities and you + We connect NGOs, charities and you.

)} diff --git a/src/components/shared/footer/Footer.jsx b/src/components/shared/footer/Footer.jsx index d0362332..eb152ce6 100644 --- a/src/components/shared/footer/Footer.jsx +++ b/src/components/shared/footer/Footer.jsx @@ -1,12 +1,17 @@ -import React from "react"; +import { footerLinks } from "@utils/footerLinksConfig"; import { FaGithub, FaLinkedinIn, FaXTwitter } from "react-icons/fa6"; -import { SiGmail } from "react-icons/si"; import { Link } from "react-router-dom"; import "react-toastify/dist/ReactToastify.css"; import brand from "../../../assets/pictures/Navbar/MilanNavBrand.svg"; import "./Footer.scss"; const Footer = () => { + const icons = { + FaLinkedinIn: FaLinkedinIn, + FaXTwitter: FaXTwitter, + FaGithub: FaGithub, + }; + return ( <> diff --git a/src/components/shared/footer/Footer.scss b/src/components/shared/footer/Footer.scss index 7abbc04d..3d0a5f1f 100644 --- a/src/components/shared/footer/Footer.scss +++ b/src/components/shared/footer/Footer.scss @@ -79,7 +79,8 @@ footer { @media screen and (max-width: 500px) { display: flex; justify-content: center; - gap: 0.5rem; + gap: 1rem; + flex-wrap: wrap; a { color: rgba(255, 255, 255, 0.555); font-size: 15px; @@ -96,13 +97,14 @@ footer { .rightside { display: flex; gap: 1rem; - color: white; + z-index: 90; - svg { + a > svg { width: 1.4rem; height: 1.4rem; cursor: pointer; + color: white !important; &:hover { color: var(--primary); diff --git a/src/pages/Test.jsx b/src/pages/Test.jsx new file mode 100644 index 00000000..0d747eb9 --- /dev/null +++ b/src/pages/Test.jsx @@ -0,0 +1,11 @@ +import React, { useEffect } from "react"; + +const Test = () => { + useEffect(() => { + window.location.href = "https://www.google.com"; + }, []); + + return
Test
; +}; + +export default Test; diff --git a/src/utils/footerLinksConfig.js b/src/utils/footerLinksConfig.js new file mode 100644 index 00000000..547aaba9 --- /dev/null +++ b/src/utils/footerLinksConfig.js @@ -0,0 +1,47 @@ +// src/config/footerLinksConfig.js + +export const footerLinks = { + quickStarts: [ + { name: "Trending Events", path: "/trending" }, + { name: "NGOs near you", path: "/clubs" }, + { name: "Login / Signup", path: "/auth/login" }, + { name: "Events ", path: "/events" }, + ], + resources: [ + { name: "GitHub", path: "https://github.com/ngoworldcommunity/NGOWorld" }, + { + name: "Setup Frontend", + path: "https://github.com/ngoworldcommunity/NGOWorld/blob/main/docs/FrontendSetup.md", + }, + { + name: "Setup Backend", + path: "https://github.com/ngoworldcommunity/NGOWorld-Backend/blob/main/docs/BackendSetup.md", + }, + { + name: "Docker Resources", + path: "https://github.com/ngoworldcommunity/NGOWorld/blob/main/docs/DockerSetup.md", + }, + ], + policies: [ + { name: "Terms of Use", path: "/terms" }, + { name: "Privacy Policy", path: "/privacy" }, + { name: "Cookies Policy", path: "/cookies" }, + ], + social: [ + { + name: "LinkedIn", + path: "https://www.linkedin.com/company/ngoworld", + icon: "FaLinkedinIn", + }, + { + name: "X", + path: "https://x.com/ngoworlddotorg", + icon: "FaXTwitter", + }, + { + name: "GitHub", + path: "https://github.com/ngoworldcommunity", + icon: "FaGithub", + }, + ], +}; diff --git a/src/utils/routesConfig.jsx b/src/utils/routesConfig.jsx index 90db1e12..e0f3e42f 100644 --- a/src/utils/routesConfig.jsx +++ b/src/utils/routesConfig.jsx @@ -1,4 +1,5 @@ import React from "react"; +import Test from "../pages/Test"; import Trending from "../pages/Trending"; import { Clubs, @@ -23,6 +24,7 @@ const routesConfig = [ { path: "/events", element: }, { path: "/shop", element: }, { path: "/trending", element: }, + { path: "/test", element: }, { path: "*", element: }, ]; diff --git a/vite.config.js b/vite.config.js index 242cb401..fd4b8c04 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,4 +1,5 @@ import react from "@vitejs/plugin-react"; +import path from "path"; import { defineConfig } from "vite"; import { VitePWA } from "vite-plugin-pwa"; import svgr from "vite-plugin-svgr"; @@ -9,12 +10,11 @@ export default defineConfig({ react(), VitePWA({ registerType: "autoUpdate", - includeAssets: ["favicon.svg", "robots.txt"], - injectRegister: "auto", + selfDestroying: true, manifest: { short_name: "NgoWorld", name: "NgoWorld", - start_url: "./", + start_url: ".", display: "standalone", theme_color: "#000000", background_color: "#ffffff", @@ -23,121 +23,59 @@ export default defineConfig({ src: "assets/icons/icon-48x48.png", sizes: "48x48", type: "image/png", - purpose: "maskable any", - }, - { - src: "assets/icons/icon-72x72.png", - sizes: "72x72", - type: "image/png", - purpose: "maskable any", - }, - { - src: "assets/icons/icon-96x96.png", - sizes: "96x96", - type: "image/png", - purpose: "maskable any", - }, - { - src: "assets/icons/icon-128x128.png", - sizes: "128x128", - type: "image/png", - purpose: "maskable any", - }, - { - src: "assets/icons/icon-144x144.png", - sizes: "144x144", - type: "image/png", - purpose: "maskable any", - }, - { - src: "assets/icons/icon-152x152.png", - sizes: "152x152", - type: "image/png", - purpose: "maskable any", - }, - { - src: "assets/icons/icon-192x192.png", - sizes: "192x192", - type: "image/png", - purpose: "maskable any", + purpose: "any maskable", }, + ], + }, + + workbox: { + cleanupOutdatedCaches: true, + skipWaiting: true, + clientsClaim: true, + + runtimeCaching: [ { - src: "assets/icons/icon-384x384.png", - sizes: "384x384", - type: "image/png", - purpose: "maskable any", + urlPattern: new RegExp( + "^https://fonts.(?:googleapis|gstatic).com/(.*)", + ), + handler: "CacheFirst", + options: { + cacheName: "google-fonts", + expiration: { + maxEntries: 30, + }, + cacheableResponse: { + statuses: [0, 200], + }, + }, }, + { - src: "assets/icons/icon-512x512.png", - sizes: "512x512", - type: "image/png", - purpose: "maskable any", + urlPattern: /\.(?:png|gif|jpg|jpeg|svg|webp)$/, + handler: "CacheFirst", + options: { + cacheName: "images", + expiration: { + maxEntries: 60, + }, + }, }, ], }, - // workbox: { - // cleanupOutdatedCaches: true, - // skipWaiting: true, - // clientsClaim: true, - - // runtimeCaching: [ - // { - // // Caches Google Fonts with a Cache First strategy. - // urlPattern: new RegExp( - // "^https://fonts.(?:googleapis|gstatic).com/(.*)", - // ), - // handler: "CacheFirst", - // options: { - // cacheName: "google-fonts", - // expiration: { - // maxEntries: 30, - // }, - // cacheableResponse: { - // statuses: [0, 200], - // }, - // }, - // }, - // { - // // Caches images with a Cache First strategy. - // urlPattern: /\.(?:png|gif|jpg|jpeg|svg|webp)$/, - // handler: "CacheFirst", - // options: { - // cacheName: "images", - // expiration: { - // maxEntries: 60, - // }, - // }, - // }, - // { - // urlPattern: new RegExp("^https://api.ngoworld.org/(.*)"), - // handler: "StaleWhileRevalidate", - // options: { - // cacheName: "api", - // expiration: { - // maxAgeSeconds: 86400, - // }, - // cacheableResponse: { - // statuses: [0, 200, 201], - // }, - // }, - // }, - // { - // urlPattern: new RegExp("^http://localhost:5000/(.*)"), - // handler: "StaleWhileRevalidate", - // options: { - // cacheName: "api-dev", - // expiration: { - // maxAgeSeconds: 86400, - // }, - // cacheableResponse: { - // statuses: [0, 200, 201], - // }, - // }, - // }, - // ], - // }, }), ], + resolve: { + alias: { + "@components": path.resolve(__dirname, "./src/components"), + "@hooks": path.resolve(__dirname, "./src/hooks"), + "@pages": path.resolve(__dirname, "./src/pages"), + "@redux": path.resolve(__dirname, "./src/redux"), + "@service": path.resolve(__dirname, "./src/service"), + "@utils": path.resolve(__dirname, "./src/utils"), + "@styles": path.resolve(__dirname, "./src/styles"), + "@": path.resolve(__dirname, "./src"), + }, + }, server: { host: true, strictPort: true,