added service account header removed duplicate sign in button
This commit is contained in:
@@ -42,6 +42,11 @@ const Header = (props) => {
|
||||
"/auth/verify-request",
|
||||
"/auth/signin",
|
||||
"/auth/error",
|
||||
"/myportal",
|
||||
"/myportal/[appealtypes]",
|
||||
"/newappeal",
|
||||
"/myportal/dnsapplications",
|
||||
"/myportal/dnsdetails",
|
||||
];
|
||||
const hasContactLink = [
|
||||
"/dns/application-process",
|
||||
@@ -91,7 +96,7 @@ const Header = (props) => {
|
||||
</div>
|
||||
|
||||
<div className="languageSwitch">
|
||||
<div className="mobileNav">
|
||||
{/* <div className="mobileNav">
|
||||
<div className="mobileMenu">
|
||||
<input
|
||||
type="radio"
|
||||
@@ -190,8 +195,8 @@ const Header = (props) => {
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="fullNav">
|
||||
</div> */}
|
||||
<div className="fullNavs">
|
||||
{hasContactLink.includes(router.pathname) == true ? (
|
||||
<Link
|
||||
href="/dns/contact-us"
|
||||
|
||||
@@ -13,6 +13,7 @@ import MyCases from "./myportal/mycases";
|
||||
import MyRepresentations from "./myportal/myrepresentations";
|
||||
import SearchCases from "./myportal/searchcases";
|
||||
import WatchedCases from "./myportal/watchedcases";
|
||||
import ServiceBanner from "./myportal/servicebanner";
|
||||
|
||||
const MyPortal = (props) => {
|
||||
const { showFileUpload, showLoginCheck } = props;
|
||||
@@ -41,7 +42,7 @@ const MyPortal = (props) => {
|
||||
return (
|
||||
<>
|
||||
<main className="" id="main-content" role="main">
|
||||
<div className="servicebanner myportal govuk-!-margin-bottom-4">
|
||||
{/* <div className="servicebanner myportal govuk-!-margin-bottom-4">
|
||||
<h1>
|
||||
<img
|
||||
src={
|
||||
@@ -88,13 +89,14 @@ const MyPortal = (props) => {
|
||||
onClick={() => {
|
||||
handleLogout();
|
||||
}}
|
||||
className="govuk-header__link govuk-!-margin-right-3"
|
||||
className="govuk-header__link "
|
||||
>
|
||||
{t("common:signout-label")}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> */}
|
||||
<ServiceBanner props={props} />
|
||||
{isLPA && (
|
||||
<div>
|
||||
<h2 className="heading-small card-heading">
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import router from "next/router";
|
||||
import Link from "next/link";
|
||||
|
||||
const ServiceBanner = (props) => {
|
||||
props = props.props;
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
const signInButton = () => {
|
||||
router.push(
|
||||
`${
|
||||
router.locale == "cy" ? "/awd/mewngofnodi" : "/auth/signin"
|
||||
}?callbackUrl=${encodeURIComponent(
|
||||
window.location.href
|
||||
)}&error=EmailSignin`
|
||||
);
|
||||
};
|
||||
return (
|
||||
// <div className="servicebanner">
|
||||
// <h1>
|
||||
// <img
|
||||
// className="govuk-!-margin-top-4"
|
||||
// src={
|
||||
// router.locale == "cy"
|
||||
// ? "/assets/images/planning-casework-cy.svg"
|
||||
// : "/assets/images/planning-casework-en.svg"
|
||||
// }
|
||||
// alt="Planning casework"
|
||||
// />
|
||||
// </h1>
|
||||
// <div className="serviceBanner_userDetails">
|
||||
// <button
|
||||
// onClick={() => signInButton()}
|
||||
// className="govuk-header__link "
|
||||
// >
|
||||
// {t("common:signin-label")}
|
||||
// </button>
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div className="servicebanner myportal govuk-!-margin-bottom-4">
|
||||
<h1>
|
||||
<img
|
||||
src={
|
||||
router.locale == "cy"
|
||||
? "/assets/images/planning-casework-cy.svg"
|
||||
: "/assets/images/planning-casework-en.svg"
|
||||
}
|
||||
alt={router.locale == "cy" ? "Fy mhorth" : "My Portal"}
|
||||
/>
|
||||
</h1>
|
||||
|
||||
<div className="serviceBanner_userDetails">
|
||||
<img
|
||||
className="user_logo"
|
||||
src="/assets/images/user.svg"
|
||||
alt={router.locale == "cy" ? "Defnyddiwr" : "User"}
|
||||
/>{" "}
|
||||
<div className="serviceBanner_userDetails_name">
|
||||
<Link
|
||||
href="/account/personaldetails"
|
||||
className="govuk-button-secondary"
|
||||
>
|
||||
{props.accountDetails.accountDetails.firstname}{" "}
|
||||
{props.accountDetails.accountDetails.lastname}
|
||||
{" - "}
|
||||
{
|
||||
props.accountDetails.accountDetails[
|
||||
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
}
|
||||
</Link>
|
||||
</div>
|
||||
<div>
|
||||
<Link
|
||||
href={router.locale == "cy" ? "/allgofnodi" : "/logout"}
|
||||
onClick={() => {
|
||||
handleLogout();
|
||||
}}
|
||||
className="govuk-header__link "
|
||||
>
|
||||
{t("common:signout-label")}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ServiceBanner;
|
||||
@@ -1,8 +1,19 @@
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import router from "next/router";
|
||||
import Link from "next/link";
|
||||
|
||||
export default function ServiceBanner() {
|
||||
export default function ServiceBanner(props) {
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
const signInButton = () => {
|
||||
router.push(
|
||||
`${
|
||||
router.locale == "cy" ? "/awd/mewngofnodi" : "/auth/signin"
|
||||
}?callbackUrl=${encodeURIComponent(
|
||||
window.location.href
|
||||
)}&error=EmailSignin`
|
||||
);
|
||||
};
|
||||
return (
|
||||
<div className="servicebanner">
|
||||
<h1>
|
||||
@@ -16,6 +27,16 @@ export default function ServiceBanner() {
|
||||
alt="Planning casework"
|
||||
/>
|
||||
</h1>
|
||||
{props.noSignin != true && (
|
||||
<div className="serviceBanner_userDetails">
|
||||
<button
|
||||
onClick={() => signInButton()}
|
||||
className="govuk-header__link "
|
||||
>
|
||||
{t("common:signin-label")}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user