diff --git a/_locales/en/messages.json b/_locales/en/messages.json index c23068f07..ec921e741 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -458,9 +458,6 @@ "summary_description_not_scanned_2": { "message": "Navigate to another page and I promise I'll deliver the goods." }, - "summary_custom_settings": { - "message": "Custom Settings" - }, "summary_trust_site": { "message": "Trust Site" }, @@ -482,9 +479,6 @@ "summary_pause_ghostery_tooltip": { "message": "Pause Ghostery extension." }, - "summary_pause_ghostery_ab_pause": { - "message": "Pause" - }, "pause_30_min": { "message": "for 30 min" }, @@ -509,9 +503,6 @@ "summary_resume_ghostery_tooltip": { "message": "Ghostery extension paused. Click to resume." }, - "summary_resume_ghostery_ab_pause": { - "message": "Resume" - }, "summary_show_menu": { "message": "show menu" }, @@ -1092,6 +1083,12 @@ "page_load": { "message": "Page Load:" }, + "requests_modified": { + "message": "Requests Modified:" + }, + "requests_modified_tooltip": { + "message": "Total number of tracking requests & elements modified by Anti-Tracking and Ad Blocking" + }, "trackers_blocked": { "message": "Trackers Blocked:" }, @@ -1284,9 +1281,6 @@ "tooltip_restrict_on": { "message": "Trackers blocked and Anti-Tracking enabled on site. Click to Undo." }, - "tooltip_custom_settings": { - "message": "Use my selected tracker settings." - }, "tooltip_pause": { "message": "Pause Ghostery" }, @@ -2212,5 +2206,11 @@ }, "panel_stats_pitch_modal_tooltip": { "message": "Erase all statistics history up until this point in time." + }, + "cliqz_feature_status_on": { + "message": "On" + }, + "cliqz_feature_status_off": { + "message": "Off" } } diff --git a/app/images/panel/green-upgrade-banner-small.svg b/app/images/panel/green-upgrade-banner-small.svg new file mode 100644 index 000000000..210cc4245 --- /dev/null +++ b/app/images/panel/green-upgrade-banner-small.svg @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/app/panel/components/BuildingBlocks/CliqzFeature.jsx b/app/panel/components/BuildingBlocks/CliqzFeature.jsx new file mode 100644 index 000000000..93d786c15 --- /dev/null +++ b/app/panel/components/BuildingBlocks/CliqzFeature.jsx @@ -0,0 +1,124 @@ +/** + * Cliqz Features Component + * + * Ghostery Browser Extension + * https://www.ghostery.com/ + * + * Copyright 2019 Ghostery, Inc. All rights reserved. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0 + */ + +import React from 'react'; +import ClassNames from 'classnames'; +import Tooltip from '../Tooltip'; + +/** + * @class Implements rendering and interaction for Cliqz feature icon toggles + * @memberof PanelBuildingBlocks + */ +class CliqzFeature extends React.Component { + constructor(props) { + super(props); + + this.clickCliqzFeature = this.clickCliqzFeature.bind(this); + } + + /** + * Handles clicks on the Cliqz feature icon, toggling it on/off + */ + clickCliqzFeature() { + const { + active, + clickButton, + cliqzInactive, + type + } = this.props; + + if (cliqzInactive) { + return; + } + + const featureType = type === 'anti_track' ? 'anti_tracking' : type; + + clickButton({ + feature: `enable_${featureType}`, + status: active, + text: this._getAlertText(active, type), + }); + } + + _getStatus(active) { + return active ? t('cliqz_feature_status_on') : t('cliqz_feature_status_off'); + } + + _getTooltipBodyText(active, isTooltipBody, type) { + if (!isTooltipBody) return false; + + return active ? + t(`tooltip_${type}_body_on`) : + t(`tooltip_${type}_body`); + } + + _getTooltipHeaderText(isTooltipHeader, type) { + return isTooltipHeader ? t(`tooltip_${type}`) : false; + } + + _getAlertText(active, type) { + return active ? + t(`alert_${type}_off`) : + t(`alert_${type}_on`); + } + + /** + * React's required render function. Returns JSX + * @return {JSX} JSX for rendering a Cliqz Feature icon toggle + */ + render() { + const { + active, + cliqzInactive, + isSmaller, + isCondensed, + isTooltipBody, + isTooltipHeader, + tooltipPosition, + type, + } = this.props; + + const cliqzFeatureClassNames = ClassNames('CliqzFeature', { + 'CliqzFeature--normal': !isSmaller && !isCondensed, + 'CliqzFeature--smaller': isSmaller, + 'CliqzFeature--condensed': isCondensed, + 'CliqzFeature--active': active, + 'CliqzFeature--inactive': !active, + clickable: !cliqzInactive, + 'not-clickable': cliqzInactive, + }); + const cssTypeName = `CliqzFeature__icon--${type.replace('_', '-')}`; + const iconClassNames = ClassNames('CliqzFeature__icon', cssTypeName, 'g-tooltip'); + + const featureType = type === 'anti_track' ? 'anti_tracking' : type; + const featureName = t(`drawer_title_enable_${featureType}`); + + return ( +