Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Header and Footer responsive styles #110

Merged
merged 51 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
4062f9d
Add Sign In button to header; add /signin page with basic form; redir…
katyasoup Oct 28, 2024
291fa80
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Oct 28, 2024
b9ee4b2
Add gear icon for menu dropdown; go to landing page on Log Out click
katyasoup Oct 29, 2024
b7a5923
prettier formatting
katyasoup Oct 29, 2024
7f30eaf
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Oct 29, 2024
0906224
tweak icon spacing
katyasoup Oct 29, 2024
52db5c9
PR feedback
katyasoup Oct 29, 2024
a7fe7ec
Merge branch 'main' into kcd/77-login-page
katyasoup Oct 29, 2024
853d054
Merge branch 'main' into kcd/77-login-page
katyasoup Oct 31, 2024
4713065
Set back link in header
DanPaseltiner Oct 31, 2024
39fd4bf
Merge branch 'kcd/77-login-page' of https://github.com/CDCgov/dibbs-q…
DanPaseltiner Oct 31, 2024
da1c832
Merge branch 'main' into kcd/77-login-page
katyasoup Oct 31, 2024
59b0865
PR design feedback - error state, some responsive sizing, hide My Que…
katyasoup Oct 31, 2024
d128a1b
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Oct 31, 2024
984b5db
redirect page
fzhao99 Oct 29, 2024
e819b07
import
fzhao99 Oct 29, 2024
b6548bb
import
fzhao99 Oct 29, 2024
20346a4
header styling tweaks
fzhao99 Oct 29, 2024
158edeb
remove log
fzhao99 Oct 31, 2024
488342e
empty state query page
fzhao99 Oct 31, 2024
a7272fb
rehouse files
fzhao99 Oct 31, 2024
9410781
lint
fzhao99 Oct 31, 2024
1027163
lint pt 2
fzhao99 Oct 31, 2024
ed70798
export the thing correctly
fzhao99 Oct 31, 2024
7a8b61a
font styles
fzhao99 Oct 31, 2024
c2cc330
change FC styling
fzhao99 Oct 31, 2024
7dc7ded
don't export
fzhao99 Oct 31, 2024
40c12d9
widen button
fzhao99 Oct 31, 2024
da78d37
remove extra margin
fzhao99 Oct 31, 2024
4f8a027
fix results view styles
fzhao99 Oct 31, 2024
a7264f2
fix header and footer styling
fzhao99 Nov 1, 2024
478baa2
footer
fzhao99 Nov 1, 2024
581104f
footer
fzhao99 Nov 1, 2024
fd49f8f
katie suggestions
fzhao99 Nov 1, 2024
cc07860
merge main
fzhao99 Nov 1, 2024
dacccd9
fix spacing
fzhao99 Nov 1, 2024
39ab386
responsive header styles
katyasoup Nov 1, 2024
3ccf368
responsive footer styles
katyasoup Nov 1, 2024
9d58fa6
spacing changes
mikang Nov 1, 2024
3b7e7f8
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Nov 1, 2024
6d5aa4f
persist dropdown styles at smaller widths
katyasoup Nov 1, 2024
d032275
click to hide menu
katyasoup Nov 1, 2024
9753e61
Merge branch 'bob/que-30-set-up-routing-to-get-to-query-building' int…
katyasoup Nov 1, 2024
0acecc7
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Nov 1, 2024
cf72c76
Merge branch 'main' into kcd/que-51-update-header-footer-responsive-s…
katyasoup Nov 4, 2024
1637a3f
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Nov 4, 2024
6be1d05
don't wrap button text
katyasoup Nov 4, 2024
ae404f7
remove deprecated styles
katyasoup Nov 4, 2024
fd6d7c4
fix sign in page height (#111)
fzhao99 Nov 4, 2024
79994bd
Merge branch 'main' into kcd/que-51-update-header-footer-responsive-s…
katyasoup Nov 4, 2024
e0102c9
Merge branch 'main' into kcd/que-51-update-header-footer-responsive-s…
katyasoup Nov 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions query-connector/src/app/query/components/footer/footer.module.scss
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
@use "../../../../styles/_variables" as *;

.footerContainer {
height: 5rem;
height: $footer-content-height;
display: flex;
align-items: center;
justify-content: space-between;
justify-content: flex-start;
background-color: $primary-darker;
}

.footerContainer > div {
flex-grow: 1;
overflow: scroll !important;
}

.cdcLogoContainer {
display: flex;
align-items: center;
gap: 0.5rem;
margin-right: 0.5rem;
}

.contactUsContainer {
.cdcFooterTextContainer {
display: flex;
justify-content: end;
justify-content: space-between;
width: 100%;

p {
white-space: nowrap;
margin: 0;
}
}

@media (max-width: 64em) {
.cdcFooterTextContainer {
flex-direction: column;
justify-content: flex-start;
}
}
22 changes: 10 additions & 12 deletions query-connector/src/app/query/components/footer/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,21 @@ export default function FooterComponent() {
return (
<footer className={classNames("usa-footer", styles.footerContainer)}>
<div className={styles.cdcLogoContainer}>
<div>
<Image
src="/tefca-viewer/CDC_logo.png"
alt="CDC logo"
width={62}
height={36}
className="usa-footer__logo-img"
/>
</div>
<Image
src="/tefca-viewer/CDC_logo.png"
alt="CDC logo"
width={62}
height={36}
className="usa-footer__logo-img"
/>
</div>
<div className={styles.cdcFooterTextContainer}>
<div>
<p className="text-base-lightest-important">
Centers for Disease Control and Prevention
</p>
</div>
</div>
<div className={styles.contactUsContainer}>
<div className="width-fit-content">
<div>
<p className="text-base-lightest-important">
For more information about this solution, send us an email at{" "}
<a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
@use "../../../../styles/_variables" as *;

.dataUsagePolicyButton {
cursor: pointer;
background: none !important;
border: none !important;
color: white !important;
padding: 0px !important;
font: inherit !important;
margin-right: 1rem !important;
margin: 0 0.5rem !important;
text-align: left !important;
}

.signinButton {
padding: 0.5rem 1.25rem !important;
margin: 0 !important;
cursor: pointer;
background: none !important;
border: 2px solid white !important;
border-radius: 4px !important;
color: white !important;
font: inherit !important;
white-space: nowrap;
}

.menuButton {
Expand All @@ -41,7 +46,7 @@
border-radius: 4px !important;
padding: 0.5rem !important;
background: #ffffff !important;
margin: 3.5rem 3rem 0rem 0rem !important;
margin: 3.5rem 2rem 0rem 0rem !important;
width: 10rem !important;
box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.16);
}
Expand All @@ -51,16 +56,29 @@
text-decoration: none !important;
padding: 0.5rem 1rem !important;
cursor: pointer;
width: 100%;
}

.menuItem:hover {
text-decoration: none !important;
}

.subMenuItem {
display: flex;
}

.headerContentContainer {
display: flex;
align-items: center !important;
margin: 0 !important;
padding: 0 !important;
height: 4.5rem;
height: $header-content-height;
max-width: 100% !important;
}

@media (max-width: 63.99em) {
.menuDropdown {
z-index: 400 !important;
position: absolute;
}
}
30 changes: 24 additions & 6 deletions query-connector/src/app/query/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useEffect, useRef, useState } from "react";
import { Modal, ModalButton } from "../../designSystem/Modal";
import { useRouter, usePathname } from "next/navigation";
import { Button, Icon, ModalRef } from "@trussworks/react-uswds";
import styles from "./header.module.css";
import styles from "./header.module.scss";
import { metadata } from "@/app/constants";
import classNames from "classnames";
/**
Expand All @@ -13,12 +13,30 @@ import classNames from "classnames";
*/
export default function HeaderComponent() {
const modalRef = useRef<ModalRef>(null);
const menuRef = useRef<HTMLDivElement>(null);

const [isClient, setIsClient] = useState(false);
const [showMenu, setShowMenu] = useState(false);

const outsideMenuClick = (event: MouseEvent) => {
if (
showMenu &&
menuRef.current &&
!menuRef.current.contains(event.target as Node)
) {
setShowMenu(false);
}
};

useEffect(() => {
setIsClient(true);
}, []);

document.addEventListener("mousedown", outsideMenuClick);

return () => {
document.removeEventListener("mousedown", outsideMenuClick);
};
}, [showMenu]);

const router = useRouter();
const path = usePathname();
Expand All @@ -43,7 +61,7 @@ export default function HeaderComponent() {
)}
>
<div className={classNames("display-flex", "flex-align-center")}>
<div className="usa-logo">
<div className="usa-logo" style={{ marginLeft: "0" }}>
<em className="usa-logo__text text-base-lightest-important">
<a
className="font-mono-lg text-base-lightest-important font-weight-normal-important"
Expand Down Expand Up @@ -115,19 +133,19 @@ export default function HeaderComponent() {
)}

{showMenu && (
<div className={styles.menuDropdownContainer}>
<div ref={menuRef} className={styles.menuDropdownContainer}>
<ul
id="dropdown-menu"
className={`usa-nav__submenu ${styles.menuDropdown}`}
>
{!isProduction && (
<li className={`usa-nav__submenu-item`}>
<li className={styles.subMenuItem}>
<a className={styles.menuItem} href={"/queryBuilding"}>
My queries
</a>
</li>
)}
<li className={`usa-nav__submenu-item`}>
<li className={styles.subMenuItem}>
<a className={styles.menuItem} href={backLink}>
Log out
</a>
Expand Down
3 changes: 2 additions & 1 deletion query-connector/src/app/signin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Fieldset, Icon, Label, TextInput } from "@trussworks/react-uswds";
import { useRouter } from "next/navigation";
import Image from "next/image";
import styles from "./signinPage.module.scss";
import classNames from "classnames";

/**
* The sign-in page for Query Connector.
Expand Down Expand Up @@ -53,7 +54,7 @@ export default function SigninPage() {
};

return (
<div className="display-flex">
<div className={classNames("display-flex", styles.signInContainer)}>
<div className={`${styles[`column-left`]} ${styles.column}`}>
<Image
alt="Graphic illustrating what TEFCA is"
Expand Down
7 changes: 7 additions & 0 deletions query-connector/src/app/signin/signinPage.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
@use "../../styles/_variables" as *;

.signInContainer {
position: absolute;
top: $header-content-height;
bottom: $footer-content-height;
width: 100%;
}

.column {
width: 100%;
display: flex;
Expand Down
3 changes: 3 additions & 0 deletions query-connector/src/styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ $background-hover-color: #d9e8f680;
$serif-font: family("heading");
$sans-serif-font: "Public Sans Web", family("body");
$mono-font: "Consolas", family("mono");

$header-content-height: 4.5rem;
$footer-content-height: 5rem;
Loading