From 6434f4a640c0a0f94a65c8e7c61db6985b4eb054 Mon Sep 17 00:00:00 2001 From: Kamry Bowman Date: Tue, 9 Oct 2018 11:20:28 -0600 Subject: [PATCH] Implement Link on Chip.js and Example.js (#5) --- react/src/components/Home/Content/Example/Chip.js | 3 +++ react/src/components/Home/Content/Example/Example.js | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/react/src/components/Home/Content/Example/Chip.js b/react/src/components/Home/Content/Example/Chip.js index 3d9cde3..d5bac9d 100644 --- a/react/src/components/Home/Content/Example/Chip.js +++ b/react/src/components/Home/Content/Example/Chip.js @@ -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'; @@ -26,9 +27,11 @@ export default class MyChip extends Component { return ( {avatarName}} + component = { Link } label={this.props.entity.name} onClick={this.handleClick} style={chipStyle} + to = {`/graph/${this.props.entity.id}`} /> ) } diff --git a/react/src/components/Home/Content/Example/Example.js b/react/src/components/Home/Content/Example/Example.js index c29d4a7..6b8a1de 100644 --- a/react/src/components/Home/Content/Example/Example.js +++ b/react/src/components/Home/Content/Example/Example.js @@ -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) {