diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 6dadbc06..349ebe30 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -5,7 +5,7 @@ on: - cron: "0 0 * * *" jobs: - fetch-news: + npm-packages: runs-on: ubuntu-latest defaults: run: @@ -33,8 +33,8 @@ jobs: - name: Move packages.json run: |- - git add news.json - git mv -f news.json ../../api/packages.json + git add npm-packages.json + git mv -f npm-packages.json ../../api/packages.json - name: Commit and push if changed run: |- diff --git a/ui/index.html b/ui/index.html index 39f30bd8..da4c9cc6 100644 --- a/ui/index.html +++ b/ui/index.html @@ -42,21 +42,7 @@ content="https://www.binarytree.dev/bt.jpg" /> - - - diff --git a/ui/src/pages/Footer/CookieConsent/components/CookieConsentText/index.tsx b/ui/src/pages/Footer/CookieConsent/components/CookieConsentText/index.tsx new file mode 100644 index 00000000..5292d421 --- /dev/null +++ b/ui/src/pages/Footer/CookieConsent/components/CookieConsentText/index.tsx @@ -0,0 +1,14 @@ +import { Link } from "react-router-dom"; + +const CookieConsentText = () => ( + <> + This website uses cookies to enhance the user experience. If you are + interested to know about our cookie policy then{" "} + + check out + {" "} + here + +); + +export default CookieConsentText; diff --git a/ui/src/pages/Footer/CookieConsent/index.tsx b/ui/src/pages/Footer/CookieConsent/index.tsx index c99a9311..f2d4ae1f 100644 --- a/ui/src/pages/Footer/CookieConsent/index.tsx +++ b/ui/src/pages/Footer/CookieConsent/index.tsx @@ -3,29 +3,31 @@ import CookiConsent, { Cookies, getCookieConsentValue, } from "react-cookie-consent"; -import { Link } from "react-router-dom"; import ReactGA from "react-ga4"; import usePageTitle from "components/Hoc/withPageTitle/utils/hooks"; +import { + BUTTON_STYLES, + COOKIE_CONSENT_STYLES, + GOOGLE_ANALYTICS_COOKIES, + GOOGLE_ANALYTICS_ID, + HIT_TYPE, +} from "./utils/constants"; +import CookieConsentText from "./components/CookieConsentText"; const CookieConsent: React.FC = () => { const { title, url } = usePageTitle(); const handleAcceptCookie = () => { - const GOOGLE_ANALYTICS_ID = "G-9K8N22TZZS"; - if (GOOGLE_ANALYTICS_ID) { - ReactGA.initialize(GOOGLE_ANALYTICS_ID); - ReactGA.send({ - hitType: "pageview", - page: url, - title, - }); - } + ReactGA.initialize(GOOGLE_ANALYTICS_ID); + ReactGA.send({ + hitType: HIT_TYPE, + page: url, + title, + }); }; const handleDeclineCookie = () => { - Cookies.remove("_ga"); - Cookies.remove("_gat"); - Cookies.remove("_gid"); + GOOGLE_ANALYTICS_COOKIES.forEach((cookie) => Cookies.remove(cookie)); }; useEffect(() => { @@ -34,40 +36,21 @@ const CookieConsent: React.FC = () => { handleAcceptCookie(); } }, []); + return ( -
- This website uses cookies to enhance the user experience. if you - are interested to know about our cookie policy then{" "} - - check out - {" "} - here -
+
); }; diff --git a/ui/src/pages/Footer/CookieConsent/utils/constants.ts b/ui/src/pages/Footer/CookieConsent/utils/constants.ts new file mode 100644 index 00000000..a3a40ebd --- /dev/null +++ b/ui/src/pages/Footer/CookieConsent/utils/constants.ts @@ -0,0 +1,24 @@ +const GOOGLE_ANALYTICS_ID = "G-9K8N22TZZS"; +const GOOGLE_ANALYTICS_COOKIES = ["_ga", "_gat", "_gid"]; +const HIT_TYPE = "pageview"; + +const COOKIE_CONSENT_STYLES = { + maxWidth: "350px", + margin: "20px", + borderRadius: "10px", + fontSize: "17px", +}; + +const BUTTON_STYLES = { + padding: "8px 20px", + fontSize: "17px", + borderRadius: "2px", +}; + +export { + GOOGLE_ANALYTICS_ID, + GOOGLE_ANALYTICS_COOKIES, + HIT_TYPE, + COOKIE_CONSENT_STYLES, + BUTTON_STYLES, +}; diff --git a/ui/src/pages/PrivacyPolicy/PrivacyPolicy.module.scss b/ui/src/pages/Footer/PrivacyPolicy/PrivacyPolicy.module.scss similarity index 100% rename from ui/src/pages/PrivacyPolicy/PrivacyPolicy.module.scss rename to ui/src/pages/Footer/PrivacyPolicy/PrivacyPolicy.module.scss diff --git a/ui/src/pages/PrivacyPolicy/index.tsx b/ui/src/pages/Footer/PrivacyPolicy/index.tsx similarity index 100% rename from ui/src/pages/PrivacyPolicy/index.tsx rename to ui/src/pages/Footer/PrivacyPolicy/index.tsx diff --git a/ui/src/pages/Terms/Terms.module.scss b/ui/src/pages/Footer/Terms/Terms.module.scss similarity index 100% rename from ui/src/pages/Terms/Terms.module.scss rename to ui/src/pages/Footer/Terms/Terms.module.scss diff --git a/ui/src/pages/Terms/index.tsx b/ui/src/pages/Footer/Terms/index.tsx similarity index 100% rename from ui/src/pages/Terms/index.tsx rename to ui/src/pages/Footer/Terms/index.tsx diff --git a/ui/src/pages/Routes/utils/constant.tsx b/ui/src/pages/Routes/utils/constant.tsx index 8d4ce91d..5ef8e90b 100644 --- a/ui/src/pages/Routes/utils/constant.tsx +++ b/ui/src/pages/Routes/utils/constant.tsx @@ -29,6 +29,7 @@ import { Pixel, Platform, Plugin, + PrivacyPolicy, QRcode, ShadesAndTints, Sorting, @@ -42,7 +43,6 @@ import { UiUx, YouTube, } from "pages/pages"; -import PrivacyPolicy from "pages/PrivacyPolicy"; export const routes: Route[] = [ { @@ -314,6 +314,7 @@ export const routes: Route[] = [ title: "About", description: "All the juicy details about us.", component: About, + isFeature: false, }, { id: "feedback", @@ -321,6 +322,7 @@ export const routes: Route[] = [ title: "Feedback", description: "We're all ears for your cheers or jeers.", component: Feedback, + isFeature: false, }, { id: "terms", @@ -328,6 +330,7 @@ export const routes: Route[] = [ title: "", description: "", component: Terms, + isFeature: false, }, { id: "privacypolicy", @@ -335,6 +338,7 @@ export const routes: Route[] = [ title: "", description: "", component: PrivacyPolicy, + isFeature: false, }, { id: "pagenotfound", @@ -342,6 +346,7 @@ export const routes: Route[] = [ title: "Page Not Found", description: "", component: PageNotFound, + isFeature: false, }, ]; diff --git a/ui/src/pages/pages.ts b/ui/src/pages/pages.ts index 164afedc..292a240c 100644 --- a/ui/src/pages/pages.ts +++ b/ui/src/pages/pages.ts @@ -5,8 +5,8 @@ const News = lazy(() => import("pages/Newsfeed")); const About = lazy(() => import("pages/About")); const Feedback = lazy(() => import("pages/Feedback")); const PageNotFound = lazy(() => import("pages/PageNotFound")); -const Terms = lazy(() => import("pages/Terms")); -const PrivacyPolicy = lazy(() => import("pages/PrivacyPolicy")); +const Terms = lazy(() => import("pages/Footer/Terms")); +const PrivacyPolicy = lazy(() => import("pages/Footer/PrivacyPolicy")); const ColorPicker = lazy(() => import("pages/Colors/ColorPicker")); const ShadesAndTints = lazy(() => import("pages/Colors/ShadesAndTints"));