From a01917d18443485587b33817e221406c323922bc Mon Sep 17 00:00:00 2001 From: Caleb Richelson Date: Mon, 10 Jun 2019 16:52:10 -0400 Subject: [PATCH 1/2] Remove count from Cliqz Features, replace with ON/OFF indicator --- .../BuildingBlocks/CliqzFeature.jsx | 25 ++---------- app/scss/partials/_cliqz_feature.scss | 38 +++++-------------- app/scss/partials/_svgs.scss | 5 --- 3 files changed, 13 insertions(+), 55 deletions(-) diff --git a/app/panel/components/BuildingBlocks/CliqzFeature.jsx b/app/panel/components/BuildingBlocks/CliqzFeature.jsx index 9c97b1aa3..d967ab95f 100644 --- a/app/panel/components/BuildingBlocks/CliqzFeature.jsx +++ b/app/panel/components/BuildingBlocks/CliqzFeature.jsx @@ -50,28 +50,9 @@ class CliqzFeature extends React.Component { }); } - _getCount(active, data, type) { - if (!active) { - return '-'; - } - - if (type === 'anti_track') { - return data && data.totalUnsafeCount || 0; - } else if (type === 'ad_block') { - return data && data.totalCount || 0; - } else if (type === 'smart_block') { - return this._count(data, data.blocked) + this._count(data, data.unblocked); - } - - return 0; + _getStatus(active) { + return active ? t('drawer_on') : t('drawer_off'); } - _count(object, property) { - return object && this._length(property) || 0; - } - _length(object) { - return Object.keys(object).length; - } - _getTooltipBodyText(active, isTooltipBody, type) { if (!isTooltipBody) return false; @@ -125,7 +106,7 @@ class CliqzFeature extends React.Component { return (
-
{this._getCount(active, data, type)}
+
{this._getStatus(active)}
%3Ccircle%20cx%3D%227%22%20cy%3D%227%22%20r%3D%226%22%20stroke-width%3D%222%22%20stroke%3D%22#{url-friendly-colour($stroke-color)}%22%20fill%3D%22none%22/%3E%3C/svg%3E'); From c7277843a9337a14da1719f8eeed31572c2b602d Mon Sep 17 00:00:00 2001 From: ilyazarembsky Date: Mon, 10 Jun 2019 19:52:06 -0400 Subject: [PATCH 2/2] Stop passing now unneeded data prop to CliqzFeature --- app/panel/components/BuildingBlocks/CliqzFeature.jsx | 1 - app/panel/components/Summary.jsx | 6 ------ 2 files changed, 7 deletions(-) diff --git a/app/panel/components/BuildingBlocks/CliqzFeature.jsx b/app/panel/components/BuildingBlocks/CliqzFeature.jsx index d967ab95f..6ded5c7d0 100644 --- a/app/panel/components/BuildingBlocks/CliqzFeature.jsx +++ b/app/panel/components/BuildingBlocks/CliqzFeature.jsx @@ -80,7 +80,6 @@ class CliqzFeature extends React.Component { const { active, cliqzInactive, - data, isSmaller, isCondensed, isTooltipBody, diff --git a/app/panel/components/Summary.jsx b/app/panel/components/Summary.jsx index dc641a43e..658876818 100644 --- a/app/panel/components/Summary.jsx +++ b/app/panel/components/Summary.jsx @@ -585,7 +585,6 @@ class Summary extends React.Component { _renderCliqzAntiTracking() { const { - antiTracking, enable_anti_tracking, is_expert, } = this.props; @@ -596,7 +595,6 @@ class Summary extends React.Component {