Skip to content

Commit

Permalink
Fixed main menu and some teaser displays
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Oct 17, 2024
1 parent ed4ef68 commit 8587601
Show file tree
Hide file tree
Showing 8 changed files with 224 additions and 159 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
},
"dependencies": {
"@heroicons/react": "^2.1.5",
"@mui/base": "5.0.0-beta.58",
"@mui/base": "5.0.0-beta.59",
"@next/third-parties": "^14.2.15",
"@tailwindcss/container-queries": "^0.1.1",
"@types/node": "^22.7.5",
"@types/node": "^22.7.6",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"algoliasearch": "^5.7.0",
"algoliasearch": "^5.9.0",
"autoprefixer": "^10.4.20",
"clsx": "^2.1.1",
"decanter": "^7.3.0",
Expand All @@ -38,14 +38,14 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-focus-lock": "^2.13.2",
"react-instantsearch": "^7.13.2",
"react-instantsearch-nextjs": "^0.3.12",
"react-instantsearch": "^7.13.4",
"react-instantsearch-nextjs": "^0.3.14",
"react-slick": "^0.30.2",
"react-super-responsive-table": "^6.0.0",
"react-tiny-oembed": "^1.1.0",
"sharp": "^0.33.5",
"tailwind-merge": "^2.5.4",
"tailwindcss": "^3.4.13",
"tailwindcss": "^3.4.14",
"typescript": "^5.6.3",
"usehooks-ts": "^3.1.0"
},
Expand Down
8 changes: 4 additions & 4 deletions src/components/menu/main-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const MenuItem = ({id, url, title, children, level}: MenuItemProps) => {
id={id}
level={level}
className={twMerge(
"relative m-0 grid grid-cols-4-1 flex-wrap items-center justify-between border-b border-cool-grey py-2 first:border-t last:border-0 lg:relative lg:flex lg:border-black-20 lg:py-0 lg:pr-5 last:lg:pr-0",
clsx({"first:border-t-0 lg:border-b-0": level === 0, "lg:first:border-t-0": level === 1})
"relative m-0 grid grid-cols-10 items-center justify-between border-b border-cool-grey py-2 first:border-t last:border-0 lg:relative lg:border-black-20 lg:py-0 lg:pr-5 last:lg:pr-0",
clsx({"first:border-t-0 lg:flex lg:border-b-0": level === 0, "lg:first:border-t-0": level === 1})
)}
link={
<>
Expand All @@ -44,7 +44,7 @@ const MenuItem = ({id, url, title, children, level}: MenuItemProps) => {
id={id}
href={url || "#"}
className={twMerge(
"flex-grow border-l-[6px] border-transparent py-5 text-white no-underline transition-all hocus:text-white hocus-visible:border-white hocus-visible:underline lg:text-digital-red lg:hocus:text-black",
"col-span-9 flex-grow border-l-[6px] border-transparent py-5 text-white no-underline transition-all hocus:text-white hocus-visible:border-white hocus-visible:underline lg:text-digital-red lg:hocus:text-black",
clsx({
"ml-5 pl-10 aria-current-page:border-digital-red data-intrail:border-transparent lg:ml-0 lg:border-b-[6px] lg:border-l-0 lg:pb-2 lg:pl-0 lg:aria-current-page:border-black lg:data-intrail:border-foggy-dark":
level === 0,
Expand All @@ -64,7 +64,7 @@ const MenuItem = ({id, url, title, children, level}: MenuItemProps) => {
{children.length > 0 && (
<ul
className={twMerge(
"list-unstyled col-span-2 w-full min-w-[300px] px-0 lg:bg-white",
"list-unstyled col-span-10 w-full min-w-[300px] px-0 lg:bg-white",
clsx({
"lg:absolute lg:left-0 lg:right-full lg:top-full lg:shadow-2xl": level === 0,
"lg:top-0": level !== 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const StanfordNewsCard = ({node, headingLevel, ...props}: Props) => {

{node.suNewsDek && <div>{node.suNewsDek}</div>}

{topics && <div>{topics.map(topic => topic.name).join(", ")}</div>}
{!!topics.length && <div>{topics.map(topic => topic.name).join(", ")}</div>}
</ImageCard>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const ChildTeaser = async ({path}: {path: Maybe<string> | undefined}) => {
}

const RelatedPolicy = async ({path}: {path: string}) => {
const queryResponse = await getEntityFromPath<NodeStanfordPolicy>(path)
const queryResponse = await getEntityFromPath<NodeStanfordPolicy>(path, false, true)
if (!queryResponse.entity) return
return <StanfordPolicyCard node={queryResponse.entity} headingLevel="h3" />
}
Expand Down
20 changes: 10 additions & 10 deletions src/lib/gql/__generated__/drupal.d.ts

Large diffs are not rendered by default.

19 changes: 16 additions & 3 deletions src/lib/gql/__generated__/queries.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions src/lib/gql/fragments-nodes.drupal.gql
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,22 @@ fragment FragmentNodeStanfordCourseTeaser on NodeStanfordCourse {
...FragmentTermInterface
}
suCourseAcademicYear
suCourseCode
suCourseQuarters {
...FragmentTermInterface
}
suCourseInstructors
body {
processed
}
}

fragment FragmentNodeStanfordEventTeaser on NodeStanfordEvent {
...FragmentNodeInterface
suEventAltLoc
suEventSubheadline
suEventDek
suEventAltLoc
suEventLocation {
...FragmentAddressType
}
Expand Down Expand Up @@ -353,7 +362,6 @@ fragment FragmentNodeStanfordNewsTeaser on NodeStanfordNews {
}
suNewsSource {
url
title
}
}

Expand All @@ -364,7 +372,12 @@ fragment FragmentNodeStanfordPageTeaser on NodeStanfordPage {
...FragmentMediaImage
}
suPageBanner {
...FragmentParagraphStanfordBanner
... on ParagraphStanfordBanner {
suBannerImage {
...FragmentMediaImage
}
}
...FragmentParagraphStanfordPageTitleBanner
}
}

Expand Down
Loading

0 comments on commit 8587601

Please sign in to comment.