Skip to content

Commit fadfac8

Browse files
committed
Fix formatting
1 parent 07f0c5d commit fadfac8

18 files changed

+74
-98
lines changed

frontend/components/Details/ContentDetails/UnitContentDetails.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ type UnitContentDetailsProps = {
66
}
77

88
export default function UnitContentDetails({ unit }: UnitContentDetailsProps) {
9-
const totalComplaints =
10-
unit.total_complaints || 0
9+
const totalComplaints = unit.total_complaints || 0
1110

1211
const totalAllegations = unit.total_allegations || 0
1312

1413
const totalOfficers = unit.total_officers || 0
1514

1615
const dataSources =
17-
unit.sources?.map((source) => source.name).filter((name): name is string => Boolean(name)) ||
18-
[]
16+
unit.sources?.map((source) => source.name).filter((name): name is string => Boolean(name)) || []
1917

2018
return (
2119
<ContentDetails

frontend/components/Details/IdentityCard/UnitIdentityCard.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ function getStateName(abbreviation: string | undefined): string {
99
}
1010

1111
export default function UnitIdentityCard(unit: Unit) {
12-
const titleStr = unit.name + (unit.location && unit.location.city && unit.location.state ? ` - ${unit.location.city}, ${getStateName(unit.location.state)}` : "")
13-
12+
const titleStr =
13+
unit.name +
14+
(unit.location && unit.location.city && unit.location.state
15+
? ` - ${unit.location.city}, ${getStateName(unit.location.state)}`
16+
: "")
17+
1418
const subtitlestr = "Unit of " + (unit.agency ? unit.agency.name : "Unknown Agency")
1519

16-
const detailStr = unit.total_officers !== undefined ? `${unit.total_officers} known officers` : "Officer count not available"
20+
const detailStr =
21+
unit.total_officers !== undefined
22+
? `${unit.total_officers} known officers`
23+
: "Officer count not available"
1724

18-
return (
19-
<IdentityCard
20-
title={titleStr}
21-
subtitle={subtitlestr}
22-
detail={detailStr}
23-
/>
24-
)
25+
return <IdentityCard title={titleStr} subtitle={subtitlestr} detail={detailStr} />
2526
}

frontend/components/Details/Jurisdiction.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import DetailCard from "./DetailCard"
33
import Map from "../Map/Map"
44

55
// TODO: add jurisdiction data when available
6-
export default function Jurisdiction( { location }: { location: { latitude: number; longitude: number } }) {
6+
export default function Jurisdiction({
7+
location
8+
}: {
9+
location: { latitude: number; longitude: number }
10+
}) {
711
return (
812
<>
913
<div
@@ -15,7 +19,7 @@ export default function Jurisdiction( { location }: { location: { latitude: numb
1519
marginBottom: "16px"
1620
}}
1721
>
18-
<Typography component="h2" variant="h5" sx={{ fontSize: "1.3rem", fontWeight: "500" }}>
22+
<Typography component="h2" variant="h5" sx={{ fontSize: "1.3rem", fontWeight: "500" }}>
1923
Jurisdiction
2024
</Typography>
2125
</div>

frontend/components/Details/MostReportedOfficers.tsx

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ interface MostReportedOfficersProps {
99
total_officers?: number
1010
}
1111

12-
export default function MostReportedOfficers({ reported_officers, total_officers }: MostReportedOfficersProps) {
12+
export default function MostReportedOfficers({
13+
reported_officers,
14+
total_officers
15+
}: MostReportedOfficersProps) {
1316
const totalOfficers = total_officers || 0
1417

1518
return (
@@ -26,21 +29,21 @@ export default function MostReportedOfficers({ reported_officers, total_officers
2629
<Typography component="h2" variant="h5" sx={{ fontSize: "1.3rem", fontWeight: "500" }}>
2730
Most Reported Officers
2831
</Typography>
29-
<div
30-
style={{
31-
display: "flex",
32-
justifyContent: "space-between",
33-
alignItems: "center",
34-
flexGrow: 1
35-
}}
36-
>
37-
<Typography variant="body2" sx={{ color: "text.secondary" }}>
38-
{totalOfficers} known officers
39-
</Typography>
40-
<Link href="#" variant="body2" color="inherit">
41-
View all
42-
</Link>
43-
</div>
32+
<div
33+
style={{
34+
display: "flex",
35+
justifyContent: "space-between",
36+
alignItems: "center",
37+
flexGrow: 1
38+
}}
39+
>
40+
<Typography variant="body2" sx={{ color: "text.secondary" }}>
41+
{totalOfficers} known officers
42+
</Typography>
43+
<Link href="#" variant="body2" color="inherit">
44+
View all
45+
</Link>
46+
</div>
4447
</div>
4548
<DetailCard>
4649
{reported_officers && reported_officers.length > 0 ? (

frontend/components/Details/tabs/UnitDetailsTabs.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,19 @@ export default function UnitDetailsTabs(unit: Unit) {
1616
<Typography component="h2" variant="h5" sx={{ fontSize: "1.3rem", fontWeight: "500" }}>
1717
Leadership
1818
</Typography>
19-
<Typography variant="body1" sx={{ marginTop: "32px", marginBottom: "16px" }}>
20-
Captain
21-
</Typography>
22-
<Jurisdiction location={{ latitude: unit.location?.latitude ?? -73.9249, longitude: unit.location?.longitude ?? 40.6943 }} />
23-
<MostReportedOfficers reported_officers={unit.most_reported_officers} total_officers={unit.total_officers} />
19+
<Typography variant="body1" sx={{ marginTop: "32px", marginBottom: "16px" }}>
20+
Captain
21+
</Typography>
22+
<Jurisdiction
23+
location={{
24+
latitude: unit.location?.latitude ?? -73.9249,
25+
longitude: unit.location?.longitude ?? 40.6943
26+
}}
27+
/>
28+
<MostReportedOfficers
29+
reported_officers={unit.most_reported_officers}
30+
total_officers={unit.total_officers}
31+
/>
2432
<Attachments />
2533
</>
2634
)

frontend/components/Map/Map.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@ export default function MapComponent({ center, zoom }: MapProps) {
3232
// allow zoom, but always around the map center
3333
scrollZoom: { around: "center" },
3434
touchZoomRotate: { around: "center" },
35-
doubleClickZoom: true,
35+
doubleClickZoom: true
3636
})
3737

3838
map.touchZoomRotate.disableRotation()
3939

40-
const marker = new Marker()
41-
.setLngLat(center)
42-
.addTo(map)
40+
const marker = new Marker().setLngLat(center).addTo(map)
4341

4442
mapRef.current = map
4543
markerRef.current = marker
@@ -62,10 +60,5 @@ export default function MapComponent({ center, zoom }: MapProps) {
6260
marker.setLngLat(center)
6361
}, [center, zoom])
6462

65-
return (
66-
<div
67-
ref={mapContainerRef}
68-
style={{ width: "100%", height: "300px" }}
69-
/>
70-
)
71-
}
63+
return <div ref={mapContainerRef} style={{ width: "100%", height: "300px" }} />
64+
}

frontend/components/officer/OfficerListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ export default function OfficerListItem({
2525
<OfficerResultContent result={officer} />
2626
</ResultCardShell>
2727
)
28-
}
28+
}

frontend/components/search/ResultCardShell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ export default function ResultCardShell({
4848
</CardActionArea>
4949
</Card>
5050
)
51-
}
51+
}

frontend/components/search/SearchResultCard.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,11 @@ export default function SearchResultCard({
1919
showMeta = true
2020
}: SearchResultCardProps) {
2121
return (
22-
<ResultCardShell
23-
href={getResultHref(result)}
24-
isFirst={isFirst}
25-
isLast={isLast}
26-
>
22+
<ResultCardShell href={getResultHref(result)} isFirst={isFirst} isLast={isLast}>
2723
<Box sx={{ display: "flex", flexDirection: "column", gap: 1.5 }}>
2824
<SearchResultContent result={result} />
2925
{showMeta && <SearchResultMeta result={result} />}
3026
</Box>
3127
</ResultCardShell>
3228
)
33-
}
29+
}

frontend/components/search/SearchResultMeta.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ export default function SearchResultMeta({ result }: SearchResultMetaProps) {
1919
</Box>
2020
</Box>
2121
)
22-
}
22+
}

0 commit comments

Comments
 (0)