updated drop downs

This commit is contained in:
2021-10-29 16:29:04 +01:00
parent 73d98d2097
commit c1448b6ff6
16 changed files with 204 additions and 101 deletions
+24 -7
View File
@@ -5,6 +5,7 @@ import useTranslation from "next-translate/useTranslation";
import Banner from "../components/banner";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import { setLogout } from "../store/accountDetails/action";
import _ from "lodash";
const Header = (props) => {
let { t, lang } = useTranslation();
@@ -45,6 +46,8 @@ const Header = (props) => {
} else {
domainSwitch = process.env.I18N_DOMAIN;
}
console.log(_.isEmpty(router.query));
return (
<header
className="govuk-header "
@@ -220,13 +223,27 @@ const Header = (props) => {
<Link
href={
locale == "en"
? router.query.q != null
? router.pathname +
"?q=" +
router.query.q
: router.pathname
: router.query.q != null
? router.asPath + "?q=" + router.query.q
? _.isEmpty(router.query)
? router.pathname
: router.pathname +
"?" +
Object.keys(router.query)
.map(
(key) =>
key +
"=" +
router.query[key]
)
.join("&")
: _.isEmpty(router.query) != false
? router.asPath +
"?" +
Object.keys(router.query)
.map(
(key) =>
key + "=" + router.query[key]
)
.join("&")
: router.asPath
}
locale={locale == "en" ? "cy" : "en"}