-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from BadIdeaFactory/30-31-layout-and-stubs
Add basic layout and stub out components
- Loading branch information
Showing
34 changed files
with
2,311 additions
and
1,703 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Will describe the line graph of entity frequency. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import { withRouter } from 'react-router-dom' | ||
import styled from 'styled-components' | ||
|
||
const EntityFrequencyRow = (props) => { | ||
const { | ||
history, label, total, recent, | ||
} = props | ||
|
||
const selectEntity = () => { | ||
history.push(`/detail?entity=${label}`) | ||
} | ||
|
||
return ( | ||
<StyledEntityFrequencyRow onClick={selectEntity}> | ||
<td className="label">{label}</td> | ||
<td className="total">{total}</td> | ||
<td className="recent">{recent}</td> | ||
</StyledEntityFrequencyRow> | ||
) | ||
} | ||
EntityFrequencyRow.propTypes = { | ||
label: PropTypes.string.isRequired, | ||
total: PropTypes.number.isRequired, | ||
recent: PropTypes.number.isRequired, | ||
history: PropTypes.shape({ | ||
push: PropTypes.func, | ||
}).isRequired, | ||
} | ||
|
||
const StyledEntityFrequencyRow = styled.tr` | ||
&:hover > td { | ||
cursor: pointer; | ||
color: white; | ||
background-color: #eb5757; | ||
} | ||
.recent { | ||
background-color: #fefaee; | ||
} | ||
` | ||
|
||
export default withRouter(EntityFrequencyRow) |
Oops, something went wrong.