File tree Expand file tree Collapse file tree 2 files changed +25
-11
lines changed Expand file tree Collapse file tree 2 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import { SmartDisclaimer } from "./SmartDisclaimer"
8
8
import { SmartIcon } from "./SmartIcon"
9
9
import { TestimonyCounts } from "./TestimonyCounts"
10
10
import { BillProps } from "./types"
11
+ import { currentGeneralCourt } from "functions/src/shared"
12
+ import { BillTopic } from "functions/src/bills/types"
11
13
12
14
const SummaryContainer = styled ( Container ) `
13
15
background-color: white;
@@ -49,17 +51,21 @@ const SmartTagButton = styled.button`
49
51
font-size: 12px;
50
52
`
51
53
52
- const SmartTag = ( { icon , tagName } : { icon : String ; tagName : String } ) => {
54
+ const SmartTag = ( { topic } : { topic : BillTopic } ) => {
53
55
return (
54
- < SmartTagButton
55
- className = { `btn btn-secondary d-flex text-nowrap mt-1 mx-1 p-1` }
56
+ < links . Internal
57
+ href = { links . billSearchByTopicLink ( currentGeneralCourt , topic ) }
56
58
>
57
-
58
- < SmartIcon icon = { icon } />
59
-
60
- { tagName }
61
-
62
- </ SmartTagButton >
59
+ < SmartTagButton
60
+ className = { `btn btn-secondary d-flex text-nowrap mt-1 mx-1 p-1` }
61
+ >
62
+
63
+ < SmartIcon icon = { topic . category } />
64
+
65
+ { topic . topic }
66
+
67
+ </ SmartTagButton >
68
+ </ links . Internal >
63
69
)
64
70
}
65
71
@@ -134,7 +140,7 @@ export const Summary = ({
134
140
< Row className = "mx-1 mb-3" > { bill . summary } </ Row >
135
141
< Row className = { `d-flex mx-0 my-1` } xs = "auto" >
136
142
{ bill . topics ?. map ( t => (
137
- < SmartTag key = { t . topic } icon = { t . category } tagName = { t . topic } />
143
+ < SmartTag key = { t . topic } topic = { t } />
138
144
) ) }
139
145
</ Row >
140
146
</ >
Original file line number Diff line number Diff line change 1
1
import Link from "next/link"
2
2
import { forwardRef , PropsWithChildren } from "react"
3
- import { CurrentCommittee } from "../functions/src/bills/types"
3
+ import { BillTopic , CurrentCommittee } from "../functions/src/bills/types"
4
4
import { Testimony } from "components/db/testimony"
5
5
import { Bill , MemberContent } from "./db"
6
6
import { formatBillId } from "./formatting"
@@ -130,3 +130,11 @@ export const twitterShareLink = (publication: Testimony, t: TFunction) => {
130
130
131
131
return tweetUrl
132
132
}
133
+
134
+ export const billSearchByTopicLink = ( court : number , topic : BillTopic ) => {
135
+ const params = {
136
+ "bills/sort/latestTestimonyAt:desc[multiselectHierarchicalMenu][topics.lvl1][0]" : `${ topic . category } > ${ topic . topic } ` ,
137
+ "bills/sort/latestTestimonyAt:desc[refinementList][court][0]" : `${ court } `
138
+ }
139
+ return `/bills?${ new URLSearchParams ( params ) . toString ( ) } `
140
+ }
You can’t perform that action at this time.
0 commit comments