Skip to content

Commit 7e1b9bc

Browse files
authored
Merge pull request #1890 from jicruz96/misc-code-cleanup
miscellaneous stale code cleanup
2 parents b6e19b9 + bbca128 commit 7e1b9bc

File tree

4 files changed

+0
-122
lines changed

4 files changed

+0
-122
lines changed

components/CurrentCommitteeCard/CurrentCommitteeCard.tsx

Lines changed: 0 additions & 46 deletions
This file was deleted.

components/formatting.tsx

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
import { Timestamp } from "firebase/firestore"
2-
import { useMediaQuery } from "usehooks-ts"
3-
import { Testimony } from "../functions/src/testimony/types"
4-
import { Bill, BillContent } from "./db"
5-
61
const billIdFormat = /^(?<chamber>\D+)(?<number>\d+)$/
72

83
/** Formats H123 as H.123 */
@@ -15,56 +10,5 @@ export const formatBillId = (id: string) => {
1510
}
1611
}
1712

18-
const MISSING_TIMESTAMP = Timestamp.fromMillis(0)
19-
export const formatTimestamp = (t?: Timestamp) => {
20-
if (!t || t.toMillis() == MISSING_TIMESTAMP.toMillis()) {
21-
return undefined
22-
}
23-
return t.toDate().toLocaleDateString()
24-
}
25-
26-
export const FormattedBillTitle = ({ bill }: { bill: Bill | BillContent }) => {
27-
const isMobile = useMediaQuery("(max-width: 768px)")
28-
const billInfo = "content" in bill ? bill.content : bill
29-
30-
const { BillNumber, Title } = billInfo
31-
32-
return (
33-
<div className="mt-2">
34-
{formatBillId(BillNumber)}:{" "}
35-
{isMobile ? Title.substring(0, 45) + "..." : Title}
36-
</div>
37-
)
38-
}
39-
40-
export const FormattedTestimonyTitle = ({
41-
testimony
42-
}: {
43-
testimony: Testimony
44-
}) => {
45-
const { authorDisplayName, publishedAt, position } = testimony
46-
47-
return (
48-
<div>
49-
<span>
50-
<b>Author:</b> {authorDisplayName || "anonymous"}
51-
</span>
52-
<br></br>
53-
<span>
54-
<b>Published on:</b> {publishedAt.toDate().toLocaleDateString()}
55-
</span>
56-
<br></br>
57-
<span>
58-
<b>Position:</b> {position}
59-
</span>
60-
</div>
61-
)
62-
}
63-
64-
export const decodeHtmlCharCodes = (s: string) =>
65-
s.replace(/(&#(\d+);)/g, (match, capture, charCode) =>
66-
String.fromCharCode(charCode)
67-
)
68-
6913
export const truncateText = (s: string | undefined, maxLength: number) =>
7014
!!s && s.length > maxLength ? s.substring(0, maxLength) + "..." : s

scripts/stories.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,6 @@ folder: billDetail
156156
grouping: Bill Detail
157157
figmaUrl: https://www.figma.com/file/3ifz37EOwDfmnEG8320KlD/CS1---MAPLE?node-id=180%3A7916
158158
---
159-
name: CurrentCommitteeCard
160-
folder: billDetail
161-
grouping: Bill Detail
162-
figmaUrl: https://www.figma.com/file/3ifz37EOwDfmnEG8320KlD/CS1---MAPLE?node-id=159%3A4939
163-
---
164159
name: BillStatus
165160
folder: billDetail
166161
grouping: Bill Detail

stories/organisms/billDetail/CurrentCommitteeCard.stories.tsx

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)