File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
components/search/testimony Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { useAuth } from "components/auth"
8
8
import { useBill } from "components/db/bills"
9
9
import { Testimony } from "components/db/testimony"
10
10
import { useFlags } from "components/featureFlags"
11
- import { formatBillId } from "components/formatting"
11
+ import { formatBillId , truncateText } from "components/formatting"
12
12
import { maple } from "components/links"
13
13
import { FollowUserButton } from "components/shared/FollowButton"
14
14
import { trimContent } from "components/TestimonyCallout/TestimonyCallout"
@@ -48,13 +48,6 @@ const TestimonyResult = ({ hit }: { hit: Hit<Testimony> }) => {
48
48
const isCurrentUser = user ?. uid === hit . authorUid
49
49
const isMobile = useMediaQuery ( "(max-width: 768px)" )
50
50
51
- function limitStringLength35Char ( str : string ) {
52
- if ( str . length > 35 ) {
53
- return str . substring ( 0 , 35 ) + "..."
54
- }
55
- return str
56
- }
57
-
58
51
return (
59
52
< div
60
53
style = { {
@@ -114,9 +107,7 @@ const TestimonyResult = ({ hit }: { hit: Hit<Testimony> }) => {
114
107
padding : "5px 10px"
115
108
} }
116
109
>
117
- { isMobile
118
- ? limitStringLength35Char ( committee . name )
119
- : committee . name }
110
+ { isMobile ? truncateText ( committee . name , 35 ) : committee . name }
120
111
</ span >
121
112
) }
122
113
</ div >
You can’t perform that action at this time.
0 commit comments