Skip to content

Commit

Permalink
Implement Link on Chip.js and Example.js (datafornews#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamry-bowman committed Oct 9, 2018
1 parent 4c9eca2 commit 6434f4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions react/src/components/Home/Content/Example/Chip.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from 'react'
import { Link } from 'react-router-dom';
import Chip from 'material-ui/Chip';
import Avatar from 'material-ui/Avatar';

Expand Down Expand Up @@ -26,9 +27,11 @@ export default class MyChip extends Component {
return (
<Chip
avatar={<Avatar>{avatarName}</Avatar>}
component = { Link }
label={this.props.entity.name}
onClick={this.handleClick}
style={chipStyle}
to = {`/graph/${this.props.entity.id}`}
/>
)
}
Expand Down
1 change: 0 additions & 1 deletion react/src/components/Home/Content/Example/Example.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default class Example extends Component {
handleChipClick = (entity) => {
logGraph(entity.id)
this.props.show.searchBar && ['/', '/search'].indexOf(this.props.location.pathname) > -1 && this.props.closeAll();
this.props.history.push('/graph/' + entity.id)
}

componentWillUpdate(nextProps, nextState) {
Expand Down

0 comments on commit 6434f4a

Please sign in to comment.