Skip to content

Commit

Permalink
fix signin redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhao99 committed Jan 13, 2025
1 parent f87166b commit a63b820
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions query-connector/src/app/query/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useEffect, useRef, useState } from "react";
import { usePathname } from "next/navigation";
import { Button, Icon } from "@trussworks/react-uswds";
import { Icon } from "@trussworks/react-uswds";
import styles from "./header.module.scss";
import { metadata } from "@/app/constants";
import classNames from "classnames";
Expand Down Expand Up @@ -47,7 +47,7 @@ export default function HeaderComponent() {
setShowMenu(!showMenu);
};
const isProduction = process.env.NODE_ENV === "production";
const backLink = "/";
const landingPage = "/";

return (
<div className={styles.headerContainer}>
Expand All @@ -63,7 +63,7 @@ export default function HeaderComponent() {
<em className="usa-logo__text text-base-lightest-important">
<a
className="font-mono-lg text-base-lightest-important font-weight-normal-important"
href={backLink}
href={landingPage}
title={metadata.title}
>
{metadata.title}
Expand All @@ -78,8 +78,8 @@ export default function HeaderComponent() {
"flex-align-center",
)}
>
{/* TODO: Rework show/hide rules based on actual auth status */}
{!isLoggedIn && !LOGGED_IN_PATHS.includes(path) && (
{/* TODO: Enable this once we can show/hide rules based on actual auth status */}
{/* {!isLoggedIn && !LOGGED_IN_PATHS.includes(path) && (
<Button
className={styles.signinButton}
type="button"
Expand All @@ -89,7 +89,7 @@ export default function HeaderComponent() {
>
Sign in
</Button>
)}
)} */}
{LOGGED_IN_PATHS.includes(path) && (
<button
onClick={toggleMenuDropdown}
Expand Down Expand Up @@ -120,18 +120,26 @@ export default function HeaderComponent() {
id="dropdown-menu"
className={`usa-nav__submenu ${styles.menuDropdown}`}
>
{!isProduction && (
{/* TODO: Enable this once we can show/hide rules based on actual auth status */}
{/* {isProduction && ( */}
<>
<li className={styles.subMenuItem}>
<a className={styles.menuItem} href={"/queryBuilding"}>
My queries
</a>
</li>
)}
<li className={styles.subMenuItem}>
<a className={styles.menuItem} href={backLink}>
Log out
</a>
</li>
<li className={styles.subMenuItem}>
<a className={styles.menuItem} href={"/fhir-servers"}>
FHIR Servers
</a>
</li>
<li className={styles.subMenuItem}>
<a className={styles.menuItem} href={landingPage}>
Log out
</a>
</li>
</>
{/* )} */}
</ul>
</div>
)}
Expand Down

0 comments on commit a63b820

Please sign in to comment.