-
+
{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 c3da92690..4bbb86c2e 100644
--- a/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx
+++ b/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx
@@ -1,5 +1,121 @@
-import { TabBlock } from "../LegislatorComponents"
+import { DateTime } from "luxon"
+import { useTranslation } from "next-i18next"
+import styled from "styled-components"
-export function UpcomingHearings() {
- return
- Upcoming Hearings
+import * as links from "../../links"
+import { Col } from "../../bootstrap"
+import { SidebarBlock, SidebarTitle } from "../LegislatorSidebar"
+
+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: 0 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 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")
+
+ const events = useUpcomingEvents()
+ const thisMonth = DateTime.now().startOf("month")
+ const eventList: EventData[] = []
+ let latestDate = DateTime.now()
+
+ if (events) {
+ for (let e of events) {
+ const eventDate = DateTime.fromISO(e.content.EventDate)
+
+ if (eventDate > 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 (
+
+ {t("upcomingHearings")}
+ {legislatorEvents ? (
+ <>
+ {legislatorEvents.slice(0, 3).map(e => (
+
+
+ {e.month} {e.date} {" · "} {e.time}
+
+ {e.name}
+ {e.location}
+
+ ))}
+ >
+ ) : (
+ {t("noEvents")}
+ )}
+
+
+ {t("viewAllHearings")}
+ {" ↗"}
+
+
+
+ )
}
diff --git a/public/locales/en/legislators.json b/public/locales/en/legislators.json
index c422d3e01..79d2da6fc 100644
--- a/public/locales/en/legislators.json
+++ b/public/locales/en/legislators.json
@@ -44,7 +44,9 @@
"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": {
"democratic": "Democratic Party",
"party": "Party",
@@ -62,5 +64,7 @@
"testimony": "Testimony",
"votes": "Votes"
},
- "termsServed": "Terms Served"
+ "termsServed": "Terms Served",
+ "upcomingHearings": "Upcoming Hearings",
+ "viewAllHearings": "View all hearings"
}
\ No newline at end of file