Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Update Navigation Design #430

Merged
merged 52 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
96f00cd
chore: add new types
TuukkaIkius Jan 23, 2024
dc3a564
chore: initial category stylecovnersion
TuukkaIkius Jan 23, 2024
2319216
chore: ad dicons
TuukkaIkius Jan 23, 2024
e385710
style: convert dropdownmenu
TuukkaIkius Jan 23, 2024
7f224e3
chore: add query for nav
TuukkaIkius Jan 23, 2024
846431b
style: dropdowsection conversion
TuukkaIkius Jan 23, 2024
2d26e22
styles: dropdownsubmenu conversion
TuukkaIkius Jan 23, 2024
37bc25c
style: convert dropdownmenuitem
TuukkaIkius Jan 23, 2024
76aad2e
style: convert category and menu
TuukkaIkius Jan 23, 2024
402ed9e
chore: img selector adjustment
TuukkaIkius Jan 23, 2024
aa3744e
chore: add nav data fetching
TuukkaIkius Jan 23, 2024
4e5c9e4
chore: correct logic
TuukkaIkius Jan 24, 2024
e8062fa
chore: add image domain to config
TuukkaIkius Jan 24, 2024
2e2e6b5
style: convert headercta
TuukkaIkius Jan 24, 2024
77828a0
style: convert header and menu
TuukkaIkius Jan 24, 2024
227863e
chore: remove structure file
TuukkaIkius Jan 24, 2024
b81b37c
style: display fixes to the category component
TuukkaIkius Jan 24, 2024
6cb3029
style: headercta styling adjustments
TuukkaIkius Jan 24, 2024
404e9e0
style: dropdownmenu styling
TuukkaIkius Jan 24, 2024
5e6f7a8
style: general dropdowns tyling fixes
TuukkaIkius Jan 24, 2024
f18bc3e
style: convert eventbanner
TuukkaIkius Jan 24, 2024
5351131
style: add border to header
TuukkaIkius Jan 24, 2024
71e99b7
style: dropdownsection width
TuukkaIkius Jan 24, 2024
f2b7d52
style: logo link display size adjustment
TuukkaIkius Jan 24, 2024
236daeb
chore: use logo from sanity
TuukkaIkius Jan 24, 2024
76506d1
style: headercta display fixes
TuukkaIkius Jan 24, 2024
10467c6
style: icon positon tuning
TuukkaIkius Jan 24, 2024
d509ba9
style: submenu link width adjustment
TuukkaIkius Jan 24, 2024
151f8d0
style: equalise horizontal padding
TuukkaIkius Jan 24, 2024
215f338
style: adjust dropdownmenu padding and border
TuukkaIkius Jan 24, 2024
b59a6d2
style: menu styling
TuukkaIkius Jan 24, 2024
6e97cbd
style: responsive image scaling
TuukkaIkius Jan 24, 2024
3cdeb9d
style: add min widths and extra margin
TuukkaIkius Jan 25, 2024
c9d1dcd
style: box sizing and min width to docs layout
TuukkaIkius Jan 25, 2024
1d2a647
style: correct cta width
TuukkaIkius Jan 25, 2024
0fef4af
chore: add missing passthrough value
TuukkaIkius Jan 25, 2024
0aadaa4
style: link hover effects
TuukkaIkius Jan 25, 2024
6a91985
style: sticky header on desktop
TuukkaIkius Jan 26, 2024
fdd3d25
Increase Icon size, center mobile text, run prettier
PietiKinnunen Jan 31, 2024
45351fb
Skip test
PietiKinnunen Jan 31, 2024
533c862
Include event banner sideButtons
PietiKinnunen Feb 1, 2024
86e7b5b
HeaderCTA styling, center eventbanner text
PietiKinnunen Feb 1, 2024
83840a7
Center link text if no description
PietiKinnunen Feb 1, 2024
d07d094
Remove unneeded DropdownMenuOverlay
PietiKinnunen Feb 1, 2024
acdab68
resized fonts and corrected styling on image
valzuxx Feb 3, 2024
f8c6b64
style: imageitem font size adjustment
TuukkaIkius Feb 5, 2024
790e51c
style: image size adjustment
TuukkaIkius Feb 5, 2024
5b6f9de
style: add bottompadding to dropdownmenu
TuukkaIkius Feb 5, 2024
c22f8ab
style: stick banner on desktop
TuukkaIkius Feb 5, 2024
4dcd89f
Render featured resources as column
PietiKinnunen Feb 5, 2024
84c8877
Silence type check error with navbar.json missing.
travelton Feb 5, 2024
df0eec8
Removed unused event URL check where CodeQL was failing.
travelton Feb 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
71 changes: 22 additions & 49 deletions components/DropdownMenu/DropdownMenu.module.css
Original file line number Diff line number Diff line change
@@ -1,57 +1,30 @@
.wrapper {
box-sizing: border-box;
overflow: hidden;
width: max-content;
padding-left: var(--m-3);
padding-right: var(--m-5);
padding-top: var(--m-2);
color: var(--color-black);
background: var(--color-white);
border-top: 1px solid #b3b3b3;
max-width: 100%;
box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.15);
@media (--sm-scr) {
width: 100%;
text-align: left;
border-top: none;
border-bottom: 1px solid var(--color-lighter-gray);
padding: 0;
box-shadow: none;
padding-top: var(--m-4);
}
}
.asRow {

background-color: #f8f7fd;
overflow: hidden;
max-width: 100%;
width:100%;
border-top: none;
border-bottom:1px solid #D2DBDF;
box-shadow: none;
box-sizing: border-box;
@media (--nav) {
background-color: white;
width: 100vw;
padding-left: 0;
padding-top: 0;
border-top: 1px solid #B3B3B3;
border-bottom: 1px solid #f0f2f4;
padding-bottom: 10px;
padding-left: 4.5%;
padding-right: 4.5%;
box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.15);
}

.menuTitle {
@media (--sm-scr) {
display: none;
}
@media (--md-scr) {
display: block;
align-items: left;
margin: 0 var(--m-3);
border-bottom: none;
border-color: var(--color-lightest-gray);
font-size: var(--fs-text-md);
line-height: var(--lh-xxl);
}
}

.body {
box-sizing: border-box;
box-sizing: unset;
display: block;
}

.withSubMenus {
display: flex;
@media (--sm-scr) {
flex-direction: column;
}
@media (--md-scr) {
padding-bottom: var(--m-6);
justify-content: flex-start;
@media (--nav) {
display:flex;
}
min-width:unset;
}
14 changes: 3 additions & 11 deletions components/DropdownMenu/DropdownMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
import styles from "./DropdownMenu.module.css";

export interface DropdownMenuProps {
title: string;
children: React.ReactNode;
displayAsRow?: boolean;
}

const DropdownMenu = ({ title, children, displayAsRow }: DropdownMenuProps) => {
const DropdownMenu = ({ children }: DropdownMenuProps) => {
return (
<div
className={`${styles.wrapper} ${displayAsRow && styles.asRow}`}
data-testid="mobile-dropdown"
>
{title && <h3 className={styles.menuTitle}>{title}</h3>}
<div className={`${styles.body} ${displayAsRow && styles.withSubMenus}`}>
{children}
</div>
<div className={styles.wrapper} data-testid="mobile-dropdown">
<div className={styles.body}>{children}</div>
</div>
);
};
Expand Down
151 changes: 125 additions & 26 deletions components/DropdownMenu/DropdownMenuItem.module.css
Original file line number Diff line number Diff line change
@@ -1,41 +1,140 @@
.wrapper {
display: block;
padding-top: 0.5px;
line-height: 21px;
text-align: left;
display: none;
@media (--nav) {
display: block;
}
@media (--lg-scr) {
display: initial;
}

max-width: min-content;
}

.styledLink {
cursor: pointer;
display: flex;
flex-direction: row;
align-items: center;
padding-bottom: 24px;
text-decoration: none;
color: var(--color-code);

&:focus,
&:hover {
max-width: unset;
@media (--nav) {
max-width: 250px;
align-items: flex-start;
}
@media (--lg-scr) {
max-width: none;
}
&:hover,
&:active,
&:focus {
color: var(--color-dark-purple);
background-color: none;
}
}

.imageLink {
border: 1px solid var(--color-lightest-gray);
width: 280px;
@media (--sm-scr) {
margin-left: var(--m-4);
margin-bottom: var(--m-2);
}
.center {
align-items: center;
}

.title {
display: block;
font-size: var(--fs-text-md);
font-weight: var(--fw-regular);
line-height: var(--lh-md);
padding-bottom: var(--m-2);
@media (--sm-scr) {
padding-left: var(--m-4);
.imageItem {
display: flex;
justify-content: flex-start;
align-items: flex-start;
flex-direction: column;
border: 1px solid #f0f2f4;
overflow: hidden;
width: 180px;
min-width: unset;
box-sizing: unset;
}
.imageBox {
width: 180px;
max-width: 180px;
height: auto;
flex-shrink: 0;
align-self: center;
position: relative;
@media (--lg-scr) {
flex-shrink: 1;
}
}

.imageBox img {
position: relative;
object-fit: cover;
width: 100%;
height: 100%;
}
.item {
margin-left: 8px;
@media (--nav) {
margin-left: 16px;
}
&.imageitemText {
margin-top: 12px;
margin-bottom: 12px;
@media (--nav) {
min-width: 40%;
max-width: 50%;
margin-right: 8px;
}
}
}
.itemTitle {
font-size: 14px;
line-height: 18px;
font-weight: 400;
margin: 0;
@media (--nav) {
font-size: 14px;
line-height: 20px;
font-weight: bold;
}
}
.description {
font-size: 14px;
line-height: 18px;
font-weight: 400;
margin-bottom: 0;
margin-top: 4px;
color: var(--color-gray);
display: none;
@media (--nav) {
display: initial;
}
}
.dateText {
font-size: 14px;
line-height: 18px;
font-weight: 400;
color: var(--color-gray);
}
.imageTitle {
padding: 0 0 var(--m-1) 10px;
font-size: 14px;
line-height: 18px;
font-weight: 400;
@media (--nav) {
font-size: 14px;
line-height: 20px;
font-weight: bold;
}
margin-top: 0;
}
.paragraph {
font-size: 14px;
line-height: 18px;
font-weight: bold;
color: var(--color-dark-purple);
}
.imageItemTitle {
font-size: 14px;
line-height: 18px;
font-weight: 400;

.asTitle {
font-weight: var(--fw-bold);
@media (--nav) {
font-size: 14px;
line-height: 20px;
font-weight: bold;
}
}
92 changes: 59 additions & 33 deletions components/DropdownMenu/DropdownMenuItem.tsx
Original file line number Diff line number Diff line change
@@ -1,47 +1,73 @@
import Link from "components/Link";
import Image from "next/image";
import styles from "./DropdownMenuItem.module.css";

import cn from "classnames";
export interface MenuItemProps {
title: string;
href?: string;
titleLink?: boolean;
isImageLink?: boolean;
imageSrc?: string;
itemType: string | "normal" | "image";
icon?: string | null;
title?: string | null;
description?: string | null;
link: string | null;
imageItem?: {
imageTitle?: string | null;
useMetadata: boolean | null;
customImage?: {
itemImage: string;
itemTitle: string;
imageCTA?: string;
imageDate?: string;
} | null;
};
children?: MenuItemProps[];
passthrough?: boolean;
}

const DropdownMenuItem = ({
itemType,
title,
href = "/",
passthrough = true, // If no value is sent, default to true
titleLink = false,
isImageLink = false,
imageSrc,
}: MenuItemProps) => {
return !isImageLink ? (
<Link href={href} passthrough={passthrough} className={styles.wrapper}>
<strong className={`${styles.title} ${titleLink && styles.asTitle}`}>
{title}
</strong>
</Link>
) : (
<Link href={href} passthrough={passthrough} className={styles.wrapper}>
<div className={styles.imageLink}>
<Image
src={imageSrc}
width={280}
height={139}
style={{ objectFit: "contain" }}
alt="featured resource"
sizes="25vw"
/>
<strong className={`${styles.title} ${styles.imageTitle}`}>
{title}
</strong>
link = "",
icon,
description,
imageItem,
itemAmount,
...props
}: MenuItemProps & { itemAmount?: number }) => {
const { imageTitle, customImage } = imageItem || {};
return itemType !== "image" ? (
<Link
className={cn(styles.styledLink, !description && styles.center)}
href={link}
passthrough
>
<Image src={icon || ""} width={35} height={35} alt="" />
<div className={styles.item}>
<p className={styles.itemTitle}>{title}</p>
{description && <p className={styles.description}>{description}</p>}
</div>
</Link>
) : (
<div className={styles.wrapper}>
{imageTitle && <h3 className={styles.imageTitle}>{imageTitle}</h3>}
<Link className={styles.styledLink} href={link}>
<div className={styles.imageItem}>
<div className={styles.imageBox}>
<Image
src={customImage?.itemImage || ""}
width={180}
height={100}
sizes="180px"
alt=""
/>
</div>
<div className={cn(styles.item, styles.imageItemText)} {...props}>
<p className={styles.imageItemTitle}>{customImage?.itemTitle}</p>
{customImage?.imageDate && (
<p className={styles.dateText}>{customImage?.imageDate}</p>
)}
<p className={styles.paragraph}>{customImage?.imageCTA}</p>
</div>
</div>
</Link>
</div>
);
};

Expand Down
Loading
Loading