breacrumb change & form styling
This commit is contained in:
+82
-16
@@ -8,8 +8,10 @@ import { connect } from "react-redux";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { setCurrentView } from "../store/currentView/action";
|
||||
|
||||
import { setCurrentSection } from "../store/appealType/action";
|
||||
|
||||
const Breadcrumbs = (props) => {
|
||||
const { currentView, setCurrentView } = props;
|
||||
const { currentView, setCurrentView, setCurrentSection } = props;
|
||||
const router = useRouter();
|
||||
let { t } = useTranslation();
|
||||
|
||||
@@ -24,14 +26,18 @@ const Breadcrumbs = (props) => {
|
||||
>
|
||||
<div className="govuk-breadcrumbs ">
|
||||
<ol className="govuk-breadcrumbs__list">
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={"/"}
|
||||
className="govuk-breadcrumbs__link"
|
||||
>
|
||||
{t("common:service-name-breadcrumb")}
|
||||
</Link>
|
||||
</li>
|
||||
{router.pathname != "/myportal/[appealtypes]" &&
|
||||
router.pathname != "/newappeal/[appealtypes]" && (
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={"/"}
|
||||
className="govuk-breadcrumbs__link"
|
||||
>
|
||||
{t("common:service-name-breadcrumb")}
|
||||
</Link>
|
||||
</li>
|
||||
)}
|
||||
|
||||
{router.pathname == "/myportal" && (
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{t("myportal:page-title")}
|
||||
@@ -244,7 +250,7 @@ const Breadcrumbs = (props) => {
|
||||
)}
|
||||
{router.pathname == "/newappeal" && (
|
||||
<>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{/* <li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
@@ -260,12 +266,12 @@ const Breadcrumbs = (props) => {
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{t("newappeal:page-title")}
|
||||
</li>
|
||||
</li> */}
|
||||
</>
|
||||
)}
|
||||
{router.pathname == "/newappeal/[appealtypes]" && (
|
||||
<>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{/* <li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
@@ -281,12 +287,41 @@ const Breadcrumbs = (props) => {
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{t("newappeal:page-title")}
|
||||
</li>
|
||||
</li> */}
|
||||
|
||||
{props.appealType.currentSection > 1 &&
|
||||
(props.appealType.currentSection == 9999 ? (
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={"/"}
|
||||
className="govuk-breadcrumbs__link"
|
||||
>
|
||||
{t(
|
||||
"common:service-name-breadcrumb"
|
||||
)}
|
||||
</Link>
|
||||
</li>
|
||||
) : (
|
||||
<li className="govuk-breadcrumbs__link-item">
|
||||
<a
|
||||
className="govuk-breadcrumbs__link"
|
||||
href="#"
|
||||
onClick={() =>
|
||||
setCurrentSection(
|
||||
props.appealType
|
||||
.currentSection - 1
|
||||
)
|
||||
}
|
||||
>
|
||||
{t("common:back-link")}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
{router.pathname == "/myportal/[appealtypes]" && (
|
||||
<>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{/* <li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
@@ -304,8 +339,36 @@ const Breadcrumbs = (props) => {
|
||||
{t("newappeal:page-title")}
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{props.formTitle}
|
||||
</li>
|
||||
{t("common:back-link")} {props.formTitle}
|
||||
</li> */}
|
||||
{props.appealType.currentSection > 1 &&
|
||||
(props.appealType.currentSection == 9999 ? (
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<Link
|
||||
href={"/"}
|
||||
className="govuk-breadcrumbs__link"
|
||||
>
|
||||
{t(
|
||||
"common:service-name-breadcrumb"
|
||||
)}
|
||||
</Link>
|
||||
</li>
|
||||
) : (
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<a
|
||||
className="govuk-breadcrumbs__link"
|
||||
href="#"
|
||||
onClick={() =>
|
||||
setCurrentSection(
|
||||
props.appealType
|
||||
.currentSection - 1
|
||||
)
|
||||
}
|
||||
>
|
||||
{t("common:back-link")}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
{router.pathname == "/newappeal/selectappeal" && (
|
||||
@@ -942,6 +1005,9 @@ const mapDispatchToProps = (dispatch) => {
|
||||
setCurrentView: (currentView) => {
|
||||
dispatch(setCurrentView(currentView));
|
||||
},
|
||||
setCurrentSection: (currentSection) => {
|
||||
dispatch(setCurrentSection(currentSection));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user