mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add minor comments and cleanup for new components
This commit is contained in:
parent
c8893fb9ca
commit
bdf5436c2d
@ -98,10 +98,7 @@ App.prototype.render = function () {
|
|||||||
|
|
||||||
h('.flex-column.full-height', {
|
h('.flex-column.full-height', {
|
||||||
style: {
|
style: {
|
||||||
// Windows was showing a vertical scroll bar:
|
|
||||||
overflowX: 'hidden',
|
overflowX: 'hidden',
|
||||||
// TODO: check with dev who committed L75, see if this still happens, and whether auto is enough
|
|
||||||
// overflowY: 'auto',
|
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
@ -140,9 +137,6 @@ App.prototype.renderGlobalModal = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
App.prototype.renderSidebar = function() {
|
App.prototype.renderSidebar = function() {
|
||||||
// if (!this.props.sidebarOpen) {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
return h('div', {
|
return h('div', {
|
||||||
}, [
|
}, [
|
||||||
@ -170,7 +164,7 @@ App.prototype.renderSidebar = function() {
|
|||||||
transitionEnterTimeout: 300,
|
transitionEnterTimeout: 300,
|
||||||
transitionLeaveTimeout: 200,
|
transitionLeaveTimeout: 200,
|
||||||
}, [
|
}, [
|
||||||
// content
|
// A second instance of Walletview is used for non-mobile viewports
|
||||||
this.props.sidebarOpen ? h(WalletView, {
|
this.props.sidebarOpen ? h(WalletView, {
|
||||||
responsiveDisplayClassname: '.sidebar',
|
responsiveDisplayClassname: '.sidebar',
|
||||||
style: {},
|
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
|
// show current view
|
||||||
switch (props.currentView.name) {
|
switch (props.currentView.name) {
|
||||||
|
|
||||||
|
@ -26,10 +26,12 @@ function BuyOptions () {
|
|||||||
|
|
||||||
module.exports = connect(mapStateToProps, mapDispatchToProps)(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 () {
|
BuyOptions.prototype.render = function () {
|
||||||
return h('div', {}, [
|
return h('div', {}, [
|
||||||
h('div.modal-content.transfers-subview', {
|
h('div.modal-content.transfers-subview', {
|
||||||
|
|
||||||
}, [
|
}, [
|
||||||
h('div.modal-content-title-wrapper.flex-column.flex-center', {
|
h('div.modal-content-title-wrapper.flex-column.flex-center', {
|
||||||
style: {},
|
style: {},
|
||||||
@ -44,7 +46,6 @@ BuyOptions.prototype.render = function () {
|
|||||||
|
|
||||||
h('div.modal-content-option', {
|
h('div.modal-content-option', {
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
console.log("buy clicked")
|
|
||||||
const { toCoinbase, address } = this.props
|
const { toCoinbase, address } = this.props
|
||||||
toCoinbase(address)
|
toCoinbase(address)
|
||||||
},
|
},
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
const Component = require('react').Component
|
const Component = require('react').Component
|
||||||
|
|
||||||
const h = require('react-hyperscript')
|
const h = require('react-hyperscript')
|
||||||
const inherits = require('util').inherits
|
const inherits = require('util').inherits
|
||||||
const connect = require('react-redux').connect
|
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 FadeModal = require('boron').FadeModal
|
||||||
const actions = require('../actions')
|
const actions = require('../actions')
|
||||||
const isMobileView = require('../../lib/is-mobile-view')
|
const isMobileView = require('../../lib/is-mobile-view')
|
||||||
@ -30,17 +27,17 @@ function Modal () {
|
|||||||
|
|
||||||
module.exports = connect(mapStateToProps, mapDispatchToProps)(Modal)
|
module.exports = connect(mapStateToProps, mapDispatchToProps)(Modal)
|
||||||
|
|
||||||
|
const mobileModalStyles = {
|
||||||
|
width: '95%',
|
||||||
|
}
|
||||||
|
|
||||||
|
const laptopModalStyles = {
|
||||||
|
width: '66%',
|
||||||
|
top: '30%',
|
||||||
|
}
|
||||||
|
|
||||||
Modal.prototype.render = function () {
|
Modal.prototype.render = function () {
|
||||||
|
|
||||||
const mobileModalStyles = {
|
|
||||||
width: '95%',
|
|
||||||
}
|
|
||||||
|
|
||||||
const laptopModalStyles = {
|
|
||||||
width: '66%',
|
|
||||||
top: '30%',
|
|
||||||
}
|
|
||||||
|
|
||||||
return h(FadeModal,
|
return h(FadeModal,
|
||||||
{
|
{
|
||||||
className: 'modal',
|
className: 'modal',
|
||||||
@ -78,8 +75,12 @@ Modal.prototype.show = function() {
|
|||||||
this.modalRef.show()
|
this.modalRef.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: specify default props and proptypes
|
||||||
// Modal.defaultProps = {}
|
// Modal.defaultProps = {}
|
||||||
|
|
||||||
|
// const elementType = require('react-prop-types/lib/elementType')
|
||||||
|
// const PropTypes from 'prop-types'
|
||||||
|
|
||||||
// Modal.propTypes = {
|
// Modal.propTypes = {
|
||||||
// active: PropTypes.bool,
|
// active: PropTypes.bool,
|
||||||
// hideModal: PropTypes.func.isRequired,
|
// hideModal: PropTypes.func.isRequired,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user