From 12e939380e0e9783daa9cc892a432b2b5a9a5795 Mon Sep 17 00:00:00 2001 From: mertbagt Date: Sun, 19 Jul 2026 13:35:29 -0400 Subject: [PATCH 1/5] remove value overrriden property --- components/OurTeam/Partners.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/OurTeam/Partners.tsx b/components/OurTeam/Partners.tsx index 5ab695e1b..0b11ce8fc 100644 --- a/components/OurTeam/Partners.tsx +++ b/components/OurTeam/Partners.tsx @@ -14,7 +14,7 @@ export const LocalizedContent = (props: { components={{ a: ( Date: Tue, 18 Aug 2026 21:25:38 -0400 Subject: [PATCH 2/5] generate legislatorEvents --- .../HearingsScheduled/HearingsScheduled.tsx | 1 + .../LegislatorProfilePage.tsx | 1 + .../LegislatorProfile/LegislatorSidebar.tsx | 4 +- .../SidebarComponents/UpcomingHearings.tsx | 54 ++++++++++++++++++- 4 files changed, 58 insertions(+), 2 deletions(-) diff --git a/components/HearingsScheduled/HearingsScheduled.tsx b/components/HearingsScheduled/HearingsScheduled.tsx index bb51b18d6..88508ee81 100644 --- a/components/HearingsScheduled/HearingsScheduled.tsx +++ b/components/HearingsScheduled/HearingsScheduled.tsx @@ -9,6 +9,7 @@ export type EventData = { index: number type: "hearing" | "session" name: string + code?: string | null id: number location?: string fullDate: Date // TODO: Could be a timestamp diff --git a/components/LegislatorProfile/LegislatorProfilePage.tsx b/components/LegislatorProfile/LegislatorProfilePage.tsx index 24ea34433..e65576a90 100644 --- a/components/LegislatorProfile/LegislatorProfilePage.tsx +++ b/components/LegislatorProfile/LegislatorProfilePage.tsx @@ -376,6 +376,7 @@ export function LegislatorProfilePage({ - + latestDate) latestDate = eventDate + + const index = Math.floor(eventDate.diff(thisMonth, "months").months) + const date = formatDate(e.content.EventDate) + if (e.type === "hearing") { + eventList.push({ + index, + type: e.type, + name: e.content.Name ?? "Hearing", + code: e.content.HearingHost.CommitteeCode, + id: e.content.EventId, + location: e.content.Location?.LocationName ?? undefined, + fullDate: eventDate.toJSDate(), + year: date.year, + month: date.month, + date: date.date, + day: date.day, + time: date.time + }) + } + } + } + + const LegislatorCommitteCodes = committeeList.map(code => code.CommitteeCode) + + let legislatorEvents: any[] = [] + + if (events) { + eventList.forEach(event => { + if (LegislatorCommitteCodes.includes(event.code)) { + legislatorEvents.push(event) + } + }) + } + + console.log("legislatorEvents", legislatorEvents) + return - Upcoming Hearings } From 07c417f150b8d92bbf5c855fe3d3249f3af83900 Mon Sep 17 00:00:00 2001 From: mertbagt Date: Thu, 20 Aug 2026 14:44:52 -0400 Subject: [PATCH 3/5] basic framing --- .../LegislatorProfile/LegislatorSidebar.tsx | 20 +++++++++++ .../SidebarComponents/Biography.tsx | 33 +++++-------------- .../SidebarComponents/OtherTestimony.tsx | 13 ++++++-- .../SidebarComponents/UpcomingHearings.tsx | 14 ++++++-- public/locales/en/legislators.json | 4 ++- 5 files changed, 54 insertions(+), 30 deletions(-) diff --git a/components/LegislatorProfile/LegislatorSidebar.tsx b/components/LegislatorProfile/LegislatorSidebar.tsx index 4e43e7394..155006208 100644 --- a/components/LegislatorProfile/LegislatorSidebar.tsx +++ b/components/LegislatorProfile/LegislatorSidebar.tsx @@ -1,3 +1,5 @@ +import styled from "styled-components" + import { Biography } from "./SidebarComponents/Biography" import { OtherTestimony } from "./SidebarComponents/OtherTestimony" import { UpcomingHearings } from "./SidebarComponents/UpcomingHearings" @@ -28,3 +30,21 @@ export function LegislatorSidebar({ ) } + +export const SidebarBlock = styled.div` + background-color: white; + border-color: #b8c0c9; + border-radius: 5px; + border-style: solid; + border-width: 1px; + font-size: 11px; + padding: 16px; +` + +export const SidebarTitle = styled.div` + font-weight: 700; + color: #0b0a3e; + text-transform: uppercase; + letter-spacing: 0.05em; + margin-bottom: 10px; +` diff --git a/components/LegislatorProfile/SidebarComponents/Biography.tsx b/components/LegislatorProfile/SidebarComponents/Biography.tsx index cdbed8755..28f5428af 100644 --- a/components/LegislatorProfile/SidebarComponents/Biography.tsx +++ b/components/LegislatorProfile/SidebarComponents/Biography.tsx @@ -6,6 +6,7 @@ import styled from "styled-components" import { Form } from "../../bootstrap" import { Profile, ProfileHook, useProfile } from "../../db" import Input from "../../forms/Input" +import { SidebarBlock, SidebarTitle } from "../LegislatorSidebar" import { useAuth } from "components/auth" import { @@ -13,29 +14,11 @@ import { UpdateProfileData } from "components/EditProfilePage/PersonalInfoTab" -const BioBlock = styled.div` - background-color: white; - border-color: #b8c0c9; - border-radius: 5px; - border-style: solid; - border-width: 1px; - font-size: 11px; - padding: 16px; -` - const BioButton = styled.button` font-size: 9px; padding: 2px; ` -const BioTitle = styled.div` - font-weight: 700; - color: #0b0a3e; - text-transform: uppercase; - letter-spacing: 0.05em; - margin-bottom: 10px; -` - export function Biography({ court, legislatorData, @@ -108,12 +91,12 @@ function EditableBiography({ }, [isDirty, setFormUpdated]) return ( - +
- + {t("biography")} - + - + ) } @@ -139,11 +122,11 @@ function ReadonlyBiography({ legislatorData }: { legislatorData: any[] }) { const { t } = useTranslation("legislators") return ( - - {t("biography")} + + {t("biography")}
{legislatorData[0]?.about ? legislatorData[0].about : t("notClaimed")}
-
+ ) } diff --git a/components/LegislatorProfile/SidebarComponents/OtherTestimony.tsx b/components/LegislatorProfile/SidebarComponents/OtherTestimony.tsx index 4cf43f2b2..222e204d3 100644 --- a/components/LegislatorProfile/SidebarComponents/OtherTestimony.tsx +++ b/components/LegislatorProfile/SidebarComponents/OtherTestimony.tsx @@ -1,5 +1,14 @@ -import { TabBlock } from "../LegislatorComponents" +import { useTranslation } from "next-i18next" + +import { SidebarBlock, SidebarTitle } from "../LegislatorSidebar" export function OtherTestimony() { - return - Other Testimony + const { t } = useTranslation("legislators") + + return ( + + {t("otherTestimony")} +
Content To Be Added
+
+ ) } diff --git a/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx b/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx index e900ed8f6..004e655e6 100644 --- a/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx +++ b/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx @@ -1,12 +1,15 @@ import { DateTime } from "luxon" +import { useTranslation } from "next-i18next" -import { TabBlock } from "../LegislatorComponents" +import { SidebarBlock, SidebarTitle } from "../LegislatorSidebar" import { useUpcomingEvents } from "components/db/events" import { EventData } from "components/HearingsScheduled" import { formatDate } from "components/HearingsScheduled/dateUtils" export function UpcomingHearings({ committeeList }: { committeeList: any[] }) { + const { t } = useTranslation("legislators") + const events = useUpcomingEvents() const thisMonth = DateTime.now().startOf("month") const eventList: EventData[] = [] @@ -53,5 +56,12 @@ export function UpcomingHearings({ committeeList }: { committeeList: any[] }) { console.log("legislatorEvents", legislatorEvents) - return - Upcoming Hearings + return ( + + {t("upcomingHearings")} + {/*
+ {legislatorData[0]?.about ? legislatorData[0].about : t("notClaimed")} +
*/} +
+ ) } diff --git a/public/locales/en/legislators.json b/public/locales/en/legislators.json index c422d3e01..8e08a8c7f 100644 --- a/public/locales/en/legislators.json +++ b/public/locales/en/legislators.json @@ -45,6 +45,7 @@ "legislators": "Legislators", "loading": "Loading district...", "notClaimed": "This legislator has not claimed their MAPLE account", + "otherTestimony": "Others' testimony on their bills", "party": { "democratic": "Democratic Party", "party": "Party", @@ -62,5 +63,6 @@ "testimony": "Testimony", "votes": "Votes" }, - "termsServed": "Terms Served" + "termsServed": "Terms Served", + "upcomingHearings": "Upcoming Hearings" } \ No newline at end of file From 7d117ddbb7bb75736988aee53db30f2b34a68592 Mon Sep 17 00:00:00 2001 From: mertbagt Date: Thu, 20 Aug 2026 15:19:29 -0400 Subject: [PATCH 4/5] add individual hearings: --- .../SidebarComponents/UpcomingHearings.tsx | 42 +++++++++++++++++-- public/locales/en/legislators.json | 1 + 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx b/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx index 004e655e6..2db249783 100644 --- a/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx +++ b/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx @@ -1,5 +1,6 @@ import { DateTime } from "luxon" import { useTranslation } from "next-i18next" +import styled from "styled-components" import { SidebarBlock, SidebarTitle } from "../LegislatorSidebar" @@ -7,6 +8,29 @@ import { useUpcomingEvents } from "components/db/events" import { EventData } from "components/HearingsScheduled" import { formatDate } from "components/HearingsScheduled/dateUtils" +const EventBlock = styled.div` + border-bottom: 1px solid #b8c0c9; + font-size: 12px; + font-weight: 700; + margin-bottom: 2px; + padding: 8px 0; +` + +const EventDate = styled.div` + color: #1a3185; +` + +const EventTitle = styled.div` + color: #212529; + font-weight: 600; + text-decoration: none; +` + +const EventLocation = styled.div` + color: #6c757d; + margin-top: 1px; +` + export function UpcomingHearings({ committeeList }: { committeeList: any[] }) { const { t } = useTranslation("legislators") @@ -59,9 +83,21 @@ export function UpcomingHearings({ committeeList }: { committeeList: any[] }) { return ( {t("upcomingHearings")} - {/*
- {legislatorData[0]?.about ? legislatorData[0].about : t("notClaimed")} -
*/} + {legislatorEvents ? ( + <> + {legislatorEvents.slice(0, 3).map(e => ( + + + {e.month} {e.date} {" · "} {e.time} + + {e.name} + {e.location} + + ))} + + ) : ( +
{t("noEvents")}
+ )}
) } diff --git a/public/locales/en/legislators.json b/public/locales/en/legislators.json index 8e08a8c7f..5ddafb997 100644 --- a/public/locales/en/legislators.json +++ b/public/locales/en/legislators.json @@ -44,6 +44,7 @@ "home": "Home", "legislators": "Legislators", "loading": "Loading district...", + "noEvents": "This legislator does not have hearings in the near term future", "notClaimed": "This legislator has not claimed their MAPLE account", "otherTestimony": "Others' testimony on their bills", "party": { From c3077242f573b28f922794296e7a02a2f5da0077 Mon Sep 17 00:00:00 2001 From: mertbagt Date: Thu, 20 Aug 2026 19:16:54 -0400 Subject: [PATCH 5/5] hearings link --- .../SidebarComponents/UpcomingHearings.tsx | 20 ++++++++++++++++++- public/locales/en/legislators.json | 3 ++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx b/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx index 2db249783..4bbb86c2e 100644 --- a/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx +++ b/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx @@ -2,6 +2,8 @@ import { DateTime } from "luxon" import { useTranslation } from "next-i18next" import styled from "styled-components" +import * as links from "../../links" +import { Col } from "../../bootstrap" import { SidebarBlock, SidebarTitle } from "../LegislatorSidebar" import { useUpcomingEvents } from "components/db/events" @@ -12,7 +14,7 @@ const EventBlock = styled.div` border-bottom: 1px solid #b8c0c9; font-size: 12px; font-weight: 700; - margin-bottom: 2px; + margin: 0 2px; padding: 8px 0; ` @@ -31,6 +33,16 @@ const EventLocation = styled.div` margin-top: 1px; ` +export const HearingsLink = styled(links.Internal)` + font-size: 12px; + font-weight: 700; + color: #1a3185; + padding: 10px; + display: block; + text-align: center; + text-decoration: none; +` + export function UpcomingHearings({ committeeList }: { committeeList: any[] }) { const { t } = useTranslation("legislators") @@ -98,6 +110,12 @@ export function UpcomingHearings({ committeeList }: { committeeList: any[] }) { ) : (
{t("noEvents")}
)} + + + {t("viewAllHearings")} + {" ↗"} + + ) } diff --git a/public/locales/en/legislators.json b/public/locales/en/legislators.json index 5ddafb997..79d2da6fc 100644 --- a/public/locales/en/legislators.json +++ b/public/locales/en/legislators.json @@ -65,5 +65,6 @@ "votes": "Votes" }, "termsServed": "Terms Served", - "upcomingHearings": "Upcoming Hearings" + "upcomingHearings": "Upcoming Hearings", + "viewAllHearings": "View all hearings" } \ No newline at end of file