From 8282985bd9ba6160abe1244dc0b0022c0c78a220 Mon Sep 17 00:00:00 2001 From: Roman Kuznetsov Date: Thu, 12 Jan 2023 04:09:52 +0500 Subject: [PATCH] fix: add inactive ViewInBrowser icon --- .../index.js} | 19 +++++++++---- .../icons/view-in-browser/index.styl | 28 +++++++++++++++++++ lib/static/styles.css | 4 --- 3 files changed, 41 insertions(+), 10 deletions(-) rename lib/static/components/icons/{view-in-browser.js => view-in-browser/index.js} (76%) create mode 100644 lib/static/components/icons/view-in-browser/index.styl diff --git a/lib/static/components/icons/view-in-browser.js b/lib/static/components/icons/view-in-browser/index.js similarity index 76% rename from lib/static/components/icons/view-in-browser.js rename to lib/static/components/icons/view-in-browser/index.js index 00083d71f..398308ee8 100644 --- a/lib/static/components/icons/view-in-browser.js +++ b/lib/static/components/icons/view-in-browser/index.js @@ -5,15 +5,17 @@ import PropTypes from 'prop-types'; import url from 'url'; import classNames from 'classnames'; -import * as actions from '../../modules/actions'; +import * as actions from '../../../modules/actions'; + +import './index.styl'; class ViewInBrowser extends Component { static propTypes = { resultId: PropTypes.string.isRequired, extendClassNames: PropTypes.oneOfType([PropTypes.array, PropTypes.string]), // from store - suiteUrl: PropTypes.string.isRequired, - parsedHost: PropTypes.object.isRequired + suiteUrl: PropTypes.string, + parsedHost: PropTypes.object } onViewInBrowser = (e) => { @@ -31,18 +33,23 @@ class ViewInBrowser extends Component { render() { const {suiteUrl, parsedHost, extendClassNames} = this.props; const className = classNames( - 'button custom-icon custom-icon_view-in-browser', + 'fa view-in-browser', + suiteUrl ? 'fa-eye view-in-browser_active' : 'fa-eye-slash view-in-browser_disabled', extendClassNames ); + if (!suiteUrl) { + return