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

Commit

Permalink
Address feedbacks
Browse files Browse the repository at this point in the history
- Remove bookmarked from bookmarkButton.js
- Remove activeFrame from bookmarkButton.js
- Remove prop.activeFrameKey from bookmarkButton.js
- Remove prop.sites from bookmarkButton.js
- Revert loadTimer split
- Revert legend split
  • Loading branch information
Suguru Hirahara committed Jul 12, 2017
1 parent 7d71108 commit e7e96c8
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 72 deletions.
14 changes: 0 additions & 14 deletions app/renderer/components/navigation/buttons/bookmarkButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ const messages = require('../../../../../js/constants/messages')
const tabState = require('../../../../common/state/tabState')
const frameStateUtil = require('../../../../../js/state/frameStateUtil')

// Store
const windowStore = require('../../../../../js/stores/windowStore')

// Utils
const siteUtil = require('../../../../../js/state/siteUtil')
const UrlUtil = require('../../../../../js/lib/urlutil')
Expand All @@ -39,14 +36,6 @@ class BookmarkButton extends React.Component {
this.onToggleBookmark = this.onToggleBookmark.bind(this)
}

get bookmarked () {
return this.props.activeFrameKey !== undefined && this.props.bookmarked
}

get activeFrame () {
return windowStore.getFrame(this.props.activeFrameKey)
}

onToggleBookmark () {
const editing = this.bookmarked
// show the AddEditBookmarkHanger control; saving/deleting takes place there
Expand Down Expand Up @@ -76,14 +65,11 @@ class BookmarkButton extends React.Component {
mergeProps (state, dispatchProps, ownProps) {
const currentWindow = state.get('currentWindow')
const activeFrame = frameStateUtil.getActiveFrame(currentWindow) || Immutable.Map()
const activeFrameKey = activeFrame.get('key')
const activeTabId = activeFrame.get('tabId', tabState.TAB_ID_NONE)
const activeTab = tabState.getByTabId(state, activeTabId)

const props = {}
props.activeFrameKey = activeFrameKey
props.bookmarked = activeTab && activeTab.get('bookmarked')
props.sites = state.get('sites')

return props
}
Expand Down
106 changes: 48 additions & 58 deletions app/renderer/components/navigation/urlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,15 +421,6 @@ class UrlBar extends React.Component {
</div>
}

// BEM Level: urlbarForm__titleBar__loadTime
get loadTimer () {
return <span className={css(
styles.loadTime,
this.props.isActive && styles.loadTime_onFocus
)}
data-test-id='loadTime'>{this.loadTime}</span>
}

// BEM Level: urlbarForm__input
get input () {
return <input type='text'
Expand All @@ -454,15 +445,6 @@ class UrlBar extends React.Component {
/>
}

// BEM Level: urlbarForm__legend
get legend () {
return <legend className={css(
styles.legend,
!!this.props.isFocused && styles.legend_isFocused,
this.props.publisherButtonVisible && styles.legend_urlBarEnd
)} />
}

// BEM Level: urlbarForm__buttonContainer_showNoScript
get noScriptInfo () {
return <NavigationBarButtonContainer isSquare>
Expand Down Expand Up @@ -582,11 +564,19 @@ class UrlBar extends React.Component {
{
this.props.titleMode
? null
: this.legend
: <legend className={css(
styles.urlbarForm__legend,
!!this.props.isFocused && styles.urlbarForm__legend_isFocused,
this.props.publisherButtonVisible && styles.urlbarForm__legend_urlBarEnd
)} />
}
{
this.props.showDisplayTime
? this.loadTimer
? <span className={css(
styles.urlbarForm__loadTime,
this.props.isActive && styles.urlbarForm__loadTime_onFocus
)}
data-test-id='loadTime'>{this.loadTime}</span>
: null
}
{
Expand Down Expand Up @@ -654,6 +644,44 @@ const styles = StyleSheet.create({
borderBottomRightRadius: 0
},

urlbarForm__legend: {
':before': {
display: 'none',
content: '" "',
position: 'absolute',
borderRadius: '0 4px 4px 0',
color: '#333',
boxShadow: `inset 0 0 0 1px ${globalStyles.color.urlBarOutline}, inset 0 0 0 3px ${globalStyles.color.focusUrlbarOutline}`,
outline: 'none',
top: 0,
bottom: 0,
right: 0,
left: 0,
zIndex: globalStyles.zindex.zindexNavigationBar
}
},

urlbarForm__legend_isFocused: {
':before': {
display: 'block'
}
},

urlbarForm__legend_urlBarEnd: {
':before': {
borderRadius: 0
}
},

urlbarForm__loadTime: {
color: globalStyles.color.loadTimeColor,
fontSize: '12px'
},

urlbarForm__loadTime_onFocus: {
display: 'none'
},

titleBar: {
display: 'inline-block',
color: globalStyles.color.chromeText,
Expand Down Expand Up @@ -697,44 +725,6 @@ const styles = StyleSheet.create({
width: '100%'
},

legend: {
':before': {
display: 'none',
content: '" "',
position: 'absolute',
borderRadius: '0 4px 4px 0',
color: '#333',
boxShadow: `inset 0 0 0 1px ${globalStyles.color.urlBarOutline}, inset 0 0 0 3px ${globalStyles.color.focusUrlbarOutline}`,
outline: 'none',
top: 0,
bottom: 0,
right: 0,
left: 0,
zIndex: globalStyles.zindex.zindexNavigationBar
}
},

legend_isFocused: {
':before': {
display: 'block'
}
},

legend_urlBarEnd: {
':before': {
borderRadius: 0
}
},

loadTime: {
color: globalStyles.color.loadTimeColor,
fontSize: '12px'
},

loadTime_onFocus: {
display: 'none'
},

noScript__button: {
background: `url(${iconNoScript}) center no-repeat`,
width: '15px',
Expand Down

0 comments on commit e7e96c8

Please sign in to comment.