From 98ebf02ca64224fd5234b7d5106a93371041af94 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 7 Aug 2016 16:36:57 -0400 Subject: [PATCH] split out tool tip to separate component --- js/component/link.js | 25 ++++++++++++++++++++++++- js/page/home.js | 3 ++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/js/component/link.js b/js/component/link.js index b38b308e3..8162d70c1 100644 --- a/js/component/link.js +++ b/js/component/link.js @@ -1,8 +1,30 @@ +var Link = React.createClass({ + handleClick: function() { + if (this.props.onClick) { + this.props.onClick(); + } + }, + render: function() { + var href = this.props.href ? this.props.href : 'javascript:;', + icon = this.props.icon ? : '', + className = (this.props.button ? 'button-block button-' + this.props.button : 'button-text') + + (this.props.hidden ? ' hidden' : '') + (this.props.disabled ? ' disabled' : '') + ' ' + this.props.className; + + return ( + + {this.props.icon ? icon : '' } + {this.props.label} + + ); + } +}); + var linkContainerStyle = { position: 'relative', }; -var Link = React.createClass({ +var ToolTipLink = React.createClass({ getInitialState: function() { return { showTooltip: false, @@ -47,6 +69,7 @@ var Link = React.createClass({ } }); + var ReturnLink = React.createClass({ render: function() { return
Featured Content
-

Community Content

+

Community Content