From a2641c1a98b996af8ba0743aa3e24b99c877cf97 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Mon, 9 Jan 2017 05:43:57 -0500 Subject: [PATCH] Add support for custom conteint in Before you could only specify an icon and text label. --- js/component/file-tile.js | 2 +- js/component/link.js | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/js/component/file-tile.js b/js/component/file-tile.js index 8690ba5fd..88ce9f55d 100644 --- a/js/component/file-tile.js +++ b/js/component/file-tile.js @@ -163,7 +163,7 @@ let FileTile = React.createClass({
{this.props.metadata.content_type.startsWith('video/') ? : null} {!this.props.isMine - ? + ? : null}

diff --git a/js/component/link.js b/js/component/link.js index cab18a39b..a667dabdd 100644 --- a/js/component/link.js +++ b/js/component/link.js @@ -33,16 +33,27 @@ export let Link = React.createClass({ (!this.props.className && !this.props.button ? 'button-text' : '') + (this.props.disabled ? ' disabled' : ''); + let content; + if (this.props.children) { // Custom content + content = this.props.children; + } else { + content = ( + + {'icon' in this.props + ? + : null} + {this.props.label} + {'badge' in this.props + ? {this.props.badge} + : null} + + ); + } + return ( - {'icon' in this.props - ? - : null} - {this.props.label} - {'badge' in this.props - ? {this.props.badge} - : null} + {content} ); }