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

Updated summary view. #25

Merged
merged 15 commits into from Apr 4, 2018

Fix linting errors

  • Loading branch information
IAmThePan committed Mar 29, 2018
commit e4887b45a29e146b8a9ca7f721d3618d6f7e99d6
@@ -31,6 +31,32 @@ class GhosteryFeatures extends React.Component {
this.getRestrictText = this.getRestrictText.bind(this);
}

/**
* Gets the text for the Trust Button under different conditions
* @return {String} The text for the Trust Button as a string
*/
getTrustText() {
if (this.props.isCondensed) {
return '';
} else if (this.props.sitePolicy === 2) {
return t('summary_trust_site_active');
}
return t('summary_trust_site');
}

/**
* Gets the text for the Restrict Button under different conditions
* @return {String} The text for the Restrict Button as a string
*/
getRestrictText() {
if (this.props.isCondensed) {
return '';
} else if (this.props.sitePolicy === 1) {
return t('summary_restrict_site_active');
}
return t('summary_restrict_site');
}

/**
* Handles the click event for the Trust Site button
*/
@@ -61,40 +87,17 @@ class GhosteryFeatures extends React.Component {
this.props.clickButton('restrict');
}

/**
* Gets the text for the Trust Button under different conditions
* @return {String} The text for the Trust Button as a string
*/
getTrustText() {
if (this.props.isCondensed) {
return '';
} else if (this.props.sitePolicy === 2) {
return t('summary_trust_site_active');
} else {
return t('summary_trust_site');
}
}

/**
* Gets the text for the Restrict Button under different conditions
* @return {String} The text for the Restrict Button as a string
*/
getRestrictText() {
if (this.props.isCondensed) {
return '';
} else if (this.props.sitePolicy === 1) {
return t('summary_restrict_site_active');
} else {
return t('summary_restrict_site');
}
}

/**
* React's required render function. Returns JSX
* @return {JSX} JSX for rendering the Ghostery Features portion of the Summary View
*/
render() {
const { isInactive, isStacked, isCondensed, sitePolicy } = this.props;
const {
isInactive,
isStacked,
isCondensed,
sitePolicy
} = this.props;

const buttonGroupClassNames = ClassNames('button-group', {
inactive: isInactive,
@@ -19,30 +19,24 @@ import ClassNames from 'classnames';
* when a site is not scannable or has not yet been scanned.
* @memberof PanelClasses
*/
class NotScanned extends React.Component {
/**
* React's required render function. Returns JSX
* @return {JSX} JSX for rendering the Not Scanned text on the Summary View
*/
render() {
const notScannedClassNames = ClassNames('sub-component', 'not-scanned', {
small: this.props.isSmall,
});
const NotScanned = (props) => {
const notScannedClassNames = ClassNames('sub-component', 'not-scanned', {
small: props.isSmall,
});

return (
<div className={notScannedClassNames}>
<div className="not-scanned-header">
{t('summary_page_not_scanned') }
</div>
<div className="not-scanned-text">
{ t('summary_description_not_scanned_1') }
</div>
<div className="not-scanned-text">
{ t('summary_description_not_scanned_2') }
</div>
return ( // eslint-disable-line arrow-parens
<div className={notScannedClassNames}>
<div className="not-scanned-header">
{t('summary_page_not_scanned') }
</div>
);
}
}
<div className="not-scanned-text">
{ t('summary_description_not_scanned_1') }
</div>
<div className="not-scanned-text">
{ t('summary_description_not_scanned_2') }
</div>
</div>
);
};

export default NotScanned;
@@ -136,13 +136,13 @@ class PauseButton extends React.Component {
this.pauseLeft = node && node.offsetLeft;
}}
>
{this.props.isCondensed ? (
<span></span>
) : (
<span>
{this.props.isPaused ? t('summary_resume_ghostery') : t('summary_pause_ghostery')}
</span>
)}
{this.props.isCondensed ? (
<span />
) : (
<span>
{this.props.isPaused ? t('summary_resume_ghostery') : t('summary_pause_ghostery')}
</span>
)}
</div>
<div className={dropdownButtonClassNames} onClick={this.clickDropdownCaret}>
<span className="show-for-sr">
@@ -187,7 +187,8 @@ class Summary extends React.Component {
*/
clickSitePolicy(button) {
const { paused_blocking, sitePolicy } = this.props;
let type, text;
let type;
let text;

if (this.state.disableBlocking || paused_blocking) {
return;
ProTip! Use n and p to navigate between commits in a pull request.