diff options
author | sdtsui <szehungdanieltsui@gmail.com> | 2017-08-09 09:44:20 +0800 |
---|---|---|
committer | sdtsui <szehungdanieltsui@gmail.com> | 2017-08-09 09:44:20 +0800 |
commit | bdf5436c2d26304b226734e4295ee319ed67b954 (patch) | |
tree | 3766917e8f33c485128e5fc872c7d68093094a1f /ui | |
parent | c8893fb9cac245c7ec22c8a01a12458c56a8e56a (diff) | |
download | tangerine-wallet-browser-bdf5436c2d26304b226734e4295ee319ed67b954.tar tangerine-wallet-browser-bdf5436c2d26304b226734e4295ee319ed67b954.tar.gz tangerine-wallet-browser-bdf5436c2d26304b226734e4295ee319ed67b954.tar.bz2 tangerine-wallet-browser-bdf5436c2d26304b226734e4295ee319ed67b954.tar.lz tangerine-wallet-browser-bdf5436c2d26304b226734e4295ee319ed67b954.tar.xz tangerine-wallet-browser-bdf5436c2d26304b226734e4295ee319ed67b954.tar.zst tangerine-wallet-browser-bdf5436c2d26304b226734e4295ee319ed67b954.zip |
Add minor comments and cleanup for new components
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/app.js | 12 | ||||
-rw-r--r-- | ui/app/components/buy-options.js | 5 | ||||
-rw-r--r-- | ui/app/components/modal.js | 23 |
3 files changed, 16 insertions, 24 deletions
diff --git a/ui/app/app.js b/ui/app/app.js index 5c594c8cf..3ffa9f0d5 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -98,10 +98,7 @@ App.prototype.render = function () { h('.flex-column.full-height', { style: { - // Windows was showing a vertical scroll bar: overflowX: 'hidden', - // TODO: check with dev who committed L75, see if this still happens, and whether auto is enough - // overflowY: 'auto', position: 'relative', alignItems: 'center', }, @@ -140,9 +137,6 @@ App.prototype.renderGlobalModal = function() { } App.prototype.renderSidebar = function() { - // if (!this.props.sidebarOpen) { - // return null; - // } return h('div', { }, [ @@ -170,7 +164,7 @@ App.prototype.renderSidebar = function() { transitionEnterTimeout: 300, transitionLeaveTimeout: 200, }, [ - // content + // A second instance of Walletview is used for non-mobile viewports this.props.sidebarOpen ? h(WalletView, { responsiveDisplayClassname: '.sidebar', style: {}, @@ -502,10 +496,6 @@ App.prototype.renderPrimary = function () { }) } - // Note for @Zanibar - isUnlocked stays true. - // console.log("props.isUnlocked", props.isUnlocked) - // console.log("props.isUnlocked", props.currentView.name) - // show current view switch (props.currentView.name) { diff --git a/ui/app/components/buy-options.js b/ui/app/components/buy-options.js index f0864d087..d36328efd 100644 --- a/ui/app/components/buy-options.js +++ b/ui/app/components/buy-options.js @@ -26,10 +26,12 @@ function BuyOptions () { module.exports = connect(mapStateToProps, mapDispatchToProps)(BuyOptions) +// BuyOptions is currently meant to be rendered inside <Modal /> +// It is the only component in this codebase that does so +// It utilizes modal styles BuyOptions.prototype.render = function () { return h('div', {}, [ h('div.modal-content.transfers-subview', { - }, [ h('div.modal-content-title-wrapper.flex-column.flex-center', { style: {}, @@ -44,7 +46,6 @@ BuyOptions.prototype.render = function () { h('div.modal-content-option', { onClick: () => { - console.log("buy clicked") const { toCoinbase, address } = this.props toCoinbase(address) }, diff --git a/ui/app/components/modal.js b/ui/app/components/modal.js index 2339ee497..8bac866a8 100644 --- a/ui/app/components/modal.js +++ b/ui/app/components/modal.js @@ -1,10 +1,7 @@ const Component = require('react').Component - const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect -// const elementType = require('react-prop-types/lib/elementType') -// const PropTypes from 'prop-types' const FadeModal = require('boron').FadeModal const actions = require('../actions') const isMobileView = require('../../lib/is-mobile-view') @@ -30,16 +27,16 @@ function Modal () { module.exports = connect(mapStateToProps, mapDispatchToProps)(Modal) -Modal.prototype.render = function () { +const mobileModalStyles = { + width: '95%', +} - const mobileModalStyles = { - width: '95%', - } +const laptopModalStyles = { + width: '66%', + top: '30%', +} - const laptopModalStyles = { - width: '66%', - top: '30%', - } +Modal.prototype.render = function () { return h(FadeModal, { @@ -78,8 +75,12 @@ Modal.prototype.show = function() { this.modalRef.show() } +// TODO: specify default props and proptypes // Modal.defaultProps = {} +// const elementType = require('react-prop-types/lib/elementType') +// const PropTypes from 'prop-types' + // Modal.propTypes = { // active: PropTypes.bool, // hideModal: PropTypes.func.isRequired, |