From 38e70b1ec14ffd5cc2849333b11dcdda7ff59f3a Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Thu, 22 Sep 2022 11:12:04 +0100 Subject: [PATCH] information banner from api with date range --- .env.local | 2 +- actions/index.js | 12 + components/breadcrumbs.js | 35 ++- components/case/summary.js | 9 +- components/noticebanner.js | 65 ++++ components/search/searchresults.js | 24 ++ package.json | 2 +- pages/api/auth/[...nextauth].js | 1 + pages/api/endpoint/getwatchedcases_api.js | 1 + pages/api/notices/index.js | 17 ++ pages/index.js | 30 +- pages/myportal/advancedsearch.js | 45 ++- pages/myportal/representation.js | 33 ++ pages/myportal/searchresults.js | 21 +- public/assets/images/information.svg | 20 ++ store/store.js | 2 +- styles/sass/welshgov/_application.scss | 348 +++++++++++++++++----- 17 files changed, 548 insertions(+), 119 deletions(-) create mode 100644 components/noticebanner.js create mode 100644 pages/api/notices/index.js create mode 100644 public/assets/images/information.svg diff --git a/.env.local b/.env.local index af89d049..fdfc86cd 100644 --- a/.env.local +++ b/.env.local @@ -44,7 +44,7 @@ RELAYPATH = "dev-pedw-hc" GOOGLE_TAG_MANAGER = GTM-T78CBC3 -SHOWLOGIN = "true" +SHOWLOGIN = "false" SHOWREPRESENTATIONS = false SHOWFILEUPLOAD = "false" SHOWMAPS = "true" diff --git a/actions/index.js b/actions/index.js index 11f3cf87..f1d38b78 100644 --- a/actions/index.js +++ b/actions/index.js @@ -1298,3 +1298,15 @@ export const sendEmail = async ( console.log("this serror", error); }); }; + +export const getNotice = () => { + return axios + .get(BASE_URL + "/api/notices") + .then((res) => { + //console.log("//////////----", res.data); + return res.data; + }) + .catch((error) => { + console.log("this serror", error); + }); +}; diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js index c7f681a5..bf0c1be6 100644 --- a/components/breadcrumbs.js +++ b/components/breadcrumbs.js @@ -5,6 +5,7 @@ import { useState } from "react"; import { useRouter } from "next/router"; import useTranslation from "next-translate/useTranslation"; import LoadingOverlay from "react-loading-overlay"; +import { getSession, useSession } from "next-auth/react"; const Breadcrumbs = (props) => { const { courseContent, slug, currentView } = props; @@ -45,6 +46,9 @@ const Breadcrumbs = (props) => { // ? setShowSpinnerState(false) // : setShowSpinnerState(true); // }; + + const { data: session, status } = useSession(); + return ( <>