Skip to content

Commit

Permalink
Version 1.1 (#4)
Browse files Browse the repository at this point in the history
Minor fixes and README written

Deploy

Fix vulnerabilities

Cleanup
  • Loading branch information
pedsm authored Dec 10, 2019
1 parent b29128d commit d215e7e
Show file tree
Hide file tree
Showing 7 changed files with 4,603 additions and 2,992 deletions.
Binary file modified .github/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 19 additions & 19 deletions components/crime.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import React from 'react'

export default class Crime extends React.Component {
cleanDashCase(dashCase) {
const s = dashCase.split('-').join(' ')
return s[0].toUpperCase() + s.slice(1)
}
cleanDashCase(dashCase) {
const s = dashCase.split('-').join(' ')
return s[0].toUpperCase() + s.slice(1)
}

render() {
const { crime } = this.props
return (
<article className="media">
<div className="media-content">
<div className="content">
<p><strong>{this.cleanDashCase(crime.category)}</strong></p>
<p>{crime.location.street.name} <br />
{crime.outcome_status == null ? "🔎 No outcome avaliable" : "🧐" + crime.outcome_status.category}
</p>
</div>
</div>
</article>
)
}
render() {
const { crime } = this.props
return (
<article className="media">
<div className="media-content">
<div className="content">
<p><strong>{this.cleanDashCase(crime.category)}</strong></p>
<p>{crime.location.street.name} <br />
{crime.outcome_status == null ? "🔎 No outcome avaliable" : "🧐" + crime.outcome_status.category}
</p>
</div>
</div>
</article>
)
}
}
37 changes: 19 additions & 18 deletions components/stats.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import React, {Fragment} from 'react'
import React, { Fragment } from 'react'

export default class Level extends React.Component {
render() {
const { crimes, postcode } = this.props
return (
<nav className="level">
<p className="level-item has-text-centered">
{(() => {
if (crimes.length == 0 && postcode == '') {
return 'Please enter your postcode'
} else if (crimes.length == 0) {
return (<>No records found for <strong>{postcode.toUpperCase()}</strong></>)
}
return (<><strong>{crimes.length}</strong>&nbsp;records found for <strong>{postcode.toUpperCase()}</strong></>)
})()}
</p>
</nav>
)
}
render() {
const { crimes
, postcode } = this.props
return (
<nav className="level">
<p className="level-item has-text-centered">
{(() => {
if (crimes.length == 0 && postcode == '') {
return 'Please enter your postcode'
} else if (crimes.length == 0) {
return (<span>No records found for <strong>{postcode.toUpperCase()}</strong></span>)
}
return (<span><strong>{crimes.length}</strong>&nbsp;records found for <strong>{postcode.toUpperCase()}</strong></span>)
})()}
</p>
</nav>
)
}
}
Loading

1 comment on commit d215e7e

@vercel
Copy link

@vercel vercel bot commented on d215e7e Dec 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.