Skip to content

Commit

Permalink
Merge pull request #804 from 18F/bjs-more-agency-fixes
Browse files Browse the repository at this point in the history
agency content tweaks
  • Loading branch information
jeremiak authored Jun 1, 2017
2 parents dd233a8 + 206c5dd commit 02ff1f5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
10 changes: 7 additions & 3 deletions src/components/AgencyChartContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,22 @@ const getContent = ({ crime, place, since, summary, until }) => {
}

const AgencyChartContainer = params => {
const { agency, crime, since, until } = params
const { agency, crime, since, summary, until } = params
const content = getContent(params)

return (
<div>
<div className="mb2 p2 sm-p4 bg-white border-top border-blue border-w8">
<div className="mb5">
<div className="p2 sm-p4 bg-white border-top border-blue border-w8">
<h2 className="mt0 mb3 fs-24 sm-fs-32 sans-serif">
{startCase(crime)} incidents reported by{' '}
{agency.display}, {since}-{until}
</h2>
{content}
</div>
{!summary.loading &&
<div className="mt2 fs-12 serif italic">
Source: Reported incident-based (NIBRS) data from {agency.display}
</div>}
</div>
)
}
Expand Down
28 changes: 13 additions & 15 deletions src/components/NibrsContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,15 @@ const NibrsContainer = ({
content = <ErrorCard error={error} />
}

const placeDisplay = placeType === 'agency'
? agency.display
: startCase(place)

return (
<div>
<div className="mb8">
<div className="mb2 p2 sm-p4 bg-white border-top border-blue border-w8">
<h2 className="mt0 mb1 fs-24 sm-fs-28 sans-serif">
{startCase(crime)} incident details in{' '}
{placeType === 'agency' ? agency.display : startCase(place)}
{startCase(crime)} incident details reported by {placeDisplay}
</h2>
{nibrsFirstYear !== since &&
<p className="my-tiny">
Expand All @@ -99,23 +102,18 @@ const NibrsContainer = ({
</p>}
{!error &&
data &&
<p className="m0">
There were {formatNumber(totalCount)} individual {crime} incidents
reported to the FBI in {startCase(place)}{' '}
between {nibrsFirstYear} and {until} by agencies reporting{' '}
{nibrsTerm} data. The charts below feature{' '}
<Term id="unestimated data">unestimated</Term>{' '}
data. Learn more about the{' '}
<p className="m0 sm-col-9">
There were <strong>{formatNumber(totalCount)}</strong> incidents
of {crime} reported to the UCR Program between {nibrsFirstYear}{' '}
and {until}. Learn more about the{' '}
<a className="underline" href={fbiLink}>FBI’s data collections</a>.
</p>}
</div>
{content}
{!loading &&
<div className="center italic fs-12 mb8">
<p>
Source: Reported {nibrsTerm} data from {startCase(place)},{' '}
{nibrsFirstYear}{until}.
</p>
<div className="mt2 fs-12 serif italic">
Source: Reported {nibrsTerm} data from {placeDisplay},{' '}
{nibrsFirstYear}{until}.
</div>}
</div>
)
Expand Down

0 comments on commit 02ff1f5

Please sign in to comment.