From 17f214c30736a9ade59ad46f01098a1224e8dba0 Mon Sep 17 00:00:00 2001 From: cade-exygy <131277283+cade-exygy@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:59:58 -0600 Subject: [PATCH] feat: add priority prop (#161) --- .../listing/listing_sidebar/Contact.tsx | 5 ++++- .../listing/listing_sidebar/ExpandableSection.tsx | 10 ++++++++-- .../listing/listing_sidebar/events/EventSection.tsx | 3 ++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/page_components/listing/listing_sidebar/Contact.tsx b/src/page_components/listing/listing_sidebar/Contact.tsx index 8934756..95b9603 100644 --- a/src/page_components/listing/listing_sidebar/Contact.tsx +++ b/src/page_components/listing/listing_sidebar/Contact.tsx @@ -25,6 +25,8 @@ export interface ContactProps { contactTitleClassname?: string /** The text for the section's header */ sectionTitle: string + /** The header level for the sectionTitle */ + priority?: number strings: { email?: string; getDirections: string; website?: string } } @@ -40,6 +42,7 @@ const Contact = ({ contactTitle, contactTitleClassname, sectionTitle, + priority, strings, }: ContactProps) => { const formattedPhoneLink = contactPhoneNumber @@ -54,7 +57,7 @@ const Contact = ({ return (
- + {sectionTitle} diff --git a/src/page_components/listing/listing_sidebar/ExpandableSection.tsx b/src/page_components/listing/listing_sidebar/ExpandableSection.tsx index 7d4c85d..d067874 100644 --- a/src/page_components/listing/listing_sidebar/ExpandableSection.tsx +++ b/src/page_components/listing/listing_sidebar/ExpandableSection.tsx @@ -6,6 +6,7 @@ import { Heading } from "../../../text/Heading" export interface ExpandableSectionProps { content: string | React.ReactNode expandableContent?: string | React.ReactNode + priority?: number strings: { title: string readMore?: string @@ -14,7 +15,12 @@ export interface ExpandableSectionProps { } } -const ExpandableSection = ({ content, expandableContent, strings }: ExpandableSectionProps) => { +const ExpandableSection = ({ + content, + expandableContent, + priority, + strings, +}: ExpandableSectionProps) => { if (!content) return null const getTextContent = (textContent: string | React.ReactNode) => { @@ -30,7 +36,7 @@ const ExpandableSection = ({ content, expandableContent, strings }: ExpandableSe } return (
- + {strings.title}
diff --git a/src/page_components/listing/listing_sidebar/events/EventSection.tsx b/src/page_components/listing/listing_sidebar/events/EventSection.tsx index 957b526..1f43496 100644 --- a/src/page_components/listing/listing_sidebar/events/EventSection.tsx +++ b/src/page_components/listing/listing_sidebar/events/EventSection.tsx @@ -14,6 +14,7 @@ type EventSectionProps = { headerText?: string sectionHeader?: boolean dateClassName?: string + priority?: number } const EventSection = (props: EventSectionProps) => { @@ -29,7 +30,7 @@ const EventSection = (props: EventSectionProps) => {
{props.headerText && ( {props.headerText}