From 76328ad08c581e4d8a460b5ef460d8e19abc2411 Mon Sep 17 00:00:00 2001 From: mertbagt Date: Wed, 8 Jul 2026 17:40:05 -0400 Subject: [PATCH 01/12] maple profile --- .../LegislatorProfilePage.tsx | 58 ++++++++++++++++--- 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/components/LegislatorProfile/LegislatorProfilePage.tsx b/components/LegislatorProfile/LegislatorProfilePage.tsx index 2f8d127e2..75b00b625 100644 --- a/components/LegislatorProfile/LegislatorProfilePage.tsx +++ b/components/LegislatorProfile/LegislatorProfilePage.tsx @@ -24,6 +24,17 @@ import { Internal } from "components/links" import { FollowUserButton } from "components/shared/FollowButton" import { CircleImage } from "components/shared/LabeledIcon" +import { + collection, + collectionGroup, + getDocs, + query, + where +} from "firebase/firestore" +import { firestore } from "../firebase" + +import { useEffect, useState } from "react" + type ProfilePlaceholder = { social?: { blueSky?: string @@ -124,6 +135,7 @@ export function LegislatorProfilePage({ court: number memberCode: string }) { + const { user } = useAuth() const { member, loading: memberLoading } = useMember(court, memberCode) const { district, loading: districtLoading } = useDistrict( court, @@ -131,7 +143,9 @@ export function LegislatorProfilePage({ member?.District ) const { t } = useTranslation("legislators") - // const { user } = useAuth() **uncomment when Following Button in enabled** + + const [legislatorId, setLegislatorId] = useState("") + const [legislatorData, setLegislatorData] = useState([]) /* replace with profile info for legislators with Maple accounts */ let profile: ProfilePlaceholder = { @@ -149,6 +163,32 @@ export function LegislatorProfilePage({ website: "" } + async function getLegislatorUID(memberCode: string) { + let docList: any[] = [] + const q = query( + collection(firestore, "profiles"), + where("memberId", "==", memberCode) + ) + const docData = await getDocs(q) + + docData.forEach(doc => { + // doc.data() is never undefined for query doc snapshots + docList.push(doc.data()) + setLegislatorData(docList) + setLegislatorId(doc.id) + }) + } + + useEffect(() => { + if (member?.MemberCode) getLegislatorUID(member.MemberCode) + }, [member?.MemberCode]) + + console.log("member: ", member?.MemberCode) + console.log("legisId", legislatorId) + console.log("data", legislatorData) + console.log("about", legislatorData[0]?.about) + console.log("social", legislatorData[0]?.social) + if (memberLoading) { return ( @@ -253,7 +293,7 @@ export function LegislatorProfilePage({
{profile?.social?.twitter || - profile?.social?.linkedIn || + legislatorData[0]?.social.linkedIn || profile?.social?.blueSky ? ( · ) : ( @@ -273,9 +313,10 @@ export function LegislatorProfilePage({ ) : ( <> )} - {profile?.social?.linkedIn ? ( + + {legislatorData[0]?.social.linkedIn ? ( )} + {profile?.social?.blueSky ? ( - {/* uncomment when legislator Maple accounts are linked to this page - - {user && legislatorAccountId ? ( + {user && legislatorId ? (
- +
) : ( <> - )} */} + )} Date: Wed, 8 Jul 2026 18:47:19 -0400 Subject: [PATCH 02/12] added profile social links --- .../LegislatorComponents.tsx | 15 ++++ .../LegislatorProfilePage.tsx | 83 +++++++------------ 2 files changed, 43 insertions(+), 55 deletions(-) diff --git a/components/LegislatorProfile/LegislatorComponents.tsx b/components/LegislatorProfile/LegislatorComponents.tsx index 1f25f37ab..38a48dbe2 100644 --- a/components/LegislatorProfile/LegislatorComponents.tsx +++ b/components/LegislatorProfile/LegislatorComponents.tsx @@ -130,6 +130,21 @@ export function LinkedIn() { ) } +export function Mastodon() { + return ( + + + + ) +} + export function Twitter() { return ( diff --git a/components/LegislatorProfile/LegislatorProfilePage.tsx b/components/LegislatorProfile/LegislatorProfilePage.tsx index 75b00b625..578aa24c6 100644 --- a/components/LegislatorProfile/LegislatorProfilePage.tsx +++ b/components/LegislatorProfile/LegislatorProfilePage.tsx @@ -1,9 +1,12 @@ +import { collection, getDocs, query, where } from "firebase/firestore" import { faChevronRight } from "@fortawesome/free-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import ErrorPage from "next/error" import { useTranslation } from "next-i18next" +import { useEffect, useState } from "react" import styled from "styled-components" +import { firestore } from "../firebase" import * as links from "../links" import { @@ -11,6 +14,7 @@ import { DistrictLabel, formatPhoneNumber, LinkedIn, + Mastodon, PartyLabel, Twitter } from "./LegislatorComponents" @@ -24,36 +28,6 @@ import { Internal } from "components/links" import { FollowUserButton } from "components/shared/FollowButton" import { CircleImage } from "components/shared/LabeledIcon" -import { - collection, - collectionGroup, - getDocs, - query, - where -} from "firebase/firestore" -import { firestore } from "../firebase" - -import { useEffect, useState } from "react" - -type ProfilePlaceholder = { - social?: { - blueSky?: string - linkedIn?: string - twitter?: string - } - website?: string -} - -const tabs = [ - "Priorities", - "Bills", - "Elections", - "Finance", - "District", - "Her testimony", - "Votes" -] - const ButtonContainer = styled(Col).attrs(props => ({ className: `col-12 justify-content-md-end ${props.className}`, md: `3`, @@ -147,22 +121,6 @@ export function LegislatorProfilePage({ const [legislatorId, setLegislatorId] = useState("") const [legislatorData, setLegislatorData] = useState([]) - /* replace with profile info for legislators with Maple accounts */ - let profile: ProfilePlaceholder = { - // social: { - // blueSky: "blueskyTest", - // linkedIn: "linkedinTest", - // twitter: "twitterTest" - // }, - // website: "test.com" - social: { - blueSky: "", - linkedIn: "", - twitter: "" - }, - website: "" - } - async function getLegislatorUID(memberCode: string) { let docList: any[] = [] const q = query( @@ -261,14 +219,14 @@ export function LegislatorProfilePage({
- {profile.website ? ( + {legislatorData[0]?.website ? (
· - {profile.website} + {legislatorData[0].website}
) : ( @@ -292,17 +250,18 @@ export function LegislatorProfilePage({ )}
- {profile?.social?.twitter || + {legislatorData[0]?.social.twitter || legislatorData[0]?.social.linkedIn || - profile?.social?.blueSky ? ( + legislatorData[0]?.social.blueSky || + legislatorData[0]?.social.mastodon ? ( · ) : ( <> )} - {profile?.social?.twitter ? ( + {legislatorData[0]?.social.twitter ? ( )} - {profile?.social?.blueSky ? ( + {legislatorData[0]?.social.blueSky ? ( )} + + {legislatorData[0]?.social.mastodon ? ( + + + + ) : ( + <> + )}
From bcdd8b97ac66316fbcab996a55766b3b6621f481 Mon Sep 17 00:00:00 2001 From: mertbagt Date: Wed, 8 Jul 2026 19:42:46 -0400 Subject: [PATCH 03/12] reinstate biography --- .../EditProfilePage/PersonalInfoTab.tsx | 4 +- .../LegislatorProfilePage.tsx | 14 +- .../LegislatorProfile/LegislatorSidebar.tsx | 19 ++- .../SidebarComponents/Biography.tsx | 149 +++++++++++++++++- components/db/profile/urlCleanup.ts | 2 +- public/locales/en/legislators.json | 5 + 6 files changed, 180 insertions(+), 13 deletions(-) diff --git a/components/EditProfilePage/PersonalInfoTab.tsx b/components/EditProfilePage/PersonalInfoTab.tsx index b6d70364c..111aa5038 100644 --- a/components/EditProfilePage/PersonalInfoTab.tsx +++ b/components/EditProfilePage/PersonalInfoTab.tsx @@ -10,7 +10,7 @@ import { TooltipButton } from "components/buttons" import { useTranslation } from "next-i18next" import styled from "styled-components" -type UpdateProfileData = { +export type UpdateProfileData = { fullName: string aboutYou: string twitter: string @@ -37,7 +37,7 @@ type Props = { legislatorsProps?: YourLegislatorsProps } -async function updateProfile( +export async function updateProfile( { profile, actions, uid }: Props, data: UpdateProfileData ) { diff --git a/components/LegislatorProfile/LegislatorProfilePage.tsx b/components/LegislatorProfile/LegislatorProfilePage.tsx index 578aa24c6..24447d331 100644 --- a/components/LegislatorProfile/LegislatorProfilePage.tsx +++ b/components/LegislatorProfile/LegislatorProfilePage.tsx @@ -138,14 +138,13 @@ export function LegislatorProfilePage({ } useEffect(() => { - if (member?.MemberCode) getLegislatorUID(member.MemberCode) - }, [member?.MemberCode]) + getLegislatorUID(memberCode) + }, [memberCode]) - console.log("member: ", member?.MemberCode) + console.log("member: ", memberCode) console.log("legisId", legislatorId) console.log("data", legislatorData) console.log("about", legislatorData[0]?.about) - console.log("social", legislatorData[0]?.social) if (memberLoading) { return ( @@ -370,7 +369,12 @@ export function LegislatorProfilePage({ /> - +
diff --git a/components/LegislatorProfile/LegislatorSidebar.tsx b/components/LegislatorProfile/LegislatorSidebar.tsx index 96cf42c9d..c35d166f4 100644 --- a/components/LegislatorProfile/LegislatorSidebar.tsx +++ b/components/LegislatorProfile/LegislatorSidebar.tsx @@ -2,12 +2,27 @@ import { Biography } from "./SidebarComponents/Biography" import { OtherTestimony } from "./SidebarComponents/OtherTestimony" import { UpcomingHearings } from "./SidebarComponents/UpcomingHearings" -export function LegislatorSidebar() { +export function LegislatorSidebar({ + court, + legislatorData, + legislatorId, + memberCode +}: { + court: number + legislatorData: any[] + legislatorId: string + memberCode: string +}) { return ( <> - + ) } diff --git a/components/LegislatorProfile/SidebarComponents/Biography.tsx b/components/LegislatorProfile/SidebarComponents/Biography.tsx index e190ac443..e802aff08 100644 --- a/components/LegislatorProfile/SidebarComponents/Biography.tsx +++ b/components/LegislatorProfile/SidebarComponents/Biography.tsx @@ -1,5 +1,148 @@ -import { TabBlock } from "../LegislatorComponents" +import { useTranslation } from "next-i18next" +import { useEffect, useState } from "react" +import { useForm } from "react-hook-form" +import styled from "styled-components" -export function Biography() { - return - Biography +import { Form } from "../../bootstrap" +import { Profile, ProfileHook, useProfile } from "../../db" +import Input from "../../forms/Input" + +import { useAuth } from "components/auth" +import { + updateProfile, + UpdateProfileData +} from "components/EditProfilePage/PersonalInfoTab" + +const BioBlock = styled.div` + background-color: white; + border: "1px #ced4da solid"; + border-radius: 5px; + font-size: 11px; + margin-top: 8px; + padding: 8px 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, + legislatorId, + memberCode +}: { + court: number + legislatorData: any[] + legislatorId: string + memberCode: string +}) { + const { user } = useAuth() + const uid = user?.uid + const pageOwnerResult = useProfile() + + let pageOwner = false + + if (uid === legislatorId) { + pageOwner = true + } + + if (pageOwnerResult.profile && pageOwner) { + // the user is the legislator whose page this is + // therefore they get edit privledges + return ( + + ) + } + + // the user is not the legislator whose page this is + // therefore they get read-only privledges + return +} + +function EditableBiography({ + actions, + court, + memberCode, + profile +}: { + actions: ProfileHook + court: number + memberCode: string + profile: Profile +}) { + const { + register, + formState: { errors, isDirty }, + handleSubmit + } = useForm() + + const { about }: Profile = profile + + const onSubmit = handleSubmit(async update => { + await updateProfile({ profile, actions }, update) + location.assign(`/legislators/${court}/${memberCode}`) + setFormUpdated(false) + }) + + const { t } = useTranslation("legislators") + const [formUpdated, setFormUpdated] = useState(false) + + useEffect(() => { + setFormUpdated(isDirty) + }, [isDirty, setFormUpdated]) + + return ( + +
+
+ + {t("biography")} + + + {t("submit")} + +
+ +
+
+ ) +} + +function ReadonlyBiography({ legislatorData }: { legislatorData: any[] }) { + const { t } = useTranslation("legislators") + + return ( + + {t("biography")} +
+ {legislatorData[0]?.about ? legislatorData[0].about : t("notClaimed")} +
+
+ ) } diff --git a/components/db/profile/urlCleanup.ts b/components/db/profile/urlCleanup.ts index 26d09b13a..f2fe17e5c 100644 --- a/components/db/profile/urlCleanup.ts +++ b/components/db/profile/urlCleanup.ts @@ -7,7 +7,7 @@ export function cleanSocialLinks(network: keyof SocialLinks, link: string) { const index: number = path.indexOf(".com/") + 5 path = path.substring(index) } - if (network === "mastodon" && path.startsWith("@")) { + if (path && network === "mastodon" && path.startsWith("@")) { path = path.substring(1) } } diff --git a/public/locales/en/legislators.json b/public/locales/en/legislators.json index 886f6a1ba..f59c80f23 100644 --- a/public/locales/en/legislators.json +++ b/public/locales/en/legislators.json @@ -1,13 +1,17 @@ { + "addBio": "Add your biography", "billsSponsored": "Bills Sponsored", + "biography": "Biography", "canSubmit": "can submit testimony on any bill or ballot question, just like any constituent. Her stance and reasoning are shown exactly as submitted — MAPLE does not edit or editorialize.", "contact": "Contact", "cosponsored": "Cosponsored", "districtDetails": "District details are not available yet.", + "editBio": "Edit your biography", "fundsRaised": "Funds Raised", "home": "Home", "legislators": "Legislators", "loading": "Loading district...", + "notClaimed": "This legislator has not claimed their MAPLE account", "party": { "democratic": "Democratic Party", "party": "Party", @@ -15,6 +19,7 @@ }, "stateRepresentative": "State Representative", "stateSenator": "State Senator", + "submit": "Submit", "tabs": { "bills": "Bills", "district": "District", From 7f24ff68ab43717e8c796a6e9531c1f0f413d786 Mon Sep 17 00:00:00 2001 From: mertbagt Date: Wed, 8 Jul 2026 20:20:53 -0400 Subject: [PATCH 04/12] reinstate TestimonyTab --- .../LegislatorProfilePage.tsx | 4 +- .../LegislatorProfile/LegislatorTabs.tsx | 11 ++- .../TabComponents/TestimonyTab.tsx | 93 +++++++++++++++++- .../TestimonyTab_PendingProfileLink.tsx | 95 ------------------- 4 files changed, 104 insertions(+), 99 deletions(-) delete mode 100644 components/LegislatorProfile/TabComponents/TestimonyTab_PendingProfileLink.tsx diff --git a/components/LegislatorProfile/LegislatorProfilePage.tsx b/components/LegislatorProfile/LegislatorProfilePage.tsx index 24447d331..e7e744bfb 100644 --- a/components/LegislatorProfile/LegislatorProfilePage.tsx +++ b/components/LegislatorProfile/LegislatorProfilePage.tsx @@ -144,7 +144,7 @@ export function LegislatorProfilePage({ console.log("member: ", memberCode) console.log("legisId", legislatorId) console.log("data", legislatorData) - console.log("about", legislatorData[0]?.about) + console.log("name", legislatorData[0]?.fullName) if (memberLoading) { return ( @@ -366,6 +366,8 @@ export function LegislatorProfilePage({ diff --git a/components/LegislatorProfile/LegislatorTabs.tsx b/components/LegislatorProfile/LegislatorTabs.tsx index 40c264453..8cdb642c6 100644 --- a/components/LegislatorProfile/LegislatorTabs.tsx +++ b/components/LegislatorProfile/LegislatorTabs.tsx @@ -66,10 +66,14 @@ const TabNavItem = ({ export function LegislatorTabs({ district, districtLoading, + legislatorData, + legislatorId, tabCategory }: { district?: District | undefined districtLoading?: boolean + legislatorData: any[] + legislatorId: string tabCategory?: TabCategories }) { const { t } = useTranslation("legislators") @@ -103,7 +107,12 @@ export function LegislatorTabs({ { title: t("tabs.testimony"), eventKey: "testimony", - content: + content: ( + + ) }, { title: t("tabs.votes"), diff --git a/components/LegislatorProfile/TabComponents/TestimonyTab.tsx b/components/LegislatorProfile/TabComponents/TestimonyTab.tsx index eb3bc6e04..73e2a04a4 100644 --- a/components/LegislatorProfile/TabComponents/TestimonyTab.tsx +++ b/components/LegislatorProfile/TabComponents/TestimonyTab.tsx @@ -1,5 +1,94 @@ +import { useMemo } from "react" +import { useTranslation } from "next-i18next" +import styled from "styled-components" + import { TabBlock } from "../LegislatorComponents" -export function TestimonyTab() { - return - Testimony +import { useAuth } from "components/auth" +import { usePublishedTestimonyListing } from "components/db/testimony/usePublishedTestimonyListing" +import { NoResults } from "components/search/NoResults" +import { TestimonyItem } from "components/TestimonyCard/TestimonyItem" + +const DisclaimerBlock = styled.div` + align-items: flex-start; + background-color: #f0f4ff; + border: "1px #d1d6e7 solid"; + border-radius: 5px; + color: #1a3185; + display: flex; + font-size: 13px; + gap: 10px; + line-height: 1.6; + margin-top: 14px; + margin-bottom: 14px; + padding: 12px 16px; +` + +function Disclaimer({ fullname }: { fullname?: string }) { + const { t } = useTranslation("legislators") + + return ( + + + + + + +
+ {fullname} {t("canSubmit")} +
+
+ ) +} + +export function TestimonyTab({ + legislatorData, + legislatorId +}: { + legislatorData: any[] + legislatorId: string +}) { + const { t } = useTranslation("testimony") + const { user } = useAuth() + + const testimony = usePublishedTestimonyListing({ + uid: legislatorId + }) + + const allTestimonies = useMemo(() => { + const legislatorTestimonies = testimony.items.result ?? [] + + // Combine and sort by publishedAt (newest first), then take 4 most recent + return [...legislatorTestimonies] + .sort((a, b) => b.publishedAt.toMillis() - a.publishedAt.toMillis()) + .slice(0, 4) + }, [testimony.items.result]) + + return ( + <> + + {allTestimonies.length > 0 ? ( +
+ {allTestimonies.map(testimony => ( + + + + ))} +
+ ) : ( + {t("viewTestimony.noTestimonies")} + )} + + ) } diff --git a/components/LegislatorProfile/TabComponents/TestimonyTab_PendingProfileLink.tsx b/components/LegislatorProfile/TabComponents/TestimonyTab_PendingProfileLink.tsx deleted file mode 100644 index 12b8174fd..000000000 --- a/components/LegislatorProfile/TabComponents/TestimonyTab_PendingProfileLink.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import { useMemo } from "react" -import { useTranslation } from "next-i18next" -import styled from "styled-components" - -import { TabBlock } from "../LegislatorComponents" - -import { useAuth } from "components/auth" -import { usePublishedTestimonyListing } from "components/db/testimony/usePublishedTestimonyListing" -import { NoResults } from "components/search/NoResults" -import { TestimonyItem } from "components/TestimonyCard/TestimonyItem" - -const DisclaimerBlock = styled.div` - align-items: flex-start; - background-color: #f0f4ff; - border: "1px #d1d6e7 solid"; - border-radius: 5px; - color: #1a3185; - display: flex; - font-size: 13px; - gap: 10px; - line-height: 1.6; - margin-top: 14px; - margin-bottom: 14px; - padding: 12px 16px; -` - -function Disclaimer({ fullname }: { fullname?: string }) { - const { t } = useTranslation("legislators") - - return ( - - - - - - -
- {fullname} {t("canSubmit")} -
-
- ) -} - -export function Testimony({ - fullname, - pageId -}: { - fullname?: string - pageId?: string -}) { - const { t } = useTranslation("testimony") - const { user } = useAuth() - - const testimony = usePublishedTestimonyListing({ - uid: pageId - }) - - const allTestimonies = useMemo(() => { - const legislatorTestimonies = testimony.items.result ?? [] - - // Combine and sort by publishedAt (newest first), then take 4 most recent - return [...legislatorTestimonies] - .sort((a, b) => b.publishedAt.toMillis() - a.publishedAt.toMillis()) - .slice(0, 4) - }, [testimony.items.result]) - - return ( - <> - - {allTestimonies.length > 0 ? ( -
- {allTestimonies.map(testimony => ( - - - - ))} -
- ) : ( - {t("viewTestimony.noTestimonies")} - )} - - ) -} From 1e13d724bba26bcb911eb7c1e6aca397d4555340 Mon Sep 17 00:00:00 2001 From: mertbagt Date: Wed, 8 Jul 2026 20:22:42 -0400 Subject: [PATCH 05/12] corrected stroke-width to strokeWidth --- components/LegislatorProfile/TabComponents/TestimonyTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/LegislatorProfile/TabComponents/TestimonyTab.tsx b/components/LegislatorProfile/TabComponents/TestimonyTab.tsx index 73e2a04a4..8ab395a3f 100644 --- a/components/LegislatorProfile/TabComponents/TestimonyTab.tsx +++ b/components/LegislatorProfile/TabComponents/TestimonyTab.tsx @@ -35,7 +35,7 @@ function Disclaimer({ fullname }: { fullname?: string }) { viewBox="0 0 24 24" fill="none" stroke="#1a3185" - stroke-width="2" + strokeWidth="2" > From f9818d074d00996a44c9b9d066645487b7d03d33 Mon Sep 17 00:00:00 2001 From: mertbagt Date: Wed, 8 Jul 2026 20:28:10 -0400 Subject: [PATCH 06/12] cleanup --- components/LegislatorProfile/LegislatorProfilePage.tsx | 5 ----- components/LegislatorProfile/SidebarComponents/Biography.tsx | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/components/LegislatorProfile/LegislatorProfilePage.tsx b/components/LegislatorProfile/LegislatorProfilePage.tsx index e7e744bfb..c6f332f1e 100644 --- a/components/LegislatorProfile/LegislatorProfilePage.tsx +++ b/components/LegislatorProfile/LegislatorProfilePage.tsx @@ -141,11 +141,6 @@ export function LegislatorProfilePage({ getLegislatorUID(memberCode) }, [memberCode]) - console.log("member: ", memberCode) - console.log("legisId", legislatorId) - console.log("data", legislatorData) - console.log("name", legislatorData[0]?.fullName) - if (memberLoading) { return ( diff --git a/components/LegislatorProfile/SidebarComponents/Biography.tsx b/components/LegislatorProfile/SidebarComponents/Biography.tsx index e802aff08..e22388e84 100644 --- a/components/LegislatorProfile/SidebarComponents/Biography.tsx +++ b/components/LegislatorProfile/SidebarComponents/Biography.tsx @@ -48,14 +48,14 @@ export function Biography({ }) { const { user } = useAuth() const uid = user?.uid - const pageOwnerResult = useProfile() let pageOwner = false - if (uid === legislatorId) { pageOwner = true } + const pageOwnerResult = useProfile() + if (pageOwnerResult.profile && pageOwner) { // the user is the legislator whose page this is // therefore they get edit privledges From 4e5ecf2d7551b52b24e9538d1c7883524552bd8e Mon Sep 17 00:00:00 2001 From: mertbagt Date: Wed, 8 Jul 2026 20:34:59 -0400 Subject: [PATCH 07/12] clarity --- .../SidebarComponents/Biography.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/LegislatorProfile/SidebarComponents/Biography.tsx b/components/LegislatorProfile/SidebarComponents/Biography.tsx index e22388e84..029ce9d5d 100644 --- a/components/LegislatorProfile/SidebarComponents/Biography.tsx +++ b/components/LegislatorProfile/SidebarComponents/Biography.tsx @@ -54,22 +54,22 @@ export function Biography({ pageOwner = true } - const pageOwnerResult = useProfile() + const userResult = useProfile() - if (pageOwnerResult.profile && pageOwner) { - // the user is the legislator whose page this is + if (userResult.profile && pageOwner) { + // the user is the legislator who owns this page // therefore they get edit privledges return ( ) } - // the user is not the legislator whose page this is + // the user is not the legislator who owns this page // therefore they get read-only privledges return } From 5c2491b08391161061d0b7593b76a2322febc50e Mon Sep 17 00:00:00 2001 From: mertbagt Date: Wed, 8 Jul 2026 20:56:34 -0400 Subject: [PATCH 08/12] margin tweaks --- .../LegislatorProfile/SidebarComponents/Biography.tsx | 7 ++++--- .../LegislatorProfile/TabComponents/TestimonyTab.tsx | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/components/LegislatorProfile/SidebarComponents/Biography.tsx b/components/LegislatorProfile/SidebarComponents/Biography.tsx index 029ce9d5d..cdbed8755 100644 --- a/components/LegislatorProfile/SidebarComponents/Biography.tsx +++ b/components/LegislatorProfile/SidebarComponents/Biography.tsx @@ -15,11 +15,12 @@ import { const BioBlock = styled.div` background-color: white; - border: "1px #ced4da solid"; + border-color: #b8c0c9; border-radius: 5px; + border-style: solid; + border-width: 1px; font-size: 11px; - margin-top: 8px; - padding: 8px 16px; + padding: 16px; ` const BioButton = styled.button` diff --git a/components/LegislatorProfile/TabComponents/TestimonyTab.tsx b/components/LegislatorProfile/TabComponents/TestimonyTab.tsx index 8ab395a3f..061256d37 100644 --- a/components/LegislatorProfile/TabComponents/TestimonyTab.tsx +++ b/components/LegislatorProfile/TabComponents/TestimonyTab.tsx @@ -87,7 +87,9 @@ export function TestimonyTab({ ))} ) : ( - {t("viewTestimony.noTestimonies")} + + {t("viewTestimony.noTestimonies")} + )} ) From 50cee52d4f5fcd4dd9525e44e5e36619215542f8 Mon Sep 17 00:00:00 2001 From: mertbagt Date: Wed, 8 Jul 2026 21:05:58 -0400 Subject: [PATCH 09/12] cleanup --- .../LegislatorProfile/LegislatorProfilePage.tsx | 2 +- components/LegislatorProfile/LegislatorTabs.tsx | 11 +++-------- .../LegislatorProfile/TabComponents/TestimonyTab.tsx | 10 +++++----- public/locales/en/legislators.json | 2 +- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/components/LegislatorProfile/LegislatorProfilePage.tsx b/components/LegislatorProfile/LegislatorProfilePage.tsx index c6f332f1e..ef3c8d446 100644 --- a/components/LegislatorProfile/LegislatorProfilePage.tsx +++ b/components/LegislatorProfile/LegislatorProfilePage.tsx @@ -361,8 +361,8 @@ export function LegislatorProfilePage({ diff --git a/components/LegislatorProfile/LegislatorTabs.tsx b/components/LegislatorProfile/LegislatorTabs.tsx index 8cdb642c6..6f2791f19 100644 --- a/components/LegislatorProfile/LegislatorTabs.tsx +++ b/components/LegislatorProfile/LegislatorTabs.tsx @@ -66,14 +66,14 @@ const TabNavItem = ({ export function LegislatorTabs({ district, districtLoading, - legislatorData, legislatorId, + name, tabCategory }: { district?: District | undefined districtLoading?: boolean - legislatorData: any[] legislatorId: string + name: string tabCategory?: TabCategories }) { const { t } = useTranslation("legislators") @@ -107,12 +107,7 @@ export function LegislatorTabs({ { title: t("tabs.testimony"), eventKey: "testimony", - content: ( - - ) + content: }, { title: t("tabs.votes"), diff --git a/components/LegislatorProfile/TabComponents/TestimonyTab.tsx b/components/LegislatorProfile/TabComponents/TestimonyTab.tsx index 061256d37..8ff9d8736 100644 --- a/components/LegislatorProfile/TabComponents/TestimonyTab.tsx +++ b/components/LegislatorProfile/TabComponents/TestimonyTab.tsx @@ -49,11 +49,11 @@ function Disclaimer({ fullname }: { fullname?: string }) { } export function TestimonyTab({ - legislatorData, - legislatorId + legislatorId, + name }: { - legislatorData: any[] legislatorId: string + name: string }) { const { t } = useTranslation("testimony") const { user } = useAuth() @@ -73,8 +73,8 @@ export function TestimonyTab({ return ( <> - - {allTestimonies.length > 0 ? ( + + {allTestimonies.length > 0 && legislatorId ? (
{allTestimonies.map(testimony => ( diff --git a/public/locales/en/legislators.json b/public/locales/en/legislators.json index f59c80f23..4a9e69920 100644 --- a/public/locales/en/legislators.json +++ b/public/locales/en/legislators.json @@ -2,7 +2,7 @@ "addBio": "Add your biography", "billsSponsored": "Bills Sponsored", "biography": "Biography", - "canSubmit": "can submit testimony on any bill or ballot question, just like any constituent. Her stance and reasoning are shown exactly as submitted — MAPLE does not edit or editorialize.", + "canSubmit": "can submit testimony on any bill or ballot question, just like any constituent. Their stance and reasoning are shown exactly as submitted — MAPLE does not edit or editorialize.", "contact": "Contact", "cosponsored": "Cosponsored", "districtDetails": "District details are not available yet.", From 55cfa678ef85731d72cc37d9763344e9c3f5b83f Mon Sep 17 00:00:00 2001 From: mertbagt Date: Wed, 8 Jul 2026 21:11:12 -0400 Subject: [PATCH 10/12] cleanup testimonyTab --- .../LegislatorProfile/TabComponents/TestimonyTab.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/LegislatorProfile/TabComponents/TestimonyTab.tsx b/components/LegislatorProfile/TabComponents/TestimonyTab.tsx index 8ff9d8736..e72246a44 100644 --- a/components/LegislatorProfile/TabComponents/TestimonyTab.tsx +++ b/components/LegislatorProfile/TabComponents/TestimonyTab.tsx @@ -62,10 +62,10 @@ export function TestimonyTab({ uid: legislatorId }) - const allTestimonies = useMemo(() => { + const testimonies = useMemo(() => { const legislatorTestimonies = testimony.items.result ?? [] - // Combine and sort by publishedAt (newest first), then take 4 most recent + // Sort by publishedAt (newest first), then take 4 most recent return [...legislatorTestimonies] .sort((a, b) => b.publishedAt.toMillis() - a.publishedAt.toMillis()) .slice(0, 4) @@ -74,9 +74,9 @@ export function TestimonyTab({ return ( <> - {allTestimonies.length > 0 && legislatorId ? ( + {testimonies.length > 0 && legislatorId ? (
- {allTestimonies.map(testimony => ( + {testimonies.map(testimony => ( Date: Wed, 8 Jul 2026 21:24:29 -0400 Subject: [PATCH 11/12] more cleanup --- components/LegislatorProfile/LegislatorProfilePage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/LegislatorProfile/LegislatorProfilePage.tsx b/components/LegislatorProfile/LegislatorProfilePage.tsx index ef3c8d446..820adf4e1 100644 --- a/components/LegislatorProfile/LegislatorProfilePage.tsx +++ b/components/LegislatorProfile/LegislatorProfilePage.tsx @@ -269,7 +269,7 @@ export function LegislatorProfilePage({ {legislatorData[0]?.social.linkedIn ? ( Date: Tue, 14 Jul 2026 19:37:59 -0400 Subject: [PATCH 12/12] tweaked disclaimer border --- components/LegislatorProfile/TabComponents/TestimonyTab.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/LegislatorProfile/TabComponents/TestimonyTab.tsx b/components/LegislatorProfile/TabComponents/TestimonyTab.tsx index e72246a44..74f6383fa 100644 --- a/components/LegislatorProfile/TabComponents/TestimonyTab.tsx +++ b/components/LegislatorProfile/TabComponents/TestimonyTab.tsx @@ -12,8 +12,10 @@ import { TestimonyItem } from "components/TestimonyCard/TestimonyItem" const DisclaimerBlock = styled.div` align-items: flex-start; background-color: #f0f4ff; - border: "1px #d1d6e7 solid"; + border-color: #b8c0c9; border-radius: 5px; + border-style: solid; + border-width: 1px; color: #1a3185; display: flex; font-size: 13px;