From b97703dc3c12c61c9a4916860474723caa18439f Mon Sep 17 00:00:00 2001
From: 6ea86b96 <6ea86b96@gmail.com>
Date: Tue, 2 May 2017 12:25:31 +0700
Subject: [PATCH] Refactor UriIndicator
---
ui/js/component/channel-indicator.js | 43 ------------------------
ui/js/component/fileCardStream/view.jsx | 5 ++-
ui/js/component/fileTileStream/view.jsx | 4 ++-
ui/js/component/uriIndicator/index.js | 20 +++++++++++
ui/js/component/uriIndicator/view.jsx | 44 +++++++++++++++++++++++++
ui/js/page/showPage/view.jsx | 7 ++--
6 files changed, 72 insertions(+), 51 deletions(-)
delete mode 100644 ui/js/component/channel-indicator.js
create mode 100644 ui/js/component/uriIndicator/index.js
create mode 100644 ui/js/component/uriIndicator/view.jsx
diff --git a/ui/js/component/channel-indicator.js b/ui/js/component/channel-indicator.js
deleted file mode 100644
index e19850c28..000000000
--- a/ui/js/component/channel-indicator.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import React from 'react';
-import lbry from '../lbry.js';
-import lbryuri from '../lbryuri.js';
-import {Icon} from './common.js';
-
-const UriIndicator = React.createClass({
- propTypes: {
- uri: React.PropTypes.string.isRequired,
- hasSignature: React.PropTypes.bool.isRequired,
- signatureIsValid: React.PropTypes.bool,
- },
- render: function() {
-
- const uriObj = lbryuri.parse(this.props.uri);
-
- if (!this.props.hasSignature || !uriObj.isChannel) {
- return Anonymous;
- }
-
- const channelUriObj = Object.assign({}, uriObj);
- delete channelUriObj.path;
- delete channelUriObj.contentName;
- const channelUri = lbryuri.build(channelUriObj, false);
-
- let icon, modifier;
- if (this.props.signatureIsValid) {
- modifier = 'valid';
- } else {
- icon = 'icon-times-circle';
- modifier = 'invalid';
- }
- return (
-
- {channelUri} {' '}
- { !this.props.signatureIsValid ?
-