- {term.name}
+ {(node.suEventType && node.suEventType.length > 0) &&
+
+ {node.suEventType.map(term =>
+
+ {term.name}
+
+ )}
- )}
+ }
- {node.su_event_subheadline &&
{node.su_event_subheadline}
}
- {node.su_event_dek &&
{node.su_event_dek}
}
+ {node.suEventSubheadline &&
{node.suEventSubheadline}
}
+ {node.suEventDek &&
{node.suEventDek}
}
- {node.su_event_sponsor &&
-
- {node.su_event_sponsor.map((sponsor, index) =>
-
- {sponsor}
-
- )}
-
+ {node.suEventSponsor &&
+
+ {node.suEventSponsor.map((sponsor, index) =>
+
+ {sponsor}
+
+ )}
+
}
@@ -97,111 +95,106 @@ const StanfordEvent = async ({node, ...props}: { node: Event }) => {
-
{inPast &&
-
- This event has passed.
-
}
+
+ This event has passed.
+
}
- {(node.su_event_location || node.su_event_alt_loc) &&
-
- {node.su_event_location &&
-
-
-
-
Location
-
-
-
{node.su_event_location.organization}
-
{node.su_event_location.address_line1}
-
{node.su_event_location.address_line2}
-
{node.su_event_location.locality}, {node.su_event_location.administrative_area} {node.su_event_location.postal_code}
-
-
- }
- {node.su_event_alt_loc &&
-
-
-
-
Location
-
-
- <>{node.su_event_alt_loc}>
-
-
- }
-
- {node.su_event_map_link &&
-
- {node.su_event_map_link.title}
-
- }
-
+ {(node.suEventLocation || node.suEventAltLoc) &&
+
+ {node.suEventLocation &&
+
+
+
+
Location
+
+
+
{node.suEventLocation.organization}
+
{node.suEventLocation.addressLine1}
+
{node.suEventLocation.addressLine2}
+
{node.suEventLocation.locality}, {node.suEventLocation.administrativeArea} {node.suEventLocation.postalCode}
+
+
+ }
+ {node.suEventAltLoc &&
+
+
+
+
Location
+
+
+ {node.suEventAltLoc}
+
+
+ }
+
+ {node.suEventMapLink?.url &&
+
+ {node.suEventMapLink.title}
+
+ }
+
}
- {(node.su_event_telephone || node.su_event_email) &&
-
-
- {node.su_event_telephone &&
-
- }
- {node.su_event_email &&
-
- }
+ {(node.suEventTelephone || node.suEventEmail) &&
+
+
+ {node.suEventTelephone &&
+
+ }
+ {node.suEventEmail &&
+
+ }
+
}
- {(node.su_event_audience && node.su_event_audience?.length > 0) &&
-
-
-
-
This event is open to:
-
- {node.su_event_audience.map(audience =>
-
{audience.name}
- )}
+ {node.suEventAudience &&
+
+
+
+
This event is open to:
+ {node.suEventAudience.map(audience =>
+
{audience.name}
+ )}
+
}
- {node.su_event_cta &&
-
-
- {node.su_event_cta.title}
-
-
+ {node.suEventCta?.url &&
+
+
+ {node.suEventCta.title}
+
+
}
- {node.su_event_source &&
-
{node.su_event_source.title ? node.su_event_source.title : 'View this event'}
- }
-
- {node.body &&
+ {node.body?.processed &&
- {formatHtml(node.body)}
+ {formatHtml(node.body.processed)}
}
- {node.su_event_components &&
+ {node.suEventComponents &&
- {node.su_event_components.map(component =>
-
+ {node.suEventComponents.map(paragraph =>
+
)}
}
diff --git a/src/components/node/stanford-news/card.tsx b/src/components/node/stanford-news/card.tsx
index e045a6b0..892400e5 100644
--- a/src/components/node/stanford-news/card.tsx
+++ b/src/components/node/stanford-news/card.tsx
@@ -1,23 +1,19 @@
import Link from "@/components/patterns/elements/drupal-link";
-import {News} from "@/lib/drupal/drupal";
import Image from "next/image";
-import {PropsWithoutRef} from "react";
import {buildUrl} from "@/lib/drupal/utils";
+import {NodeStanfordNews} from "@/lib/gql/__generated__/drupal";
interface Props {
- node: News
+ node: NodeStanfordNews
h3Heading?: boolean
}
-const StanfordNewsCard = ({node, h3Heading, ...props}: PropsWithoutRef
) => {
- const featuredImageUrl = node.su_news_featured_media?.field_media_image?.uri.url
- const bannerImageUrl = node.su_news_banner?.type === 'media--image' && node.su_news_banner?.field_media_image?.uri.url;
+const StanfordNewsCard = ({node, h3Heading, ...props}: Props) => {
+ const goToUrl = node.suNewsSource?.url || node.path;
+ const featuredImageUrl = node.suNewsFeaturedMedia?.mediaImage.url
+ const bannerImageUrl = node.suNewsBanner?.__typename === 'MediaImage' && node.suNewsBanner.mediaImage.url;
const imageUrl = featuredImageUrl || bannerImageUrl
- const featuredPlaceholder = node.su_news_featured_media?.field_media_image?.uri.base64
- const bannerPlaceholder = node.su_news_banner?.type === 'media--image' && node.su_news_banner?.field_media_image?.uri.base64;
- const placeholder = featuredPlaceholder || bannerPlaceholder || undefined
-
const HeadingElement = h3Heading ? 'h3' : 'h2';
return (
@@ -29,22 +25,20 @@ const StanfordNewsCard = ({node, h3Heading, ...props}: PropsWithoutRef) =
alt=""
fill
sizes="(max-width: 768px) 100vw, (max-width: 900px) 50vw, (max-width: 1700px) 33vw, 500px"
- placeholder={placeholder ? 'blur' : 'empty'}
- blurDataURL={placeholder}
/>
}
- {node.su_news_topics[0].name}
+ {node.suNewsTopics[0].name}
}
diff --git a/src/components/node/stanford-news/list-item.tsx b/src/components/node/stanford-news/list-item.tsx
index 3c1af022..efa90f74 100644
--- a/src/components/node/stanford-news/list-item.tsx
+++ b/src/components/node/stanford-news/list-item.tsx
@@ -1,38 +1,33 @@
import Image from "next/image";
import Link from "@/components/patterns/elements/drupal-link";
-import {News} from "@/lib/drupal/drupal";
import {formatDate} from "@/lib/format-date";
-import {PropsWithoutRef} from "react";
import {buildUrl} from "@/lib/drupal/utils";
+import {NodeStanfordNews} from "@/lib/gql/__generated__/drupal";
interface Props {
- node: News
+ node: NodeStanfordNews
h3Heading?: boolean
}
-const StanfordNewsListItem = ({node, h3Heading, ...props}: PropsWithoutRef