diff --git a/components/bill/Summary.tsx b/components/bill/Summary.tsx index 4b1696055..10288d97b 100644 --- a/components/bill/Summary.tsx +++ b/components/bill/Summary.tsx @@ -104,11 +104,14 @@ export const ViewMessage = styled.div` } ` +const BALLOT_SUMMARY_CHAR_LIMIT = 1000 + export const Summary = ({ bill, className }: BillProps & { className?: string }) => { const [showBillDetails, setShowBillDetails] = useState(false) + const [showFullSummary, setShowFullSummary] = useState(false) const handleShowBillDetails = () => setShowBillDetails(true) const handleHideBillDetails = () => setShowBillDetails(false) const billText = bill?.content?.DocumentText @@ -221,7 +224,36 @@ export const Summary = ({ )} {bill.summary !== undefined && isBallotMeasure ? ( - {bill.summary} + {bill.summary.length > BALLOT_SUMMARY_CHAR_LIMIT ? ( + <> + {bill.summary.slice(0, BALLOT_SUMMARY_CHAR_LIMIT)}…{" "} + setShowFullSummary(true)} + > + {t("bill.view_full_summary")} + + setShowFullSummary(false)} + size="lg" + > + setShowFullSummary(false)} + > + {bill?.id} + + + + {bill.summary} + + + + + ) : ( + bill.summary + )} ) : ( {bill.summary} diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 0fc4af4f0..419f56be0 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -65,7 +65,8 @@ "smart_tag": "AI Smart Tag", "status_and_history": "Status & History", "status_history": "Status History", - "view_bill": "View Bill Text" + "view_bill": "View Bill Text", + "view_full_summary": "View Full Summary" }, "bill_updates": "Bill Updates", "browse_bills": "browse bills",