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

Commit

Permalink
Removed two params from NavigationBar
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed May 5, 2017
1 parent f4c4fe4 commit 31334fe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/renderer/components/browserAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class BrowserAction extends React.Component {
render () {
// TODO(bridiver) should have some visual notification of hover/press
return <div className={css(styles.browserActionButton)}>
<BrowserButton
extensionItem
<BrowserButton
extensionItem
l10nId='browserActionButton'
testId='extensionBrowserAction'
l10nArgs={{ name: this.props.title }}
Expand Down
7 changes: 5 additions & 2 deletions app/renderer/components/navigation/navigationBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const {getCurrentWindowId} = require('../../currentWindow')
// State
const tabState = require('../../../common/state/tabState')
const frameStateUtil = require('../../../../js/state/frameStateUtil')
const menuBarState = require('../../../common/state/menuBarState')
const siteSettingsState = require('../../../common/state/siteSettingsState')

class NavigationBar extends React.Component {
constructor (props) {
Expand Down Expand Up @@ -125,6 +127,7 @@ class NavigationBar extends React.Component {
const loading = activeFrame.get('loading')
const location = activeFrame.get('location') || ''
const navbar = activeFrame.get('navbar') || Immutable.Map()
const isPrivate = activeFrame.get('isPrivate') || false

const hasTitle = title && location && title !== location.replace(/^https?:\/\//, '')
const titleMode = activeTabShowingMessageBox ||
Expand All @@ -151,9 +154,9 @@ class NavigationBar extends React.Component {
props.loading = loading
props.bookmarkDetail = bookmarkDetail
props.mouseInTitlebar = mouseInTitlebar
props.enableNoScript = ownProps.enableNoScript
props.enableNoScript = siteSettingsState.isNoScriptEnabled(state, isPrivate)
props.settings = state.get('settings')
props.menubarVisible = ownProps.menubarVisible
props.menubarVisible = menuBarState.isMenuBarVisible(windowState)
props.siteSettings = state.get('siteSettings')
props.synopsis = state.getIn(['publisherInfo', 'synopsis']) || new Immutable.Map()
props.activeTabShowingMessageBox = activeTabShowingMessageBox
Expand Down
6 changes: 1 addition & 5 deletions app/renderer/components/navigation/navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ class Navigator extends React.Component {
props.shieldEnabled = braveShieldsEnabled(activeFrame)
props.menuBarVisible = menuBarState.isMenuBarVisible(currentWindow)
props.isMaximized = isMaximized() || isFullScreen()
props.isNoScriptEnabled = activeFrame && siteSettingsState.isNoScriptEnabled(state, activeFrame.get('isPrivate'))
props.isCaptionButton = isWindows() && !props.menuBarVisible
props.activeTabShowingMessageBox = activeTabShowingMessageBox
props.extensionBrowserActions = extensionBrowserActions
Expand Down Expand Up @@ -234,10 +233,7 @@ class Navigator extends React.Component {
/>
</div>
</div>
<NavigationBar
enableNoScript={this.props.isNoScriptEnabled}
menubarVisible={this.props.menuBarVisible}
/>
<NavigationBar />
<div className='topLevelEndButtons'>
<div className={cx({
extraDragArea: !this.props.menuBarVisible,
Expand Down
5 changes: 1 addition & 4 deletions app/renderer/components/reduxComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ class ReduxComponent extends ImmutableComponent {
}

checkForUpdates () {
// TODO @bridiver only temp solution
const newProps = !this.dontCheck && this.buildProps()
if (!this.dontCheck && this.shouldComponentUpdate(this.props, newProps)) {
this.state = Object.assign({}, newProps)
if (!this.dontCheck && this.shouldComponentUpdate(this.props, this.buildProps())) {
this.forceUpdate()
}
}
Expand Down

0 comments on commit 31334fe

Please sign in to comment.