Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Fix iconCssClasses on URL bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Suguru Hirahara committed Jun 14, 2017
1 parent dc86dd7 commit 4ea852d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions app/renderer/components/navigation/urlBarIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ class UrlBarIcon extends ImmutableComponent {
}
get iconCssClasses () {
if (isPotentialPhishingUrl(this.props.location)) {
return ['fa-exclamation-triangle', 'insecure-color']
return ['fa-exclamation-triangle', css(styles.urlbarIcon_large, styles.urlbarIcon_siteInsecureColor)]
} else if (this.isSearch) {
return ['fa-search']
} else if (this.isAboutPage && !this.props.titleMode) {
return ['fa-list']
} else if (this.props.isHTTPPage && !this.props.active) {
// NOTE: EV style not approved yet; see discussion at https://github.com/brave/browser-laptop/issues/791
if (this.props.isSecure === true) {
return ['fa-lock']
return ['fa-lock', css(styles.urlbarIcon_large)]
} else if (this.props.isSecure === false || this.props.isSecure === 2) {
return ['fa-unlock', 'insecure-color']
return ['fa-unlock', css(styles.urlbarIcon_large, styles.urlbarIcon_siteInsecureColor)]
} else if (this.props.isSecure === 1) {
return ['fa-unlock']
return ['fa-unlock', css(styles.urlbarIcon_large)]
}
}
return []
Expand Down Expand Up @@ -70,12 +70,9 @@ class UrlBarIcon extends ImmutableComponent {
// ref: urlbarIcon_relative
const relativeIcon = this.isAboutPage

const insecure = isPotentialPhishingUrl(this.props.location) || (this.props.isHTTPPage && !this.props.active && (this.props.isSecure === false || this.props.isSecure === 2))
const large = isPotentialPhishingUrl(this.props.location) || (this.props.isHTTPPage && !this.props.active)

const iconClasses = {
fa: true,
[css(styles.urlbarIcon, this.props.titleMode && styles.urlbarIcon_titleMode, this.isSearch && styles.urlbarIcon_isSearch, relativeIcon && styles.urlbarIcon_relative, large && styles.urlbarIcon_large, insecure && styles.urlbarIcon_siteInsecureColor)]: true
[css(styles.urlbarIcon, this.props.titleMode && styles.urlbarIcon_titleMode, this.isSearch && styles.urlbarIcon_isSearch, relativeIcon && styles.urlbarIcon_relative)]: true
}
this.iconCssClasses.forEach((iconClass) => {
iconClasses[iconClass] = true
Expand Down

0 comments on commit 4ea852d

Please sign in to comment.