File tree Expand file tree Collapse file tree 5 files changed +16
-20
lines changed Expand file tree Collapse file tree 5 files changed +16
-20
lines changed Original file line number Diff line number Diff line change @@ -102,8 +102,7 @@ const useSearchStatus = () => {
102
102
const Layout : FC <
103
103
React . PropsWithChildren < { items : SortByWithConfigurationItem [ ] } >
104
104
> = ( { items } ) => {
105
- const courtRefinements = useBillRefinements ( 1 )
106
- const refinements = useBillRefinements ( 2 )
105
+ const refinements = useBillRefinements ( )
107
106
const hierarchicalMenu = useBillHierarchicalMenu ( )
108
107
const status = useSearchStatus ( )
109
108
@@ -116,15 +115,13 @@ const Layout: FC<
116
115
</ Row >
117
116
< Row >
118
117
< Col xs = { 3 } lg = { 3 } >
119
- { courtRefinements . options }
120
118
{ hierarchicalMenu . options }
121
119
{ refinements . options }
122
120
</ Col >
123
121
< Col className = "d-flex flex-column" >
124
122
< RefinementRow >
125
123
< ResultCount className = "flex-grow-1 m-1" />
126
124
< SortBy items = { items } />
127
- { courtRefinements . show }
128
125
{ hierarchicalMenu . show }
129
126
{ refinements . show }
130
127
</ RefinementRow >
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ import { useRefinements } from "../useRefinements"
16
16
// attribute: "court",
17
17
// searchablePlaceholder: "Legislative Session",
18
18
19
- export const useBillRefinements = ( list : Number ) => {
19
+ export const useBillRefinements = ( ) => {
20
20
const baseProps = { limit : 500 , searchable : true }
21
- const propsList1 = [
21
+ const propsList = [
22
22
{
23
23
transformItems : useCallback (
24
24
( i : RefinementListItem [ ] ) =>
@@ -33,9 +33,7 @@ export const useBillRefinements = (list: Number) => {
33
33
attribute : "court" ,
34
34
searchablePlaceholder : "Legislative Session" ,
35
35
...baseProps
36
- }
37
- ]
38
- const propsList2 = [
36
+ } ,
39
37
{
40
38
attribute : "currentCommittee" ,
41
39
...baseProps ,
@@ -58,12 +56,5 @@ export const useBillRefinements = (list: Number) => {
58
56
}
59
57
]
60
58
61
- let propsList = [ ]
62
- if ( list === 1 ) {
63
- propsList = propsList1
64
- } else {
65
- propsList = propsList2
66
- }
67
-
68
59
return useRefinements ( { refinementProps : propsList } )
69
60
}
Original file line number Diff line number Diff line change
1
+ import { useTranslation } from "next-i18next"
1
2
import { useInstantSearch } from "react-instantsearch"
2
3
import { faFilter } from "@fortawesome/free-solid-svg-icons"
3
4
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
@@ -42,13 +43,15 @@ export const useHierarchicalMenu = ({
42
43
)
43
44
const hasRefinements = useHasRefinements ( )
44
45
46
+ const { t } = useTranslation ( "billSearch" )
47
+
45
48
return {
46
49
options : inline ? (
47
50
< div > { hierarchicalMenu } </ div >
48
51
) : (
49
52
< Offcanvas show = { show } onHide = { handleClose } >
50
53
< Offcanvas . Header closeButton >
51
- < Offcanvas . Title > Filter </ Offcanvas . Title >
54
+ < Offcanvas . Title > { t ( "topics" ) } </ Offcanvas . Title >
52
55
</ Offcanvas . Header >
53
56
< Offcanvas . Body >
54
57
< SearchContainer > { hierarchicalMenu } </ SearchContainer >
@@ -62,7 +65,7 @@ export const useHierarchicalMenu = ({
62
65
onClick = { handleOpen }
63
66
className = { hasRefinements ? "ais-FilterButton-has-refinements" : "" }
64
67
>
65
- < FontAwesomeIcon icon = { faFilter } /> Filter
68
+ < FontAwesomeIcon icon = { faFilter } /> { t ( "topics" ) }
66
69
</ FilterButton >
67
70
)
68
71
}
Original file line number Diff line number Diff line change
1
+ import { useTranslation } from "next-i18next"
1
2
import { RefinementList , useInstantSearch } from "react-instantsearch"
2
3
import { faFilter } from "@fortawesome/free-solid-svg-icons"
3
4
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
@@ -39,13 +40,15 @@ export const useRefinements = ({
39
40
)
40
41
const hasRefinements = useHasRefinements ( )
41
42
43
+ const { t } = useTranslation ( "billSearch" )
44
+
42
45
return {
43
46
options : inline ? (
44
47
< div > { refinements } </ div >
45
48
) : (
46
49
< Offcanvas show = { show } onHide = { handleClose } >
47
50
< Offcanvas . Header closeButton >
48
- < Offcanvas . Title > Filter </ Offcanvas . Title >
51
+ < Offcanvas . Title > { t ( "filter" ) } </ Offcanvas . Title >
49
52
</ Offcanvas . Header >
50
53
< Offcanvas . Body >
51
54
< SearchContainer > { refinements } </ SearchContainer >
@@ -59,7 +62,7 @@ export const useRefinements = ({
59
62
onClick = { handleOpen }
60
63
className = { hasRefinements ? "ais-FilterButton-has-refinements" : "" }
61
64
>
62
- < FontAwesomeIcon icon = { faFilter } /> Filter
65
+ < FontAwesomeIcon icon = { faFilter } /> { t ( "filter" ) }
63
66
</ FilterButton >
64
67
)
65
68
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"another_term" : " Try another search term" ,
3
3
"browse_bills" : " Browse Bills" ,
4
+ "filter" : " Filter" ,
5
+ "topics" : " Topics" ,
4
6
"zero_results" : " Your search has yielded zero results!"
5
7
}
You can’t perform that action at this time.
0 commit comments