Skip to content

Commit

Permalink
Fixed book list loading
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed May 8, 2024
1 parent 8299109 commit fb5873e
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 23 deletions.
13 changes: 11 additions & 2 deletions src/components/paragraphs/sup-carousel/sup-carousel-paragraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,20 @@ const SupCarouselParagraph = ({paragraph, isTopBanner, ...props}: Props) => {
}

const Slide = ({slideParagraph}: { slideParagraph: ParagraphSupCarouselSlide }) => {
const bgImage = slideParagraph.supSlideBgImage.mediaImage;
const slideTitle = slideParagraph.supSlideTitle || slideParagraph.supSlideBook?.title
const image = slideParagraph.supSupImage?.mediaImage || slideParagraph.supSlideBook?.supBookImage?.mediaImage;
const image = slideParagraph.supSlideImage?.mediaImage || slideParagraph.supSlideBook?.supBookImage?.mediaImage;

return (
<article aria-labelledby={slideParagraph.id} className="centered-container">
<article aria-labelledby={slideParagraph.id} className="relative centered-container">
<Image
className="object-cover"
src={bgImage.url}
alt={""}
fill
sizes="100vw"
/>

<div className="xl:flex gap-10 xl:w-2/3 mx-auto">
{image &&
<div className="relative aspect-[9/16] w-1/3">
Expand Down
28 changes: 15 additions & 13 deletions src/lib/gql/__generated__/drupal.d.ts

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions src/lib/gql/__generated__/queries.ts

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

6 changes: 5 additions & 1 deletion src/lib/gql/entity-queries.drupal.gql
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ query AllNodes($first: Int = 1000, $nodeSupBooks: Cursor, $nodeStanfordCourses:
query Books($first: Int = 1000, $after: Cursor) {
nodeSupBooks(first: $first, after: $after, sortKey: CREATED_AT) {
nodes {
...FragmentNodeSupBookTeaser
...FragmentNodeInterface
supBookAuthors {
...FragmentNameType
}
supBookWorkIdNumber
}
pageInfo {
...FragmentPageInfo
Expand Down
6 changes: 4 additions & 2 deletions src/lib/gql/fragments-paragraph.drupal.gql
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ fragment FragmentParagraphSupCarouselSlide on ParagraphSupCarouselSlide {
supSlideSubtitle
supSlideTitle
supSlideTitleSize
supSupImage {
supSlideImage {
...FragmentMediaImage
}
supSlideBgImage {
...FragmentMediaImage
}
}
Expand Down Expand Up @@ -271,7 +274,6 @@ fragment FragmentParagraphUnion on ParagraphUnion {
...FragmentParagraphStanfordLayout
...FragmentParagraphSupCarousel
...FragmentParagraphSupFileList
...FragmentParagraphSupCarouselSlide
...FragmentParagraphSupAuthorList
...FragmentParagraphSupSearchForm
...FragmentParagraphSupBlogTeaser
Expand Down

0 comments on commit fb5873e

Please sign in to comment.