Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate for Testing — GH-1975 Theme Framework, Leaf & Palm Themes #523

Closed
wants to merge 47 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
317ab64
Replace themes toggle with radio buttons
benstrumeyer Mar 11, 2020
f050b83
Center inner circle in radio buttons
benstrumeyer Mar 11, 2020
e8d7f92
Merge branch 'develop' into GH-1967/themes-panel-update
benstrumeyer Mar 12, 2020
f9b1546
Remove console error
benstrumeyer Mar 12, 2020
a9a12aa
Testing switching between themes
benstrumeyer Mar 18, 2020
fc61494
Add configuration that points to local account server
benstrumeyer Mar 18, 2020
05a37b3
Initial checkin
zarembsky Mar 19, 2020
0e0beef
Adding local themes
zarembsky Mar 19, 2020
8a66ff9
Adding comments.
zarembsky Mar 19, 2020
1ff8eb4
Fix (sort of)
zarembsky Mar 19, 2020
60cfc91
Real fix
zarembsky Mar 19, 2020
05f8718
Remove unneeded call
zarembsky Mar 19, 2020
824b2a3
Create theme framework and palm theme
benstrumeyer Mar 26, 2020
d36fd1a
Create palm theme svgs
benstrumeyer Mar 26, 2020
260c627
Add antiTracking, adBlocking and smartBlocking tracker counts to Cliq…
benstrumeyer Mar 26, 2020
8660643
Merge branch 'develop' into palm-theme
benstrumeyer Mar 26, 2020
d22b752
Remove console logs
benstrumeyer Mar 26, 2020
0fb546b
Get theme css from account project
benstrumeyer Mar 26, 2020
2a8bce2
Clean up radio button code
benstrumeyer Mar 31, 2020
2a58c29
Use context to pass theme
benstrumeyer Mar 31, 2020
37829c9
Merge branch 'develop' into feature/palm-theme
benstrumeyer Mar 31, 2020
2e44e44
Point to regular servers
benstrumeyer Mar 31, 2020
fc1a2a3
Remove local testing code
benstrumeyer Mar 31, 2020
1bbc72d
Uncomment function
benstrumeyer Mar 31, 2020
d0ec9be
Merge branch 'develop' into GH-1967/themes-panel-update
benstrumeyer Mar 31, 2020
bc90f18
Merge branch 'GH-1967/themes-panel-update' into feature/palm-theme
benstrumeyer Apr 1, 2020
5350c2b
Get database files from develop branch
benstrumeyer Apr 1, 2020
c1748dd
Get click2play from develop branch
benstrumeyer Apr 1, 2020
feb29b0
Delete leaf svg and png
benstrumeyer Apr 1, 2020
f08ff58
Style historical stats graph for leaf theme
benstrumeyer Apr 1, 2020
6bf02dd
Add leaf-theme tracker-list icons
benstrumeyer Apr 1, 2020
233d774
Refactor tracker-count status to account for leaf theme
benstrumeyer Apr 1, 2020
02671ef
Prep branch for testing
benstrumeyer Apr 6, 2020
5bf8902
Finalize leaf theme
benstrumeyer Apr 6, 2020
9334ab7
Use theme scss files as single source of truth for icon colors
benstrumeyer Apr 10, 2020
5a348ba
Refactor trackerButtons to use css fill and stroke colors. Use absolu…
benstrumeyer Apr 10, 2020
8805349
Remove antiTracking, adBlocking, and smartBlocking tracker counts to …
benstrumeyer Apr 10, 2020
d490c4b
Delete unused svgs
benstrumeyer Apr 10, 2020
f1aae45
Prevent tracker list styling from bleeding
benstrumeyer Apr 10, 2020
10e7c01
Style subscriber badge, and caret for palm-theme
benstrumeyer Apr 13, 2020
a2c4c53
Change subscriber badge fill color
benstrumeyer Apr 13, 2020
f9eb0e1
Refactor _renderCaret
benstrumeyer Apr 13, 2020
34e1831
Move stroke and fill colors into scss and removed fill/stroke attribu…
benstrumeyer Apr 13, 2020
3c44fef
Refactor trackerButtonRenderHelpers
benstrumeyer Apr 13, 2020
95b1c13
Remove empty object in StatsContainer
benstrumeyer Apr 13, 2020
6f864d8
Use css to style statsGraph point and line
benstrumeyer Apr 13, 2020
8519747
Merge branch 'develop' into testable-theme-framework
benstrumeyer Apr 14, 2020
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Style subscriber badge, and caret for palm-theme

  • Loading branch information
benstrumeyer committed Apr 13, 2020
commit 10e7c01e856eccd6f9a7b8d43da550f612edc26e
@@ -12,6 +12,8 @@
*/

import React from 'react';
import ClassNames from 'classnames';
import { ThemeContext } from '../../contexts/ThemeContext';
import Trackers from './Trackers';

/**
@@ -21,6 +23,8 @@ import Trackers from './Trackers';
* @memberOf BlockingComponents
*/
class Category extends React.Component {
static contextType = ThemeContext;

constructor(props) {
super(props);
this.state = {
@@ -153,6 +157,30 @@ class Category extends React.Component {
}
}

_renderCaret() {
const { isExpanded } = this.state;
const { isUnknown } = this.props;
// const caretClasses = (this.state.isExpanded ? 'caret-up' : 'caret-down') + (isUnknown ? ' Category__antiTrackingCaret' : '');
const caretClasses = ClassNames(this.context, {
Comment on lines +163 to +164

This comment has been minimized.

@wlycdgr

wlycdgr Apr 13, 2020
Member

Did you mean to leave this?

This comment has been minimized.

@benstrumeyer

benstrumeyer Apr 13, 2020
Author Contributor

Ah, I did not. Deleted!

'caret-down': isExpanded,
'caret-up': !isExpanded,
Category__antiTrackingCaret: isUnknown
});
if (isExpanded) {
return (
<svg className={caretClasses} onClick={this.toggleCategoryTrackers} width="11" height="7" viewBox="0 0 11 7" xmlns="http://www.w3.org/2000/svg">
<path d="M1.21.02L-.02 1.25l5.27 5.27 5.27-5.27L9.29.02 5.25 4.06" fillRule="evenodd" />
</svg>
);
}
return (
<svg className={caretClasses} onClick={this.toggleCategoryTrackers} width="11" height="7" viewBox="0 0 11 7" xmlns="http://www.w3.org/2000/svg">
<path d="M1.283 7L0 5.676 5.5 0 11 5.676 9.717 7 5.5 2.649z" fillRule="evenodd" />
</svg>
);
// 4a4a4a

This comment has been minimized.

@wlycdgr

wlycdgr Apr 13, 2020
Member

Can be deleted?

This comment has been minimized.

@benstrumeyer

benstrumeyer Apr 13, 2020
Author Contributor

yes it can!

This conversation was marked as resolved by Eden12345
Comment on lines +169 to +181

This comment has been minimized.

@Eden12345

Eden12345 Apr 13, 2020
Contributor

You only need to change the <path /> element's attributes here depending on the isExpanded bool, so the ternary can go inside of the <svg /> tags to avoid repeat code.

Also, the // 4a4a4a comment looks like it can be removed.

This comment has been minimized.

@benstrumeyer

benstrumeyer Apr 13, 2020
Author Contributor

I didn't notice the SVG's were that similar! Good refactor, also removed the 4a4a4a (sorry!)

}

/**
* Render a list of categories. Pass globalBlocking flag to all trackers
* in the category so that they would know which view they are part of.
@@ -169,7 +197,8 @@ class Category extends React.Component {
const globalBlocking = !!this.props.globalBlocking;

const checkBoxStyle = `${(this.state.totalShownBlocked && this.state.allShownBlocked) ? 'all-blocked ' : (this.state.totalShownBlocked ? 'some-blocked ' : '')} checkbox-container`;
const caretClasses = (this.state.isExpanded ? 'caret-up' : 'caret-down') + (isUnknown ? ' Category__antiTrackingCaret' : '');
// const caretClasses = (this.state.isExpanded ? 'caret-up' : 'caret-down') + (isUnknown ? ' Category__antiTrackingCaret' : '');
// const caretClasses = (this.state.isExpanded ? this._renderCaret('up') : this._renderCaret('down'));
Comment on lines +200 to +201

This comment has been minimized.

@wlycdgr

wlycdgr Apr 13, 2020
Member

Can be deleted?

This comment has been minimized.

@benstrumeyer

benstrumeyer Apr 13, 2020
Author Contributor

yes it can!

This conversation was marked as resolved by Eden12345
Comment on lines +200 to +201

This comment has been minimized.

@Eden12345

Eden12345 Apr 13, 2020
Contributor

Commented out code

This comment has been minimized.

@benstrumeyer

benstrumeyer Apr 13, 2020
Author Contributor

Argh. Deleting, good catch!

const filteredText = { color: 'red' };

let trackersBlockedCount;
@@ -224,7 +253,9 @@ class Category extends React.Component {
</div>
</div>
<div className="columns collapse-left collapse-right shrink align-self-justify">
<div className={caretClasses} onClick={this.toggleCategoryTrackers} />
{
this._renderCaret()
}
This conversation was marked as resolved by Eden12345
Comment on lines +256 to +258

This comment has been minimized.

@Eden12345

Eden12345 Apr 13, 2020
Contributor

This can go on one line

This comment has been minimized.

@benstrumeyer

benstrumeyer Apr 13, 2020
Author Contributor

One line!

{!isUnknown && (
<div className={checkBoxStyle} onClick={this.clickCategoryStatus}>
<span className={this.props.index ? 't-tooltip-up-left' : 't-tooltip-down-left'} data-g-tooltip={t('panel_tracker_block_tooltip')} onMouseOver={this.showTooltip} onMouseOut={this.hideTooltip}>
@@ -746,7 +746,7 @@ class Summary extends React.Component {
* @return {JSX} JSX for rendering the plus upgrade banner or subscriber icon
*/
_renderPlusUpgradeBannerOrSubscriberIcon() {
const { is_expert } = this.props;
const { is_expert, current_theme } = this.props;

const isPlusSubscriber = this._isPlusSubscriber();
const upgradeBannerClassNames = ClassNames('UpgradeBanner', {
@@ -758,7 +758,7 @@ class Summary extends React.Component {
<div onClick={this.clickUpgradeBannerOrGoldPlusIcon}>
{isPlusSubscriber && (
<div className="Summary__subscriberBadgeContainer">
<div className="SubscriberBadge">
<div className={`SubscriberBadge ${current_theme}`}>
<ReactSVG src="/app/images/panel/gold-plus-icon.svg" className="gold-plus-icon" />
</div>
</div>
@@ -62,20 +62,21 @@
border-top: 0;
padding-top: 0;
}

.caret-down {
@extend %pointer;
display: inline-block;
width: 40px;
height: 20px;
background: url("../../app/images/panel/caret-down.svg") no-repeat center;
margin: 0 15px 4px 0;
path {
fill: $tundora;
}
}
.caret-up {
@extend %pointer;
display: inline-block;
width: 40px;
height: 20px;
background: url("../../app/images/panel/caret-up.svg") no-repeat center;
margin: 0 15px 4px 0;
path {
fill: $tundora;
}
}
.checkbox-container {
display: inline-block;
@@ -146,6 +146,16 @@ $hist_stats_tab_active: #FFF !default;
}
.Summary__subscriberBadgeContainer {
left: 15px;
.SubscriberBadge.palm-theme {
svg > g > g > path:nth-child(1) {
stroke: #7C8066;
};
}
.SubscriberBadge.leaf-theme {
svg > g > g > path:nth-child(1) {
stroke: #3A3A21;
};
}
}
.GhosteryFeatureButton {
border: $button_border;
@@ -294,6 +304,10 @@ $hist_stats_tab_active: #FFF !default;
border-bottom: 1px solid $divider;
padding-top: 3px;
}
.caret-up.palm-theme > path,
.caret-down.palm-theme > path {
fill: #FFF;
}
}
.cat-name {
color: $tracker_list_text;
@@ -571,34 +585,6 @@ $hist_stats_tab_active: #FFF !default;
}
}

#content-detail.expanded {
.blocking-category .sticky-category .counts:after {
content: "";
display: block;
margin-left: -45px;
width: 470px;
padding-top: 20px;
border-bottom: 1px solid #FFF;
padding-top: 3px;
}
.blocking-trk {
&:after {
content: "";
display: block;
margin-left: -6px;
width: 470px;
border-bottom: 1px solid #FFF;
}
}
&:after {
content: "";
display: block;
margin-left: -6px;
width: 306px;
border-bottom: 1px solid #5a7479;
}
}

#content-detail.expanded {
.blocking-category .sticky-category .counts:after {
content: "";
ProTip! Use n and p to navigate between commits in a pull request.