Update package.json deps
This commit is contained in:
parent
d973c28d2d
commit
130c9b38e5
|
@ -92,7 +92,7 @@ workflows:
|
||||||
jobs:
|
jobs:
|
||||||
prep-deps-npm:
|
prep-deps-npm:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -108,7 +108,7 @@ jobs:
|
||||||
|
|
||||||
prep-build:
|
prep-build:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -127,7 +127,7 @@ jobs:
|
||||||
|
|
||||||
prep-docs:
|
prep-docs:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -142,7 +142,7 @@ jobs:
|
||||||
|
|
||||||
prep-scss:
|
prep-scss:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -161,7 +161,7 @@ jobs:
|
||||||
|
|
||||||
test-lint:
|
test-lint:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -172,7 +172,7 @@ jobs:
|
||||||
|
|
||||||
# test-deps:
|
# test-deps:
|
||||||
# docker:
|
# docker:
|
||||||
# - image: circleci/node:8.15.0-browsers
|
# - image: circleci/node:10.15.3-browsers
|
||||||
# steps:
|
# steps:
|
||||||
# - checkout
|
# - checkout
|
||||||
# - restore_cache:
|
# - restore_cache:
|
||||||
|
@ -183,7 +183,7 @@ jobs:
|
||||||
|
|
||||||
test-e2e-chrome:
|
test-e2e-chrome:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -208,7 +208,7 @@ jobs:
|
||||||
|
|
||||||
test-e2e-firefox:
|
test-e2e-firefox:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -229,7 +229,7 @@ jobs:
|
||||||
|
|
||||||
test-e2e-beta-chrome:
|
test-e2e-beta-chrome:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -245,7 +245,7 @@ jobs:
|
||||||
|
|
||||||
test-e2e-beta-firefox:
|
test-e2e-beta-firefox:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -266,7 +266,7 @@ jobs:
|
||||||
|
|
||||||
job-screens:
|
job-screens:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -283,7 +283,7 @@ jobs:
|
||||||
|
|
||||||
job-publish-prerelease:
|
job-publish-prerelease:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -310,7 +310,7 @@ jobs:
|
||||||
|
|
||||||
job-publish-release:
|
job-publish-release:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -323,7 +323,7 @@ jobs:
|
||||||
|
|
||||||
job-publish-postrelease:
|
job-publish-postrelease:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -346,7 +346,7 @@ jobs:
|
||||||
|
|
||||||
test-unit:
|
test-unit:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -359,7 +359,7 @@ jobs:
|
||||||
environment:
|
environment:
|
||||||
browsers: '["Firefox"]'
|
browsers: '["Firefox"]'
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -383,7 +383,7 @@ jobs:
|
||||||
environment:
|
environment:
|
||||||
browsers: '["Chrome"]'
|
browsers: '["Chrome"]'
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -402,7 +402,7 @@ jobs:
|
||||||
environment:
|
environment:
|
||||||
browsers: '["Firefox"]'
|
browsers: '["Firefox"]'
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -426,7 +426,7 @@ jobs:
|
||||||
environment:
|
environment:
|
||||||
browsers: '["Chrome"]'
|
browsers: '["Chrome"]'
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -443,7 +443,7 @@ jobs:
|
||||||
|
|
||||||
all-tests-pass:
|
all-tests-pass:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8.15.0-browsers
|
- image: circleci/node:10.15.3-browsers
|
||||||
steps:
|
steps:
|
||||||
- run:
|
- run:
|
||||||
name: All Tests Passed
|
name: All Tests Passed
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { connect } from 'react-redux'
|
|
||||||
|
|
||||||
class ConfirmScreen extends Component {
|
class ConfirmScreen extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
@ -68,11 +67,4 @@ class ConfirmScreen extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
export default ConfirmScreen
|
||||||
return {
|
|
||||||
metamask: state.metamask,
|
|
||||||
warning: state.appState.warning,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = connect(mapStateToProps)(ConfirmScreen)
|
|
||||||
|
|
|
@ -1,136 +1,150 @@
|
||||||
const Component = require('react').Component
|
import React, { Component } from 'react'
|
||||||
const h = require('react-hyperscript')
|
import PropTypes from 'prop-types'
|
||||||
const inherits = require('util').inherits
|
import h from 'react-hyperscript'
|
||||||
const findDOMNode = require('react-dom').findDOMNode
|
import { findDOMNode } from 'react-dom'
|
||||||
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
|
import { CSSTransitionGroup } from 'react-transition-group'
|
||||||
|
|
||||||
module.exports = MenuDroppoComponent
|
export default class MenuDroppo extends Component {
|
||||||
|
|
||||||
|
constructor (props) {
|
||||||
inherits(MenuDroppoComponent, Component)
|
super(props)
|
||||||
function MenuDroppoComponent () {
|
this.menuDroppoContainer = React.createRef()
|
||||||
Component.call(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuDroppoComponent.prototype.render = function () {
|
|
||||||
const speed = this.props.speed || '300ms'
|
|
||||||
const useCssTransition = this.props.useCssTransition
|
|
||||||
const zIndex = ('zIndex' in this.props) ? this.props.zIndex : 0
|
|
||||||
|
|
||||||
this.manageListeners()
|
|
||||||
|
|
||||||
const style = this.props.style || {}
|
|
||||||
if (!('position' in style)) {
|
|
||||||
style.position = 'fixed'
|
|
||||||
}
|
|
||||||
style.zIndex = zIndex
|
|
||||||
style.overflow = 'hidden'
|
|
||||||
|
|
||||||
return (
|
|
||||||
h('.menu-droppo-container', {
|
|
||||||
ref: 'menuDroppoContainer',
|
|
||||||
style,
|
|
||||||
}, [
|
|
||||||
useCssTransition
|
|
||||||
? h(ReactCSSTransitionGroup, {
|
|
||||||
className: 'css-transition-group',
|
|
||||||
transitionName: 'menu-droppo',
|
|
||||||
transitionEnterTimeout: parseInt(speed),
|
|
||||||
transitionLeaveTimeout: parseInt(speed),
|
|
||||||
}, this.renderPrimary())
|
|
||||||
: this.renderPrimary(),
|
|
||||||
])
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuDroppoComponent.prototype.renderPrimary = function () {
|
|
||||||
const isOpen = this.props.isOpen
|
|
||||||
if (!isOpen) {
|
|
||||||
return null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const innerStyle = this.props.innerStyle || {}
|
static propTypes = {
|
||||||
|
speed: PropTypes.string,
|
||||||
return (
|
useCssTransition: PropTypes.bool,
|
||||||
h('.menu-droppo', {
|
zIndex: PropTypes.number,
|
||||||
key: 'menu-droppo-drawer',
|
isOpen: PropTypes.bool,
|
||||||
style: innerStyle,
|
innerStyle: PropTypes.object,
|
||||||
},
|
children: PropTypes.array,
|
||||||
[ this.props.children ])
|
onClickOutside: PropTypes.func,
|
||||||
)
|
style: PropTypes.object,
|
||||||
}
|
constOverflow: PropTypes.bool,
|
||||||
|
|
||||||
MenuDroppoComponent.prototype.manageListeners = function () {
|
|
||||||
const isOpen = this.props.isOpen
|
|
||||||
const onClickOutside = this.props.onClickOutside
|
|
||||||
|
|
||||||
if (isOpen) {
|
|
||||||
this.outsideClickHandler = onClickOutside
|
|
||||||
} else if (isOpen) {
|
|
||||||
this.outsideClickHandler = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuDroppoComponent.prototype.componentDidMount = function () {
|
|
||||||
if (this && document.body) {
|
|
||||||
this.globalClickHandler = this.globalClickOccurred.bind(this)
|
|
||||||
document.body.addEventListener('click', this.globalClickHandler)
|
|
||||||
// eslint-disable-next-line react/no-find-dom-node
|
|
||||||
var container = findDOMNode(this)
|
|
||||||
this.container = container
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.transitionStarted = this.transitionstartOccured.bind(this)
|
render () {
|
||||||
|
const speed = this.props.speed || '300ms'
|
||||||
|
const useCssTransition = this.props.useCssTransition
|
||||||
|
const zIndex = ('zIndex' in this.props) ? this.props.zIndex : 0
|
||||||
|
|
||||||
/*
|
this.manageListeners()
|
||||||
* transitionstart event is not supported in Chrome yet. But it works for Firefox 53+.
|
|
||||||
* We need to handle this event only for FF because for Chrome we've hidden scrolls.
|
|
||||||
*/
|
|
||||||
this.refs.menuDroppoContainer.addEventListener('transitionstart', this.transitionStarted)
|
|
||||||
|
|
||||||
this.transitionEnded = this.transitionendOccured.bind(this)
|
const style = this.props.style || {}
|
||||||
|
if (!('position' in style)) {
|
||||||
this.refs.menuDroppoContainer.addEventListener('transitionend', this.transitionEnded)
|
style.position = 'fixed'
|
||||||
}
|
|
||||||
|
|
||||||
MenuDroppoComponent.prototype.componentWillUnmount = function () {
|
|
||||||
if (this && document.body) {
|
|
||||||
document.body.removeEventListener('click', this.globalClickHandler)
|
|
||||||
document.body.removeEventListener('transitionstart', this.transitionStarted)
|
|
||||||
document.body.removeEventListener('transitionend', this.transitionEnded)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuDroppoComponent.prototype.globalClickOccurred = function (event) {
|
|
||||||
const target = event.target
|
|
||||||
// eslint-disable-next-line react/no-find-dom-node
|
|
||||||
const container = findDOMNode(this)
|
|
||||||
|
|
||||||
if (target !== container &&
|
|
||||||
!isDescendant(this.container, event.target) &&
|
|
||||||
this.outsideClickHandler) {
|
|
||||||
this.outsideClickHandler(event)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuDroppoComponent.prototype.transitionstartOccured = function (event) {
|
|
||||||
this.refs.menuDroppoContainer.style.overflow = 'hidden'
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuDroppoComponent.prototype.transitionendOccured = function (event) {
|
|
||||||
if (!this.props.constOverflow) {
|
|
||||||
this.refs.menuDroppoContainer.style.overflow = 'auto'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function isDescendant (parent, child) {
|
|
||||||
var node = child.parentNode
|
|
||||||
while (node !== null) {
|
|
||||||
if (node === parent) {
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
node = node.parentNode
|
style.zIndex = zIndex
|
||||||
|
style.overflow = 'hidden'
|
||||||
|
|
||||||
|
return (
|
||||||
|
h('.menu-droppo-container', {
|
||||||
|
ref: this.menuDroppoContainer,
|
||||||
|
style,
|
||||||
|
}, [
|
||||||
|
// this.renderPrimary(),
|
||||||
|
useCssTransition
|
||||||
|
? h(CSSTransitionGroup, {
|
||||||
|
className: 'css-transition-group',
|
||||||
|
transitionName: 'menu-droppo',
|
||||||
|
transitionEnterTimeout: parseInt(speed),
|
||||||
|
transitionLeaveTimeout: parseInt(speed),
|
||||||
|
}, this.renderPrimary())
|
||||||
|
: this.renderPrimary(),
|
||||||
|
])
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
renderPrimary () {
|
||||||
|
const isOpen = this.props.isOpen
|
||||||
|
if (!isOpen) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
const innerStyle = this.props.innerStyle || {}
|
||||||
|
|
||||||
|
return (
|
||||||
|
h('.menu-droppo', {
|
||||||
|
key: 'menu-droppo-drawer',
|
||||||
|
style: innerStyle,
|
||||||
|
},
|
||||||
|
[ this.props.children ])
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
manageListeners () {
|
||||||
|
const isOpen = this.props.isOpen
|
||||||
|
const onClickOutside = this.props.onClickOutside
|
||||||
|
|
||||||
|
if (isOpen) {
|
||||||
|
this.outsideClickHandler = onClickOutside
|
||||||
|
} else if (isOpen) {
|
||||||
|
this.outsideClickHandler = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount () {
|
||||||
|
if (this && document.body) {
|
||||||
|
this.globalClickHandler = this.globalClickOccurred.bind(this)
|
||||||
|
document.body.addEventListener('click', this.globalClickHandler)
|
||||||
|
// eslint-disable-next-line react/no-find-dom-node
|
||||||
|
var container = findDOMNode(this)
|
||||||
|
this.container = container
|
||||||
|
}
|
||||||
|
|
||||||
|
this.transitionStarted = this.transitionstartOccured.bind(this)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* transitionstart event is not supported in Chrome yet. But it works for Firefox 53+.
|
||||||
|
* We need to handle this event only for FF because for Chrome we've hidden scrolls.
|
||||||
|
*/
|
||||||
|
this.menuDroppoContainer.current.addEventListener('transitionstart', this.transitionStarted)
|
||||||
|
|
||||||
|
this.transitionEnded = this.transitionendOccured.bind(this)
|
||||||
|
|
||||||
|
this.menuDroppoContainer.current.addEventListener('transitionend', this.transitionEnded)
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount () {
|
||||||
|
if (this && document.body) {
|
||||||
|
document.body.removeEventListener('click', this.globalClickHandler)
|
||||||
|
document.body.removeEventListener('transitionstart', this.transitionStarted)
|
||||||
|
document.body.removeEventListener('transitionend', this.transitionEnded)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
globalClickOccurred (event) {
|
||||||
|
const target = event.target
|
||||||
|
// eslint-disable-next-line react/no-find-dom-node
|
||||||
|
const container = findDOMNode(this)
|
||||||
|
|
||||||
|
if (target !== container &&
|
||||||
|
!this.isDescendant(this.container, event.target) &&
|
||||||
|
this.outsideClickHandler) {
|
||||||
|
this.outsideClickHandler(event)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
transitionstartOccured (event) {
|
||||||
|
this.menuDroppoContainer.current.style.overflow = 'hidden'
|
||||||
|
}
|
||||||
|
|
||||||
|
transitionendOccured (event) {
|
||||||
|
if (!this.props.constOverflow) {
|
||||||
|
this.menuDroppoContainer.current.style.overflow = 'auto'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
isDescendant (parent, child) {
|
||||||
|
var node = child.parentNode
|
||||||
|
while (node !== null) {
|
||||||
|
if (node === parent) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
node = node.parentNode
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +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 ReactTooltip = require('react-tooltip-component')
|
const ReactTooltip = require('react-tooltip')
|
||||||
|
|
||||||
module.exports = Tooltip
|
module.exports = Tooltip
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import ConfirmScreen from './components/confirm'
|
import ConfirmScreen from './components/confirm'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { connect } from 'react-redux'
|
|
||||||
import actions from '../../ui/app/actions'
|
import actions from '../../ui/app/actions'
|
||||||
|
|
||||||
class RemoveTokenScreen extends ConfirmScreen {
|
export default class RemoveTokenScreen extends ConfirmScreen {
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<ConfirmScreen
|
<ConfirmScreen
|
||||||
|
@ -21,5 +20,3 @@ class RemoveTokenScreen extends ConfirmScreen {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = connect()(RemoveTokenScreen)
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ var cssFiles = {
|
||||||
'index.css': fs.readFileSync(path.join(__dirname, '/app/css/index.css'), 'utf8'),
|
'index.css': fs.readFileSync(path.join(__dirname, '/app/css/index.css'), 'utf8'),
|
||||||
'transitions.css': fs.readFileSync(path.join(__dirname, '/app/css/transitions.css'), 'utf8'),
|
'transitions.css': fs.readFileSync(path.join(__dirname, '/app/css/transitions.css'), 'utf8'),
|
||||||
'first-time.css': fs.readFileSync(path.join(__dirname, '../mascara/src/app/first-time/index.css'), 'utf8'),
|
'first-time.css': fs.readFileSync(path.join(__dirname, '../mascara/src/app/first-time/index.css'), 'utf8'),
|
||||||
'react-tooltip-component.css': fs.readFileSync(path.join(__dirname, '..', 'node_modules', 'react-tooltip-component', 'dist', 'react-tooltip-component.css'), 'utf8'),
|
// 'react-tooltip.css': fs.readFileSync(path.join(__dirname, '..', 'node_modules', 'react-tooltip', 'dist', 'style.css'), 'utf8'),
|
||||||
'react-css': fs.readFileSync(path.join(__dirname, '..', 'node_modules', 'react-select', 'dist', 'react-select.css'), 'utf8'),
|
'react-css': fs.readFileSync(path.join(__dirname, '..', 'node_modules', 'react-select', 'dist', 'react-select.css'), 'utf8'),
|
||||||
'dropdowns.css': fs.readFileSync(path.join(__dirname, '/app/css/dropdowns.css'), 'utf8'),
|
'dropdowns.css': fs.readFileSync(path.join(__dirname, '/app/css/dropdowns.css'), 'utf8'),
|
||||||
'app-bar.css': fs.readFileSync(path.join(__dirname, '/app/css/app-bar.css'), 'utf8'),
|
'app-bar.css': fs.readFileSync(path.join(__dirname, '/app/css/app-bar.css'), 'utf8'),
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
37
package.json
37
package.json
|
@ -81,7 +81,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@material-ui/core": "1.0.0",
|
"@material-ui/core": "^4.1.1",
|
||||||
"@zxing/library": "^0.8.0",
|
"@zxing/library": "^0.8.0",
|
||||||
"abi-decoder": "^1.0.9",
|
"abi-decoder": "^1.0.9",
|
||||||
"asmcrypto.js": "0.22.0",
|
"asmcrypto.js": "0.22.0",
|
||||||
|
@ -92,7 +92,6 @@
|
||||||
"bip39": "^2.2.0",
|
"bip39": "^2.2.0",
|
||||||
"bluebird": "^3.5.0",
|
"bluebird": "^3.5.0",
|
||||||
"bn.js": "^4.11.7",
|
"bn.js": "^4.11.7",
|
||||||
"boron": "^0.2.3",
|
|
||||||
"browser-passworder": "^2.0.3",
|
"browser-passworder": "^2.0.3",
|
||||||
"browserify-derequire": "^0.9.4",
|
"browserify-derequire": "^0.9.4",
|
||||||
"browserify-unibabel": "^3.0.0",
|
"browserify-unibabel": "^3.0.0",
|
||||||
|
@ -121,13 +120,13 @@
|
||||||
"eth-net-props": "^1.0.23",
|
"eth-net-props": "^1.0.23",
|
||||||
"eth-phishing-detect": "^1.1.4",
|
"eth-phishing-detect": "^1.1.4",
|
||||||
"eth-query": "^2.1.2",
|
"eth-query": "^2.1.2",
|
||||||
"eth-sig-util": "^2.0.2",
|
"eth-sig-util": "^2.2.0",
|
||||||
"eth-token-watcher": "^1.1.6",
|
"eth-token-watcher": "^1.1.6",
|
||||||
"eth-trezor-keyring": "github:vbaranov/eth-trezor-keyring#0.3.0--clear-accounts-flag",
|
"eth-trezor-keyring": "github:vbaranov/eth-trezor-keyring#0.3.0--clear-accounts-flag",
|
||||||
"ethereumjs-abi": "^0.6.4",
|
"ethereumjs-abi": "^0.6.7",
|
||||||
"ethereumjs-tx": "^1.3.0",
|
"ethereumjs-tx": "^1.3.0",
|
||||||
"ethereumjs-util": "github:ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9",
|
"ethereumjs-util": "github:ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9",
|
||||||
"ethereumjs-wallet": "^0.6.0",
|
"ethereumjs-wallet": "^0.6.3",
|
||||||
"ethjs": "^0.4.0",
|
"ethjs": "^0.4.0",
|
||||||
"ethjs-contract": "^0.2.3",
|
"ethjs-contract": "^0.2.3",
|
||||||
"ethjs-ens": "^2.0.0",
|
"ethjs-ens": "^2.0.0",
|
||||||
|
@ -144,6 +143,7 @@
|
||||||
"gulp-autoprefixer": "^5.0.0",
|
"gulp-autoprefixer": "^5.0.0",
|
||||||
"gulp-sass": "^4.0.0",
|
"gulp-sass": "^4.0.0",
|
||||||
"human-standard-token-abi": "^2.0.0",
|
"human-standard-token-abi": "^2.0.0",
|
||||||
|
"i": "^0.3.6",
|
||||||
"idb-global": "^2.1.0",
|
"idb-global": "^2.1.0",
|
||||||
"iframe-stream": "^3.0.0",
|
"iframe-stream": "^3.0.0",
|
||||||
"inject-css": "^0.1.1",
|
"inject-css": "^0.1.1",
|
||||||
|
@ -158,6 +158,7 @@
|
||||||
"metamask-inpage-provider": "^1.2.2",
|
"metamask-inpage-provider": "^1.2.2",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"multihashes": "^0.4.12",
|
"multihashes": "^0.4.12",
|
||||||
|
"npm": "^6.9.0",
|
||||||
"number-to-bn": "^1.7.0",
|
"number-to-bn": "^1.7.0",
|
||||||
"obj-multiplex": "^1.0.0",
|
"obj-multiplex": "^1.0.0",
|
||||||
"obs-store": "^3.0.2",
|
"obs-store": "^3.0.2",
|
||||||
|
@ -169,26 +170,25 @@
|
||||||
"post-message-stream": "^3.0.0",
|
"post-message-stream": "^3.0.0",
|
||||||
"promise-filter": "^1.1.0",
|
"promise-filter": "^1.1.0",
|
||||||
"promise-to-callback": "^1.0.0",
|
"promise-to-callback": "^1.0.0",
|
||||||
"prop-types": "^15.6.1",
|
"prop-types": "^15.7.2",
|
||||||
"pump": "^3.0.0",
|
"pump": "^3.0.0",
|
||||||
"qrcode-npm": "0.0.3",
|
"qrcode-npm": "0.0.3",
|
||||||
"ramda": "^0.24.1",
|
"ramda": "^0.24.1",
|
||||||
"raven-js": "^3.24.2",
|
"raven-js": "^3.24.2",
|
||||||
"react": "^15.6.2",
|
"react": "^16.8.6",
|
||||||
"react-addons-css-transition-group": "^15.6.0",
|
"react-transition-group": "^1.2.1",
|
||||||
"react-dom": "^15.6.2",
|
"react-dom": "^16.8.6",
|
||||||
"react-hyperscript": "^3.0.0",
|
"react-hyperscript": "^3.0.0",
|
||||||
"react-inspector": "^2.3.0",
|
"react-inspector": "^2.3.0",
|
||||||
"react-markdown": "^3.0.0",
|
"react-markdown": "^3.0.0",
|
||||||
"react-media": "^1.8.0",
|
"react-media": "^1.8.0",
|
||||||
"react-redux": "^5.0.5",
|
"react-redux": "^7.1.0",
|
||||||
"react-router-dom": "^4.2.2",
|
"react-router-dom": "^4.2.2",
|
||||||
"react-select": "^1.0.0",
|
"react-select": "^1.0.0",
|
||||||
"react-simple-file-input": "^2.0.0",
|
"react-simple-file-input": "^2.0.0",
|
||||||
"react-tippy": "^1.2.2",
|
"react-tippy": "^1.2.2",
|
||||||
"react-toggle-button": "^2.2.0",
|
"react-toggle-button": "^2.2.0",
|
||||||
"react-tooltip-component": "^0.3.0",
|
"react-tooltip": "^3.10.0",
|
||||||
"react-transition-group": "^2.2.1",
|
|
||||||
"react-trigger-change": "^1.0.2",
|
"react-trigger-change": "^1.0.2",
|
||||||
"reactify": "^1.1.1",
|
"reactify": "^1.1.1",
|
||||||
"readable-stream": "^2.3.3",
|
"readable-stream": "^2.3.3",
|
||||||
|
@ -241,8 +241,8 @@
|
||||||
"deep-freeze-strict": "^1.1.1",
|
"deep-freeze-strict": "^1.1.1",
|
||||||
"del": "^3.0.0",
|
"del": "^3.0.0",
|
||||||
"envify": "^4.0.0",
|
"envify": "^4.0.0",
|
||||||
"enzyme": "^3.4.4",
|
"enzyme": "^3.10.0",
|
||||||
"enzyme-adapter-react-15": "^1.0.6",
|
"enzyme-adapter-react-16": "^1.14.0",
|
||||||
"eslint-plugin-chai": "0.0.1",
|
"eslint-plugin-chai": "0.0.1",
|
||||||
"eslint-plugin-json": "^1.2.0",
|
"eslint-plugin-json": "^1.2.0",
|
||||||
"eslint-plugin-mocha": "^5.0.0",
|
"eslint-plugin-mocha": "^5.0.0",
|
||||||
|
@ -254,7 +254,7 @@
|
||||||
"fs-extra": "^6.0.1",
|
"fs-extra": "^6.0.1",
|
||||||
"fs-promise": "^2.0.3",
|
"fs-promise": "^2.0.3",
|
||||||
"ganache-cli": "^6.1.0",
|
"ganache-cli": "^6.1.0",
|
||||||
"ganache-core": "^2.3.1",
|
"ganache-core": "^2.5.6",
|
||||||
"geckodriver": "^1.12.2",
|
"geckodriver": "^1.12.2",
|
||||||
"gh-pages": "^1.2.0",
|
"gh-pages": "^1.2.0",
|
||||||
"gifencoder": "^1.1.0",
|
"gifencoder": "^1.1.0",
|
||||||
|
@ -300,9 +300,8 @@
|
||||||
"qs": "^6.2.0",
|
"qs": "^6.2.0",
|
||||||
"qunitjs": "^2.4.1",
|
"qunitjs": "^2.4.1",
|
||||||
"radgrad-jsdoc-template": "^1.1.3",
|
"radgrad-jsdoc-template": "^1.1.3",
|
||||||
"react-addons-test-utils": "^15.5.1",
|
"react-test-renderer": "^16.8.6",
|
||||||
"react-test-renderer": "^15.6.2",
|
"react-testutils-additions": "^16.0.2",
|
||||||
"react-testutils-additions": "^15.2.0",
|
|
||||||
"redux-mock-store": "^1.5.3",
|
"redux-mock-store": "^1.5.3",
|
||||||
"redux-test-utils": "^0.2.2",
|
"redux-test-utils": "^0.2.2",
|
||||||
"resolve-url-loader": "^2.3.0",
|
"resolve-url-loader": "^2.3.0",
|
||||||
|
@ -323,7 +322,7 @@
|
||||||
"watchify": "^3.11.0"
|
"watchify": "^3.11.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "8.15.0",
|
"node": "10.15.3",
|
||||||
"npm": "^6.9.0"
|
"npm": "^6.9.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const Ganache = require('ganache-core')
|
const Ganache = require('ganache-core')
|
||||||
const nock = require('nock')
|
const nock = require('nock')
|
||||||
import Enzyme from 'enzyme'
|
import Enzyme from 'enzyme'
|
||||||
import Adapter from 'enzyme-adapter-react-15'
|
import Adapter from 'enzyme-adapter-react-16'
|
||||||
|
|
||||||
nock.disableNetConnect()
|
nock.disableNetConnect()
|
||||||
nock.enableNetConnect('localhost')
|
nock.enableNetConnect('localhost')
|
||||||
|
@ -32,7 +32,8 @@ global.fetch = require('isomorphic-fetch')
|
||||||
require('jsdom-global')()
|
require('jsdom-global')()
|
||||||
|
|
||||||
// localStorage
|
// localStorage
|
||||||
window.localStorage = {}
|
// window.localStorage = {}
|
||||||
|
Object.defineProperty(window, 'localStorage', {value: {}})
|
||||||
|
|
||||||
// crypto.getRandomValues
|
// crypto.getRandomValues
|
||||||
if (!window.crypto) window.crypto = {}
|
if (!window.crypto) window.crypto = {}
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
var assert = require('assert')
|
import React from 'react'
|
||||||
|
import assert from 'assert'
|
||||||
|
|
||||||
const additions = require('react-testutils-additions')
|
import additions from 'react-testutils-additions'
|
||||||
const h = require('react-hyperscript')
|
import ReactTestUtils from 'react-dom/test-utils'
|
||||||
const ReactTestUtils = require('react-addons-test-utils')
|
import { BN } from 'ethereumjs-util'
|
||||||
const ethUtil = require('ethereumjs-util')
|
|
||||||
const BN = ethUtil.BN
|
|
||||||
|
|
||||||
var BnInput = require('../../../old-ui/app/components/bn-as-decimal-input')
|
import BnInput from '../../../old-ui/app/components/bn-as-decimal-input'
|
||||||
|
|
||||||
describe('BnInput', function () {
|
describe('BnInput', function () {
|
||||||
it('can tolerate a gas decimal number at a high precision', function (done) {
|
it('can tolerate a gas decimal number at a high precision', function (done) {
|
||||||
const renderer = ReactTestUtils.createRenderer()
|
// const renderer = ReactTestUtils.createRenderer()
|
||||||
|
|
||||||
let valueStr = '20'
|
let valueStr = '20'
|
||||||
while (valueStr.length < 20) {
|
while (valueStr.length < 20) {
|
||||||
|
@ -29,19 +28,19 @@ describe('BnInput', function () {
|
||||||
const precision = 18 // ether precision
|
const precision = 18 // ether precision
|
||||||
const scale = 18
|
const scale = 18
|
||||||
|
|
||||||
const props = {
|
const onChange = (newBn) => {
|
||||||
|
assert.equal(newBn.toString(), target.toString(), 'should tolerate increase')
|
||||||
|
done()
|
||||||
|
}
|
||||||
|
|
||||||
|
const inputComponent = <BnInput {...{
|
||||||
value,
|
value,
|
||||||
scale,
|
scale,
|
||||||
precision,
|
precision,
|
||||||
onChange: (newBn) => {
|
onChange,
|
||||||
assert.equal(newBn.toString(), target.toString(), 'should tolerate increase')
|
}}/>
|
||||||
done()
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
const inputComponent = h(BnInput, props)
|
|
||||||
const component = additions.renderIntoDocument(inputComponent)
|
const component = additions.renderIntoDocument(inputComponent)
|
||||||
renderer.render(inputComponent)
|
ReactTestUtils.mockComponent(inputComponent)
|
||||||
const input = additions.find(component, 'input.hex-input')[0]
|
const input = additions.find(component, 'input.hex-input')[0]
|
||||||
ReactTestUtils.Simulate.change(input, { preventDefault () {}, target: {
|
ReactTestUtils.Simulate.change(input, { preventDefault () {}, target: {
|
||||||
value: inputStr,
|
value: inputStr,
|
||||||
|
@ -50,7 +49,7 @@ describe('BnInput', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can tolerate wei precision', function (done) {
|
it('can tolerate wei precision', function (done) {
|
||||||
const renderer = ReactTestUtils.createRenderer()
|
// const renderer = ReactTestUtils.createRenderer()
|
||||||
|
|
||||||
const valueStr = '1000000000'
|
const valueStr = '1000000000'
|
||||||
|
|
||||||
|
@ -71,15 +70,15 @@ describe('BnInput', function () {
|
||||||
precision,
|
precision,
|
||||||
onChange: (newBn) => {
|
onChange: (newBn) => {
|
||||||
assert.equal(newBn.toString(), target.toString(), 'should tolerate increase')
|
assert.equal(newBn.toString(), target.toString(), 'should tolerate increase')
|
||||||
const reInput = BnInput.prototype.downsize(newBn.toString(), 9, 9)
|
const reInput = BnInput.downsize(newBn.toString(), 9, 9)
|
||||||
assert.equal(reInput.toString(), inputStr, 'should tolerate increase')
|
assert.equal(reInput.toString(), inputStr, 'should tolerate increase')
|
||||||
done()
|
done()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const inputComponent = h(BnInput, props)
|
const inputComponent = <BnInput {...{props}}/>
|
||||||
const component = additions.renderIntoDocument(inputComponent)
|
const component = additions.renderIntoDocument(inputComponent)
|
||||||
renderer.render(inputComponent)
|
ReactTestUtils.mockComponent(inputComponent)
|
||||||
const input = additions.find(component, 'input.hex-input')[0]
|
const input = additions.find(component, 'input.hex-input')[0]
|
||||||
ReactTestUtils.Simulate.change(input, { preventDefault () {}, target: {
|
ReactTestUtils.Simulate.change(input, { preventDefault () {}, target: {
|
||||||
value: inputStr,
|
value: inputStr,
|
||||||
|
|
|
@ -2,7 +2,7 @@ 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 findDOMNode = require('react-dom').findDOMNode
|
const findDOMNode = require('react-dom').findDOMNode
|
||||||
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
|
import { CSSTransitionGroup } from 'react-transition-group'
|
||||||
|
|
||||||
module.exports = MenuDroppoComponent
|
module.exports = MenuDroppoComponent
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ MenuDroppoComponent.prototype.render = function () {
|
||||||
`),
|
`),
|
||||||
|
|
||||||
useCssTransition
|
useCssTransition
|
||||||
? h(ReactCSSTransitionGroup, {
|
? h(CSSTransitionGroup, {
|
||||||
className: 'css-transition-group',
|
className: 'css-transition-group',
|
||||||
transitionName: 'menu-droppo',
|
transitionName: 'menu-droppo',
|
||||||
transitionEnterTimeout: parseInt(speed),
|
transitionEnterTimeout: parseInt(speed),
|
||||||
|
|
|
@ -1,483 +1,491 @@
|
||||||
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 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')
|
||||||
const { getEnvironmentType } = require('../../../../app/scripts/lib/util')
|
// const { getEnvironmentType } = require('../../../../app/scripts/lib/util')
|
||||||
const { ENVIRONMENT_TYPE_POPUP } = require('../../../../app/scripts/lib/enums')
|
// const { ENVIRONMENT_TYPE_POPUP } = require('../../../../app/scripts/lib/enums')
|
||||||
|
|
||||||
// Modal Components
|
// // Modal Components
|
||||||
const BuyOptions = require('./buy-options-modal')
|
// const BuyOptions = require('./buy-options-modal')
|
||||||
const DepositEtherModal = require('./deposit-ether-modal')
|
// const DepositEtherModal = require('./deposit-ether-modal')
|
||||||
const AccountDetailsModal = require('./account-details-modal')
|
// const AccountDetailsModal = require('./account-details-modal')
|
||||||
const EditAccountNameModal = require('./edit-account-name-modal')
|
// const EditAccountNameModal = require('./edit-account-name-modal')
|
||||||
const ExportPrivateKeyModal = require('./export-private-key-modal')
|
// const ExportPrivateKeyModal = require('./export-private-key-modal')
|
||||||
const NewAccountModal = require('./new-account-modal')
|
// const NewAccountModal = require('./new-account-modal')
|
||||||
const ShapeshiftDepositTxModal = require('./shapeshift-deposit-tx-modal.js')
|
// const ShapeshiftDepositTxModal = require('./shapeshift-deposit-tx-modal.js')
|
||||||
const HideTokenConfirmationModal = require('./hide-token-confirmation-modal')
|
// const HideTokenConfirmationModal = require('./hide-token-confirmation-modal')
|
||||||
const CustomizeGasModal = require('../customize-gas-modal')
|
// const CustomizeGasModal = require('../customize-gas-modal')
|
||||||
const NotifcationModal = require('./notification-modal')
|
// const NotifcationModal = require('./notification-modal')
|
||||||
const QRScanner = require('./qr-scanner')
|
// const QRScanner = require('./qr-scanner')
|
||||||
|
|
||||||
import ConfirmRemoveAccount from './confirm-remove-account'
|
// import ConfirmRemoveAccount from './confirm-remove-account'
|
||||||
import ConfirmResetAccount from './confirm-reset-account'
|
// import ConfirmResetAccount from './confirm-reset-account'
|
||||||
import TransactionConfirmed from './transaction-confirmed'
|
// import TransactionConfirmed from './transaction-confirmed'
|
||||||
import ConfirmCustomizeGasModal from './customize-gas'
|
// import ConfirmCustomizeGasModal from './customize-gas'
|
||||||
import CancelTransaction from './cancel-transaction'
|
// import CancelTransaction from './cancel-transaction'
|
||||||
import WelcomeBeta from './welcome-beta'
|
// import WelcomeBeta from './welcome-beta'
|
||||||
import TransactionDetails from './transaction-details'
|
// import TransactionDetails from './transaction-details'
|
||||||
import RejectTransactions from './reject-transactions'
|
// import RejectTransactions from './reject-transactions'
|
||||||
|
|
||||||
const modalContainerBaseStyle = {
|
// const modalContainerBaseStyle = {
|
||||||
transform: 'translate3d(-50%, 0, 0px)',
|
// transform: 'translate3d(-50%, 0, 0px)',
|
||||||
border: '1px solid #CCCFD1',
|
// border: '1px solid #CCCFD1',
|
||||||
borderRadius: '8px',
|
// borderRadius: '8px',
|
||||||
backgroundColor: '#FFFFFF',
|
// backgroundColor: '#FFFFFF',
|
||||||
boxShadow: '0 2px 22px 0 rgba(0,0,0,0.2)',
|
// boxShadow: '0 2px 22px 0 rgba(0,0,0,0.2)',
|
||||||
}
|
// }
|
||||||
|
|
||||||
const modalContainerLaptopStyle = {
|
// const modalContainerLaptopStyle = {
|
||||||
...modalContainerBaseStyle,
|
// ...modalContainerBaseStyle,
|
||||||
width: '344px',
|
// width: '344px',
|
||||||
top: '15%',
|
// top: '15%',
|
||||||
}
|
// }
|
||||||
|
|
||||||
const modalContainerMobileStyle = {
|
// const modalContainerMobileStyle = {
|
||||||
...modalContainerBaseStyle,
|
// ...modalContainerBaseStyle,
|
||||||
width: '309px',
|
// width: '309px',
|
||||||
top: '12.5%',
|
// top: '12.5%',
|
||||||
}
|
// }
|
||||||
|
|
||||||
const accountModalStyle = {
|
// const accountModalStyle = {
|
||||||
mobileModalStyle: {
|
// mobileModalStyle: {
|
||||||
width: '95%',
|
// width: '95%',
|
||||||
// top: isPopupOrNotification() === 'popup' ? '52vh' : '36.5vh',
|
// // top: isPopupOrNotification() === 'popup' ? '52vh' : '36.5vh',
|
||||||
boxShadow: 'rgba(0, 0, 0, 0.15) 0px 2px 2px 2px',
|
// boxShadow: 'rgba(0, 0, 0, 0.15) 0px 2px 2px 2px',
|
||||||
borderRadius: '4px',
|
// borderRadius: '4px',
|
||||||
top: '10%',
|
// top: '10%',
|
||||||
transform: 'none',
|
// transform: 'none',
|
||||||
left: '0',
|
// left: '0',
|
||||||
right: '0',
|
// right: '0',
|
||||||
margin: '0 auto',
|
// margin: '0 auto',
|
||||||
},
|
// },
|
||||||
laptopModalStyle: {
|
// laptopModalStyle: {
|
||||||
width: '360px',
|
// width: '360px',
|
||||||
// top: 'calc(33% + 45px)',
|
// // top: 'calc(33% + 45px)',
|
||||||
boxShadow: 'rgba(0, 0, 0, 0.15) 0px 2px 2px 2px',
|
// boxShadow: 'rgba(0, 0, 0, 0.15) 0px 2px 2px 2px',
|
||||||
borderRadius: '4px',
|
// borderRadius: '4px',
|
||||||
top: '10%',
|
// top: '10%',
|
||||||
transform: 'none',
|
// transform: 'none',
|
||||||
left: '0',
|
// left: '0',
|
||||||
right: '0',
|
// right: '0',
|
||||||
margin: '0 auto',
|
// margin: '0 auto',
|
||||||
},
|
// },
|
||||||
contentStyle: {
|
// contentStyle: {
|
||||||
borderRadius: '4px',
|
// borderRadius: '4px',
|
||||||
},
|
// },
|
||||||
}
|
// }
|
||||||
|
|
||||||
const MODALS = {
|
// // const MODALS = {
|
||||||
BUY: {
|
// // BUY: {
|
||||||
contents: [
|
// // contents: [
|
||||||
h(BuyOptions, {}, []),
|
// // h(BuyOptions, {}, []),
|
||||||
],
|
// // ],
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
width: '95%',
|
// // width: '95%',
|
||||||
// top: isPopupOrNotification() === 'popup' ? '48vh' : '36.5vh',
|
// // // top: isPopupOrNotification() === 'popup' ? '48vh' : '36.5vh',
|
||||||
transform: 'none',
|
// // transform: 'none',
|
||||||
left: '0',
|
// // left: '0',
|
||||||
right: '0',
|
// // right: '0',
|
||||||
margin: '0 auto',
|
// // margin: '0 auto',
|
||||||
boxShadow: '0 0 7px 0 rgba(0,0,0,0.08)',
|
// // boxShadow: '0 0 7px 0 rgba(0,0,0,0.08)',
|
||||||
top: '10%',
|
// // top: '10%',
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
width: '66%',
|
// // width: '66%',
|
||||||
maxWidth: '550px',
|
// // maxWidth: '550px',
|
||||||
top: 'calc(10% + 10px)',
|
// // top: 'calc(10% + 10px)',
|
||||||
left: '0',
|
// // left: '0',
|
||||||
right: '0',
|
// // right: '0',
|
||||||
margin: '0 auto',
|
// // margin: '0 auto',
|
||||||
boxShadow: '0 0 7px 0 rgba(0,0,0,0.08)',
|
// // boxShadow: '0 0 7px 0 rgba(0,0,0,0.08)',
|
||||||
transform: 'none',
|
// // transform: 'none',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
DEPOSIT_ETHER: {
|
// // DEPOSIT_ETHER: {
|
||||||
contents: [
|
// // contents: [
|
||||||
h(DepositEtherModal, {}, []),
|
// // h(DepositEtherModal, {}, []),
|
||||||
],
|
// // ],
|
||||||
onHide: (props) => props.hideWarning(),
|
// // onHide: (props) => props.hideWarning(),
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
width: '100%',
|
// // width: '100%',
|
||||||
height: '100%',
|
// // height: '100%',
|
||||||
transform: 'none',
|
// // transform: 'none',
|
||||||
left: '0',
|
// // left: '0',
|
||||||
right: '0',
|
// // right: '0',
|
||||||
margin: '0 auto',
|
// // margin: '0 auto',
|
||||||
boxShadow: '0 0 7px 0 rgba(0,0,0,0.08)',
|
// // boxShadow: '0 0 7px 0 rgba(0,0,0,0.08)',
|
||||||
top: '0',
|
// // top: '0',
|
||||||
display: 'flex',
|
// // display: 'flex',
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
width: '850px',
|
// // width: '850px',
|
||||||
top: 'calc(10% + 10px)',
|
// // top: 'calc(10% + 10px)',
|
||||||
left: '0',
|
// // left: '0',
|
||||||
right: '0',
|
// // right: '0',
|
||||||
margin: '0 auto',
|
// // margin: '0 auto',
|
||||||
boxShadow: '0 0 6px 0 rgba(0,0,0,0.3)',
|
// // boxShadow: '0 0 6px 0 rgba(0,0,0,0.3)',
|
||||||
borderRadius: '7px',
|
// // borderRadius: '7px',
|
||||||
transform: 'none',
|
// // transform: 'none',
|
||||||
height: 'calc(80% - 20px)',
|
// // height: 'calc(80% - 20px)',
|
||||||
overflowY: 'hidden',
|
// // overflowY: 'hidden',
|
||||||
},
|
// // },
|
||||||
contentStyle: {
|
// // contentStyle: {
|
||||||
borderRadius: '7px',
|
// // borderRadius: '7px',
|
||||||
height: '100%',
|
// // height: '100%',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
EDIT_ACCOUNT_NAME: {
|
// // EDIT_ACCOUNT_NAME: {
|
||||||
contents: [
|
// // contents: [
|
||||||
h(EditAccountNameModal, {}, []),
|
// // h(EditAccountNameModal, {}, []),
|
||||||
],
|
// // ],
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
width: '95%',
|
// // width: '95%',
|
||||||
// top: isPopupOrNotification() === 'popup' ? '48vh' : '36.5vh',
|
// // // top: isPopupOrNotification() === 'popup' ? '48vh' : '36.5vh',
|
||||||
top: '10%',
|
// // top: '10%',
|
||||||
boxShadow: 'rgba(0, 0, 0, 0.15) 0px 2px 2px 2px',
|
// // boxShadow: 'rgba(0, 0, 0, 0.15) 0px 2px 2px 2px',
|
||||||
transform: 'none',
|
// // transform: 'none',
|
||||||
left: '0',
|
// // left: '0',
|
||||||
right: '0',
|
// // right: '0',
|
||||||
margin: '0 auto',
|
// // margin: '0 auto',
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
width: '375px',
|
// // width: '375px',
|
||||||
// top: 'calc(30% + 10px)',
|
// // // top: 'calc(30% + 10px)',
|
||||||
top: '10%',
|
// // top: '10%',
|
||||||
boxShadow: 'rgba(0, 0, 0, 0.15) 0px 2px 2px 2px',
|
// // boxShadow: 'rgba(0, 0, 0, 0.15) 0px 2px 2px 2px',
|
||||||
transform: 'none',
|
// // transform: 'none',
|
||||||
left: '0',
|
// // left: '0',
|
||||||
right: '0',
|
// // right: '0',
|
||||||
margin: '0 auto',
|
// // margin: '0 auto',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
ACCOUNT_DETAILS: {
|
// // ACCOUNT_DETAILS: {
|
||||||
contents: [
|
// // contents: [
|
||||||
h(AccountDetailsModal, {}, []),
|
// // h(AccountDetailsModal, {}, []),
|
||||||
],
|
// // ],
|
||||||
...accountModalStyle,
|
// // ...accountModalStyle,
|
||||||
},
|
// // },
|
||||||
|
|
||||||
EXPORT_PRIVATE_KEY: {
|
// // EXPORT_PRIVATE_KEY: {
|
||||||
contents: [
|
// // contents: [
|
||||||
h(ExportPrivateKeyModal, {}, []),
|
// // h(ExportPrivateKeyModal, {}, []),
|
||||||
],
|
// // ],
|
||||||
...accountModalStyle,
|
// // ...accountModalStyle,
|
||||||
},
|
// // },
|
||||||
|
|
||||||
SHAPESHIFT_DEPOSIT_TX: {
|
// // SHAPESHIFT_DEPOSIT_TX: {
|
||||||
contents: [
|
// // contents: [
|
||||||
h(ShapeshiftDepositTxModal),
|
// // h(ShapeshiftDepositTxModal),
|
||||||
],
|
// // ],
|
||||||
...accountModalStyle,
|
// // ...accountModalStyle,
|
||||||
},
|
// // },
|
||||||
|
|
||||||
HIDE_TOKEN_CONFIRMATION: {
|
// // HIDE_TOKEN_CONFIRMATION: {
|
||||||
contents: [
|
// // contents: [
|
||||||
h(HideTokenConfirmationModal, {}, []),
|
// // h(HideTokenConfirmationModal, {}, []),
|
||||||
],
|
// // ],
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
width: '95%',
|
// // width: '95%',
|
||||||
top: getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_POPUP ? '52vh' : '36.5vh',
|
// // top: getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_POPUP ? '52vh' : '36.5vh',
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
width: '449px',
|
// // width: '449px',
|
||||||
top: 'calc(33% + 45px)',
|
// // top: 'calc(33% + 45px)',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
BETA_UI_NOTIFICATION_MODAL: {
|
// // BETA_UI_NOTIFICATION_MODAL: {
|
||||||
contents: h(WelcomeBeta),
|
// // contents: h(WelcomeBeta),
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
...modalContainerMobileStyle,
|
// // ...modalContainerMobileStyle,
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
...modalContainerLaptopStyle,
|
// // ...modalContainerLaptopStyle,
|
||||||
},
|
// // },
|
||||||
contentStyle: {
|
// // contentStyle: {
|
||||||
borderRadius: '8px',
|
// // borderRadius: '8px',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
OLD_UI_NOTIFICATION_MODAL: {
|
// // OLD_UI_NOTIFICATION_MODAL: {
|
||||||
contents: [
|
// // contents: [
|
||||||
h(NotifcationModal, {
|
// // h(NotifcationModal, {
|
||||||
header: 'oldUI',
|
// // header: 'oldUI',
|
||||||
message: 'oldUIMessage',
|
// // message: 'oldUIMessage',
|
||||||
}),
|
// // }),
|
||||||
],
|
// // ],
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
width: '95%',
|
// // width: '95%',
|
||||||
top: getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_POPUP ? '52vh' : '36.5vh',
|
// // top: getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_POPUP ? '52vh' : '36.5vh',
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
width: '449px',
|
// // width: '449px',
|
||||||
top: 'calc(33% + 45px)',
|
// // top: 'calc(33% + 45px)',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
CONFIRM_RESET_ACCOUNT: {
|
// // CONFIRM_RESET_ACCOUNT: {
|
||||||
contents: h(ConfirmResetAccount),
|
// // contents: h(ConfirmResetAccount),
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
...modalContainerMobileStyle,
|
// // ...modalContainerMobileStyle,
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
...modalContainerLaptopStyle,
|
// // ...modalContainerLaptopStyle,
|
||||||
},
|
// // },
|
||||||
contentStyle: {
|
// // contentStyle: {
|
||||||
borderRadius: '8px',
|
// // borderRadius: '8px',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
CONFIRM_REMOVE_ACCOUNT: {
|
// // CONFIRM_REMOVE_ACCOUNT: {
|
||||||
contents: h(ConfirmRemoveAccount),
|
// // contents: h(ConfirmRemoveAccount),
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
...modalContainerMobileStyle,
|
// // ...modalContainerMobileStyle,
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
...modalContainerLaptopStyle,
|
// // ...modalContainerLaptopStyle,
|
||||||
},
|
// // },
|
||||||
contentStyle: {
|
// // contentStyle: {
|
||||||
borderRadius: '8px',
|
// // borderRadius: '8px',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
NEW_ACCOUNT: {
|
// // NEW_ACCOUNT: {
|
||||||
contents: [
|
// // contents: [
|
||||||
h(NewAccountModal, {}, []),
|
// // h(NewAccountModal, {}, []),
|
||||||
],
|
// // ],
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
width: '95%',
|
// // width: '95%',
|
||||||
// top: isPopupOrNotification() === 'popup' ? '52vh' : '36.5vh',
|
// // // top: isPopupOrNotification() === 'popup' ? '52vh' : '36.5vh',
|
||||||
top: '10%',
|
// // top: '10%',
|
||||||
transform: 'none',
|
// // transform: 'none',
|
||||||
left: '0',
|
// // left: '0',
|
||||||
right: '0',
|
// // right: '0',
|
||||||
margin: '0 auto',
|
// // margin: '0 auto',
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
width: '449px',
|
// // width: '449px',
|
||||||
// top: 'calc(33% + 45px)',
|
// // // top: 'calc(33% + 45px)',
|
||||||
top: '10%',
|
// // top: '10%',
|
||||||
transform: 'none',
|
// // transform: 'none',
|
||||||
left: '0',
|
// // left: '0',
|
||||||
right: '0',
|
// // right: '0',
|
||||||
margin: '0 auto',
|
// // margin: '0 auto',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
CUSTOMIZE_GAS: {
|
// // CUSTOMIZE_GAS: {
|
||||||
contents: [
|
// // contents: [
|
||||||
h(CustomizeGasModal),
|
// // h(CustomizeGasModal),
|
||||||
],
|
// // ],
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
width: '100vw',
|
// // width: '100vw',
|
||||||
height: '100vh',
|
// // height: '100vh',
|
||||||
top: '0',
|
// // top: '0',
|
||||||
transform: 'none',
|
// // transform: 'none',
|
||||||
left: '0',
|
// // left: '0',
|
||||||
right: '0',
|
// // right: '0',
|
||||||
margin: '0 auto',
|
// // margin: '0 auto',
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
width: '720px',
|
// // width: '720px',
|
||||||
height: '377px',
|
// // height: '377px',
|
||||||
top: '80px',
|
// // top: '80px',
|
||||||
transform: 'none',
|
// // transform: 'none',
|
||||||
left: '0',
|
// // left: '0',
|
||||||
right: '0',
|
// // right: '0',
|
||||||
margin: '0 auto',
|
// // margin: '0 auto',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
CONFIRM_CUSTOMIZE_GAS: {
|
// // CONFIRM_CUSTOMIZE_GAS: {
|
||||||
contents: h(ConfirmCustomizeGasModal),
|
// // contents: h(ConfirmCustomizeGasModal),
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
width: '100vw',
|
// // width: '100vw',
|
||||||
height: '100vh',
|
// // height: '100vh',
|
||||||
top: '0',
|
// // top: '0',
|
||||||
transform: 'none',
|
// // transform: 'none',
|
||||||
left: '0',
|
// // left: '0',
|
||||||
right: '0',
|
// // right: '0',
|
||||||
margin: '0 auto',
|
// // margin: '0 auto',
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
width: '720px',
|
// // width: '720px',
|
||||||
height: '377px',
|
// // height: '377px',
|
||||||
top: '80px',
|
// // top: '80px',
|
||||||
transform: 'none',
|
// // transform: 'none',
|
||||||
left: '0',
|
// // left: '0',
|
||||||
right: '0',
|
// // right: '0',
|
||||||
margin: '0 auto',
|
// // margin: '0 auto',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
TRANSACTION_CONFIRMED: {
|
// // TRANSACTION_CONFIRMED: {
|
||||||
disableBackdropClick: true,
|
// // disableBackdropClick: true,
|
||||||
contents: h(TransactionConfirmed),
|
// // contents: h(TransactionConfirmed),
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
...modalContainerMobileStyle,
|
// // ...modalContainerMobileStyle,
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
...modalContainerLaptopStyle,
|
// // ...modalContainerLaptopStyle,
|
||||||
},
|
// // },
|
||||||
contentStyle: {
|
// // contentStyle: {
|
||||||
borderRadius: '8px',
|
// // borderRadius: '8px',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
QR_SCANNER: {
|
// // QR_SCANNER: {
|
||||||
contents: h(QRScanner),
|
// // contents: h(QRScanner),
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
...modalContainerMobileStyle,
|
// // ...modalContainerMobileStyle,
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
...modalContainerLaptopStyle,
|
// // ...modalContainerLaptopStyle,
|
||||||
},
|
// // },
|
||||||
contentStyle: {
|
// // contentStyle: {
|
||||||
borderRadius: '8px',
|
// // borderRadius: '8px',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
CANCEL_TRANSACTION: {
|
// // CANCEL_TRANSACTION: {
|
||||||
contents: h(CancelTransaction),
|
// // contents: h(CancelTransaction),
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
...modalContainerMobileStyle,
|
// // ...modalContainerMobileStyle,
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
...modalContainerLaptopStyle,
|
// // ...modalContainerLaptopStyle,
|
||||||
},
|
// // },
|
||||||
contentStyle: {
|
// // contentStyle: {
|
||||||
borderRadius: '8px',
|
// // borderRadius: '8px',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
TRANSACTION_DETAILS: {
|
// // TRANSACTION_DETAILS: {
|
||||||
contents: h(TransactionDetails),
|
// // contents: h(TransactionDetails),
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
...modalContainerMobileStyle,
|
// // ...modalContainerMobileStyle,
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
...modalContainerLaptopStyle,
|
// // ...modalContainerLaptopStyle,
|
||||||
},
|
// // },
|
||||||
contentStyle: {
|
// // contentStyle: {
|
||||||
borderRadius: '8px',
|
// // borderRadius: '8px',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
REJECT_TRANSACTIONS: {
|
// // REJECT_TRANSACTIONS: {
|
||||||
contents: h(RejectTransactions),
|
// // contents: h(RejectTransactions),
|
||||||
mobileModalStyle: {
|
// // mobileModalStyle: {
|
||||||
...modalContainerMobileStyle,
|
// // ...modalContainerMobileStyle,
|
||||||
},
|
// // },
|
||||||
laptopModalStyle: {
|
// // laptopModalStyle: {
|
||||||
...modalContainerLaptopStyle,
|
// // ...modalContainerLaptopStyle,
|
||||||
},
|
// // },
|
||||||
contentStyle: {
|
// // contentStyle: {
|
||||||
borderRadius: '8px',
|
// // borderRadius: '8px',
|
||||||
},
|
// // },
|
||||||
},
|
// // },
|
||||||
|
|
||||||
DEFAULT: {
|
// // DEFAULT: {
|
||||||
contents: [],
|
// // contents: [],
|
||||||
mobileModalStyle: {},
|
// // mobileModalStyle: {},
|
||||||
laptopModalStyle: {},
|
// // laptopModalStyle: {},
|
||||||
},
|
// // },
|
||||||
}
|
// // }
|
||||||
|
|
||||||
const BACKDROPSTYLE = {
|
// // const BACKDROPSTYLE = {
|
||||||
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
// // backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
||||||
}
|
// // }
|
||||||
|
|
||||||
function mapStateToProps (state) {
|
// function mapStateToProps (state) {
|
||||||
return {
|
// return {
|
||||||
active: state.appState.modal.open,
|
// active: state.appState.modal.open,
|
||||||
modalState: state.appState.modal.modalState,
|
// modalState: state.appState.modal.modalState,
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// function mapDispatchToProps (dispatch) {
|
||||||
|
// return {
|
||||||
|
// hideModal: () => {
|
||||||
|
// dispatch(actions.hideModal())
|
||||||
|
// },
|
||||||
|
// hideWarning: () => {
|
||||||
|
// dispatch(actions.hideWarning())
|
||||||
|
// },
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // Global Modal Component
|
||||||
|
// inherits(Modal, Component)
|
||||||
|
// function Modal () {
|
||||||
|
// Component.call(this)
|
||||||
|
// }
|
||||||
|
|
||||||
|
// module.exports = connect(mapStateToProps, mapDispatchToProps)(Modal)
|
||||||
|
|
||||||
|
// Modal.prototype.render = function () {
|
||||||
|
// // const modal = MODALS[this.props.modalState.name || 'DEFAULT']
|
||||||
|
|
||||||
|
// // const { contents: children, disableBackdropClick = false } = modal
|
||||||
|
// // const modalStyle = modal[isMobileView() ? 'mobileModalStyle' : 'laptopModalStyle']
|
||||||
|
// // const contentStyle = modal.contentStyle || {}
|
||||||
|
|
||||||
|
// // todo
|
||||||
|
// return null
|
||||||
|
// // return h(FadeModal,
|
||||||
|
// // {
|
||||||
|
// // className: 'modal',
|
||||||
|
// // keyboard: false,
|
||||||
|
// // onHide: () => {
|
||||||
|
// // if (modal.onHide) {
|
||||||
|
// // modal.onHide(this.props)
|
||||||
|
// // }
|
||||||
|
// // this.onHide()
|
||||||
|
// // },
|
||||||
|
// // ref: (ref) => {
|
||||||
|
// // this.modalRef = ref
|
||||||
|
// // },
|
||||||
|
// // modalStyle,
|
||||||
|
// // contentStyle,
|
||||||
|
// // backdropStyle: BACKDROPSTYLE,
|
||||||
|
// // closeOnClick: !disableBackdropClick,
|
||||||
|
// // },
|
||||||
|
// // children,
|
||||||
|
// // )
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Modal.prototype.componentWillReceiveProps = function (nextProps) {
|
||||||
|
// if (nextProps.active) {
|
||||||
|
// this.show()
|
||||||
|
// } else if (this.props.active) {
|
||||||
|
// this.hide()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Modal.prototype.onHide = function () {
|
||||||
|
// if (this.props.onHideCallback) {
|
||||||
|
// this.props.onHideCallback()
|
||||||
|
// }
|
||||||
|
// this.props.hideModal()
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Modal.prototype.hide = function () {
|
||||||
|
// this.modalRef.hide()
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Modal.prototype.show = function () {
|
||||||
|
// this.modalRef.show()
|
||||||
|
// }
|
||||||
|
|
||||||
|
export default class Modal {
|
||||||
|
render () {
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function mapDispatchToProps (dispatch) {
|
|
||||||
return {
|
|
||||||
hideModal: () => {
|
|
||||||
dispatch(actions.hideModal())
|
|
||||||
},
|
|
||||||
hideWarning: () => {
|
|
||||||
dispatch(actions.hideWarning())
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Global Modal Component
|
|
||||||
inherits(Modal, Component)
|
|
||||||
function Modal () {
|
|
||||||
Component.call(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = connect(mapStateToProps, mapDispatchToProps)(Modal)
|
|
||||||
|
|
||||||
Modal.prototype.render = function () {
|
|
||||||
const modal = MODALS[this.props.modalState.name || 'DEFAULT']
|
|
||||||
|
|
||||||
const { contents: children, disableBackdropClick = false } = modal
|
|
||||||
const modalStyle = modal[isMobileView() ? 'mobileModalStyle' : 'laptopModalStyle']
|
|
||||||
const contentStyle = modal.contentStyle || {}
|
|
||||||
|
|
||||||
return h(FadeModal,
|
|
||||||
{
|
|
||||||
className: 'modal',
|
|
||||||
keyboard: false,
|
|
||||||
onHide: () => {
|
|
||||||
if (modal.onHide) {
|
|
||||||
modal.onHide(this.props)
|
|
||||||
}
|
|
||||||
this.onHide()
|
|
||||||
},
|
|
||||||
ref: (ref) => {
|
|
||||||
this.modalRef = ref
|
|
||||||
},
|
|
||||||
modalStyle,
|
|
||||||
contentStyle,
|
|
||||||
backdropStyle: BACKDROPSTYLE,
|
|
||||||
closeOnClick: !disableBackdropClick,
|
|
||||||
},
|
|
||||||
children,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.componentWillReceiveProps = function (nextProps) {
|
|
||||||
if (nextProps.active) {
|
|
||||||
this.show()
|
|
||||||
} else if (this.props.active) {
|
|
||||||
this.hide()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.onHide = function () {
|
|
||||||
if (this.props.onHideCallback) {
|
|
||||||
this.props.onHideCallback()
|
|
||||||
}
|
|
||||||
this.props.hideModal()
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.hide = function () {
|
|
||||||
this.modalRef.hide()
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.show = function () {
|
|
||||||
this.modalRef.show()
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import ReactCSSTransitionGroup from 'react-addons-css-transition-group'
|
import { CSSTransitionGroup } from 'react-transition-group'
|
||||||
import WalletView from '../wallet-view'
|
import WalletView from '../wallet-view'
|
||||||
import { WALLET_VIEW_SIDEBAR } from './sidebar.constants'
|
import { WALLET_VIEW_SIDEBAR } from './sidebar.constants'
|
||||||
|
|
||||||
|
@ -34,13 +34,13 @@ export default class Sidebar extends Component {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<ReactCSSTransitionGroup
|
<CSSTransitionGroup
|
||||||
transitionName={transitionName}
|
transitionName={transitionName}
|
||||||
transitionEnterTimeout={300}
|
transitionEnterTimeout={300}
|
||||||
transitionLeaveTimeout={200}
|
transitionLeaveTimeout={200}
|
||||||
>
|
>
|
||||||
{ sidebarOpen ? this.renderSidebarContent() : null }
|
{ sidebarOpen ? this.renderSidebarContent() : null }
|
||||||
</ReactCSSTransitionGroup>
|
</CSSTransitionGroup>
|
||||||
{ sidebarOpen ? this.renderOverlay() : null }
|
{ sidebarOpen ? this.renderOverlay() : null }
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||||
import assert from 'assert'
|
import assert from 'assert'
|
||||||
import { shallow } from 'enzyme'
|
import { shallow } from 'enzyme'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import ReactCSSTransitionGroup from 'react-addons-css-transition-group'
|
import { CSSTransitionGroup } from 'react-transition-group'
|
||||||
import Sidebar from '../sidebar.component.js'
|
import Sidebar from '../sidebar.component.js'
|
||||||
|
|
||||||
import WalletView from '../../wallet-view'
|
import WalletView from '../../wallet-view'
|
||||||
|
@ -72,8 +72,8 @@ describe('Sidebar Component', function () {
|
||||||
assert.equal(wrapper.children().length, 1)
|
assert.equal(wrapper.children().length, 1)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should render the ReactCSSTransitionGroup without any children', () => {
|
it('should render the CSSTransitionGroup without any children', () => {
|
||||||
assert(wrapper.children().at(0).is(ReactCSSTransitionGroup))
|
assert(wrapper.children().at(0).is(CSSTransitionGroup))
|
||||||
assert.equal(wrapper.children().at(0).children().length, 0)
|
assert.equal(wrapper.children().at(0).children().length, 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -1,7 +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 ReactTooltip = require('react-tooltip-component')
|
const ReactTooltip = require('react-tooltip')
|
||||||
|
|
||||||
module.exports = Tooltip
|
module.exports = Tooltip
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ module.exports = bundleCss
|
||||||
var cssFiles = {
|
var cssFiles = {
|
||||||
'index.css': fs.readFileSync(path.join(__dirname, '/app/css/output/index.css'), 'utf8'),
|
'index.css': fs.readFileSync(path.join(__dirname, '/app/css/output/index.css'), 'utf8'),
|
||||||
'first-time.css': fs.readFileSync(path.join(__dirname, '../mascara/src/app/first-time/index.css'), 'utf8'),
|
'first-time.css': fs.readFileSync(path.join(__dirname, '../mascara/src/app/first-time/index.css'), 'utf8'),
|
||||||
'react-tooltip-component.css': fs.readFileSync(path.join(__dirname, '..', 'node_modules', 'react-tooltip-component', 'dist', 'react-tooltip-component.css'), 'utf8'),
|
// 'react-tooltip.css': fs.readFileSync(path.join(__dirname, '..', 'node_modules', 'react-tooltip', 'dist', 'style.css'), 'utf8'),
|
||||||
'react-css': fs.readFileSync(path.join(__dirname, '..', 'node_modules', 'react-select', 'dist', 'react-select.css'), 'utf8'),
|
'react-css': fs.readFileSync(path.join(__dirname, '..', 'node_modules', 'react-select', 'dist', 'react-select.css'), 'utf8'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue