Skip to content

Commit

Permalink
Merge pull request brave#9310 from NejcZdovc/redux/dispatchProps
Browse files Browse the repository at this point in the history
Removes dispatchProps from redux
  • Loading branch information
NejcZdovc authored Jun 7, 2017
2 parents 05dd2c3 + 62d6587 commit dec236f
Show file tree
Hide file tree
Showing 23 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion app/renderer/components/bookmarks/addEditBookmarkHanger.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class AddEditBookmarkHanger extends React.Component {
appActions.createTabRequested({url: 'about:bookmarks'})
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const bookmarkDetail = currentWindow.get('bookmarkDetail')
const currentDetail = bookmarkDetail.get('currentDetail')
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/common/messageBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class MessageBox extends React.Component {
return newButtons
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const tabId = ownProps.tabId
const tab = tabState.getByTabId(state, tabId)
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/download/downloadItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class DownloadItem extends React.Component {
return this.props.downloadState === downloadStates.PAUSED
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const download = state.getIn(['downloads', ownProps.downloadId]) || Immutable.Map()
const origin = getOrigin(download.get('url'))

Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/download/downloadsBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DownloadsBar extends React.Component {
windowActions.setDownloadsToolbarVisible(false)
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const props = {}
// used in renderer
props.downloads = downloadUtil.getDownloadItems(state)
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/frame/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ class Frame extends React.Component {
}
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const frame = frameStateUtil.getFrameByKey(currentWindow, ownProps.frameKey) || Immutable.Map()
const location = frame.get('location')
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/navigation/browserAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class BrowserAction extends React.Component {
ipc.send('chrome-browser-action-clicked', this.props.extensionId, this.props.activeTabId, this.props.title, props)
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const activeFrame = frameStateUtil.getActiveFrame(currentWindow) || Immutable.Map()
const activeTabId = activeFrame.get('tabId') || tabState.TAB_ID_NONE
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/navigation/menuBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class MenuBar extends React.Component {
}
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const contextMenuDetail = currentWindow.get('contextMenuDetail')

Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/navigation/menuBarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class MenuBarItem extends React.Component {
}
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const selectedIndex = currentWindow.getIn(['ui', 'menubar', 'selectedIndex'])
const template = state.getIn(['menu', 'template', ownProps.index])
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/navigation/navigationBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class NavigationBar extends React.Component {
ipc.on(messages.SHORTCUT_ACTIVE_FRAME_REMOVE_BOOKMARK, () => this.onToggleBookmark())
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const activeFrame = frameStateUtil.getActiveFrame(currentWindow) || Immutable.Map()
const activeFrameKey = activeFrame.get('key')
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/navigation/navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class Navigator extends React.Component {
ipc.off(messages.SHORTCUT_ACTIVE_FRAME_FORWARD, this.onForward)
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const activeFrame = frameStateUtil.getActiveFrame(currentWindow) || Immutable.Map()
const activeTabId = activeFrame.get('tabId') || tabState.TAB_ID_NONE
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/navigation/urlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ class UrlBar extends React.Component {
contextMenus.onUrlBarContextMenu(e)
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const activeFrame = frameStateUtil.getActiveFrame(currentWindow) || Immutable.Map()
const activeTabId = activeFrame.get('tabId') || tabState.TAB_ID_NONE
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/navigation/urlBarSuggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class UrlBarSuggestions extends React.Component {
return items
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const activeFrame = frameStateUtil.getActiveFrame(currentWindow) || Immutable.Map()
const urlBar = activeFrame.getIn(['navbar', 'urlbar'], Immutable.Map())
Expand Down
10 changes: 5 additions & 5 deletions app/renderer/components/reduxComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ const windowStore = require('../../../js/stores/windowStore')
const debounce = require('../../../js/lib/debounce')
const {isList, isSameHashCode} = require('../../common/state/immutableUtil')

const mergePropsImpl = (stateProps, dispatchProps, ownProps) => {
return Object.assign({}, stateProps, dispatchProps, ownProps)
const mergePropsImpl = (stateProps, ownProps) => {
return Object.assign({}, stateProps, ownProps)
}

const buildPropsImpl = (props, componentType) => {
const fn = componentType.prototype.mergeProps || mergePropsImpl
const state = appStore.state.set('currentWindow', windowStore.state)
return fn(state, {}, props)
return fn(state, props)
}

class ReduxComponent extends ImmutableComponent {
Expand Down Expand Up @@ -58,8 +58,8 @@ class ReduxComponent extends ImmutableComponent {
return shouldUpdate
}

mergeProps (stateProps, dispatchProps, ownProps) {
return mergePropsImpl(stateProps, dispatchProps, ownProps)
mergeProps (stateProps, ownProps) {
return mergePropsImpl(stateProps, ownProps)
}

buildProps (props = this.props) {
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/tabs/content/audioTabIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AudioTabIcon extends React.Component {
windowActions.setAudioMuted(this.props.frameKey, this.props.tabId, !this.props.audioMuted)
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const frame = frameStateUtil.getFrameByKey(currentWindow, ownProps.frameKey)

Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/tabs/content/closeTabIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CloseTabIcon extends React.Component {
}
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const isPinnedTab = frameStateUtil.isPinned(currentWindow, ownProps.frameKey)
const frame = frameStateUtil.getFrameByKey(currentWindow, ownProps.frameKey)
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/tabs/content/favIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Favicon extends React.Component {
: null
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const frame = frameStateUtil.getFrameByKey(currentWindow, ownProps.frameKey) || Immutable.Map()
const isTabLoading = tabContentState.isTabLoading(currentWindow, ownProps.frameKey)
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/tabs/content/newSessionIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const tabStyles = require('../../styles/tab')
const newSessionSvg = require('../../../../extensions/brave/img/tabs/new_session.svg')

class NewSessionIcon extends React.Component {
mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const frame = frameStateUtil.getFrameByKey(currentWindow, ownProps.frameKey)
const partition = frame.get('partitionNumber')
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/tabs/content/privateIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const tabStyles = require('../../styles/tab')
const privateSvg = require('../../../../extensions/brave/img/tabs/private.svg')

class PrivateIcon extends React.Component {
mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')

const props = {}
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/tabs/content/tabTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const {isWindows, isDarwin} = require('../../../../common/lib/platformUtil')
const globalStyles = require('../../styles/global')

class TabTitle extends React.Component {
mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const tabIconColor = tabContentState.getTabIconColor(currentWindow, ownProps.frameKey)

Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/tabs/pinnedTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class PinnedTabs extends React.Component {
e.preventDefault()
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const pinnedFrames = frameStateUtil.getPinnedFrames(currentWindow)

Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/tabs/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class Tab extends React.Component {
return rect && rect.width
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const frame = frameStateUtil.getFrameByKey(currentWindow, ownProps.frameKey)
const notifications = state.get('notifications')
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/tabs/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class Tabs extends React.Component {
contextMenus.onNewTabContextMenu(target)
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const pageIndex = tabContentState.getPageIndex(currentWindow)
const tabsPerTabPage = Number(getSetting(settings.TABS_PER_PAGE))
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/tabs/tabsToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TabsToolbar extends React.Component {
contextMenus.onHamburgerMenu(this.props.activeFrameLocation, e)
}

mergeProps (state, dispatchProps, ownProps) {
mergeProps (state, ownProps) {
const currentWindow = state.get('currentWindow')
const activeFrame = frameStateUtil.getActiveFrame(currentWindow)
const pinnedTabs = frameStateUtil.getPinnedFrames(currentWindow)
Expand Down

0 comments on commit dec236f

Please sign in to comment.