From aa21c83470d2fa89a5dc09a49c7ab83cf4e87ad7 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 30 Jun 2016 20:54:51 -0700 Subject: Add new user agreement --- USER_AGREEMENT.md | 55 +++++++++++++++++++++++++++++++++++++++++ ui/app/first-time/disclaimer.js | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 USER_AGREEMENT.md diff --git a/USER_AGREEMENT.md b/USER_AGREEMENT.md new file mode 100644 index 000000000..064767a05 --- /dev/null +++ b/USER_AGREEMENT.md @@ -0,0 +1,55 @@ +# Disclaimer + +**METAMASK is still Beta software. Don't rely on it to hold large amounts of Ether.** + +## SECURITY WARNINGS + +**You are responsible for your own computer's security. If your machine is compromised you could lose your ether, access to your accounts and contracts and maybe more.** + +You are responsible for your own actions. + +The user acknowledges the following serious risks to any use of METAMASK and ETH and expressly agrees not to hold liable MetaMask or MetaMask Team should any of these risks occur: + +**METMASK AT THIS POINT IN TIME IS MEANT FOR DEVELOPERS OR PEOPLE WITH A UNDERSTANDING OF THE ETHERIUM PROTOCOL. DUE TO THE NATURE OF METMASK, THE METAMASK TEAM DOES NOT ADVISE STORING LARGE AMOUNTS OF ETHER IN METAMASK VAULTS. THE METAMASK TEAM DOES NOT TAKE RESPONSIBILTY FOR LOST OR STOLEN ETHER. BY CLICIKING AGREE AND USING METAMASK THE USER UNDERSTANDS THE RISKS OF USING EXPERIMENTAL SOFTWARE AND ACKNOWLEDGES THE FACT THAT THEIR MAY BE BUGS OR SECURTIY RISKS IN METAMASK THAT MAY RESULT IN LOSS OF ETHER AND THE THE METMASK TEAM IS NOT HELD RESPONSIBLE FOR REINBERSMENT OF LOST FUNDS.** + +### Risk of Regulatory Actions in One or More Jurisdictions + +METAMASK and ETH could be impacted by one or more regulatory inquiries or regulatory action, which could impede or limit the ability of METAMASK to continue to develop, or which could impeded or limit the ability of User to use Ethereum Platform or ETH. + +### Risk that METAMASK, As Developed, Will Not Meet the Expectations of User + +The User recognizes that METAMASK is under development and may undergo significant changes. User acknowledges that any expectations regarding the form and functionality of METAMASK held by the User may not be met upon release of METAMASK, for any number of reasons including a change in the design and implementation plans and execution of the implementation of METAMASK. + +### Risk of Weaknesses or Exploitable Breakthroughs in the Field of Cryptography + +Cryptography is an art, not a science. And the state of the art can advance over time. Advances in code cracking, or technical advances such as the development of quantum computers could present risks to cryptocurrencies and METAMASK, which could result in the theft or loss of ETH. To the extent possible, METAMASK intends to update the protocol underlying METAMASK to account for any advances in cryptography and to incorporate additional security measures, but cannot it cannot predict the future of cryptography or the success of any future security updates. + +### Warning of the Volatility of Crypto Currencies + +ETHEREUM is a new enough technology that the value of its core token and network fee currency is highly volatile, due to a combination of adoption and speculation. + +METAMASK cannot be held responsible for increases in the cost of network resources that affect the viability of any business activities that may take place on the blockchain. + +### Warning of Possible Accidental Flaws in Ethereum Apps + +ETHEREUM applications are only as good as the code they are written with. METAMASK cannot be held responsible if you interact with a flawed contract. ETHEREUM applications are a very new kind of software, and people are still learning how to write fully bulletproof software, so you are responsible for evaluating the trustworthiness of the websites you are willing to submit Ethereum transactions to. + +### Warning of Possible Malicious Contracts in Ethereum Apps + +ETHEREUM applications can be written maliciously. METAMASK cannot be held liable if you choose to interact with a contract that does not perform as expected. A contract may keep funds sent to it, or even impersonate the person making a request of it. METAMASK developers will do everything they can to warn you of potential threats, but they cannot be considered omniscient, and so all liability of interacting with malevolent contracts must lie on the user. + +### Acknowledgment, Acceptance of all Risks and Disclaimer of Warranties and Liabilities + +THE USER EXPRESSLY KNOWS AND AGREES THAT THE USER IS USING METAMASK AND METAMASK AT THE USER’S SOLE RISK. THE USER REPRESENTS THAT THE USER HAS AN ADEQUATE UNDERSTANDING OF THE RISKS, USAGE AND INTRICACIES OF CRYPTOGRAPHIC TOKENS AND BLOCKCHAIN-BASED OPEN SOURCE SOFTWARE, ETH PLATFORM AND ETH. THE USER ACKNOWLEDGES AND AGREES THAT, TO THE FULLEST EXTENT PERMITTED BY ANY APPLICABLE LAW, THE DISCLAIMERS OF LIABILITY CONTAINED HEREIN APPLY TO ANY AND ALL DAMAGES OR INJURY WHATSOEVER CAUSED BY OR RELATED TO RISKS OF, USE OF, OR INABILITY TO USE, ETH OR METAMASK UNDER ANY CAUSE OR ACTION WHATSOEVER OF ANY KIND IN ANY JURISDICTION, INCLUDING, WITHOUT LIMITATION, ACTIONS FOR BREACH OF WARRANTY, BREACH OF CONTRACT OR TORT (INCLUDING NEGLIGENCE) AND THAT NEITHER METAMASK NOR METMASK TEAM SHALL BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES, INCLUDING FOR LOSS OF PROFITS, GOODWILL OR DATA. + +### Acknowledgement of User's Duty to All Laws and Regulations + +The USER is responsible for their own actions with the use of the METAMASK software. Like any tool, it could be conceivably be used in ways not legal in some jurisdictions. + +THE USER agrees to adhere to all binding laws and regulations for the conditions in which they use METAMASK. + +### Risk of Temporary Network Incoherence + +METAMASK is finally not liable for unavoidable casualty, delays in delivery of materials, embargoes, government orders, acts of civil or military authorities, lack of energy, sickness or other ill health, injurious dance parties, rancid bacon, the acts of Gods, Nymphs, Angels (fallen or otherwise) or Djinn, or any similarly unforeseen events that render misfortune. + +The METAMASK DEVELOPERS wish you the very best luck in creating a better life for yourself, those you love, and your greater community, the world. diff --git a/ui/app/first-time/disclaimer.js b/ui/app/first-time/disclaimer.js index 7f615cfb0..4a9e234b1 100644 --- a/ui/app/first-time/disclaimer.js +++ b/ui/app/first-time/disclaimer.js @@ -5,7 +5,7 @@ const connect = require('react-redux').connect const actions = require('../actions') const fs = require('fs') const path = require('path') -const disclaimer = fs.readFileSync(path.join(__dirname, 'disclaimer.txt')).toString() +const disclaimer = fs.readFileSync(path.join(__dirname, '..', '..', '..', 'USER_AGREEMENT.md')).toString() module.exports = connect(mapStateToProps)(DisclaimerScreen) function mapStateToProps (state) { -- cgit v1.2.3 From a0a676c3e2f1c37613c5890ffd77542736804ba1 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 30 Jun 2016 21:24:14 -0700 Subject: Remove old disclaimer --- ui/app/first-time/disclaimer.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ui/app/first-time/disclaimer.txt b/ui/app/first-time/disclaimer.txt index a1df99627..b7c2cf13e 100644 --- a/ui/app/first-time/disclaimer.txt +++ b/ui/app/first-time/disclaimer.txt @@ -1,11 +1,3 @@ Full disclaimer coming soon. In the meanwhile, be aware this is experimental software. We are not responsible for how you use MetaMask, or any funds that you spend or lose with it. The only way to be absolutely sure you will lose no funds on the internet is to put no funds onto the internet. Enjoy! -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam accumsan tortor sed fringilla ultrices. Vestibulum congue fermentum nisi, venenatis dapibus urna semper id. Phasellus pretium faucibus nisi accumsan euismod. Nunc vel leo velit. Duis est felis, bibendum non dolor et, rhoncus gravida velit. Sed nec velit at nisi congue tincidunt non at felis. Praesent tincidunt, ipsum sit amet varius vulputate, purus lacus dictum tortor, vitae tempus dui turpis a lacus. Vivamus ut elit sodales, auctor nisi vitae, gravida est. Donec id massa ac ante rhoncus interdum. Aliquam gravida augue rhoncus libero ultricies scelerisque. -Cras a ornare tortor. Vestibulum et scelerisque lacus. Proin dapibus consectetur blandit. Aliquam viverra, orci eget efficitur pharetra, velit tortor rhoncus ipsum, sit amet sollicitudin turpis velit vitae nunc. Sed pretium ut nisl sed mollis. Proin libero erat, molestie id est sed, pellentesque hendrerit nulla. Donec vitae efficitur nunc. Integer ornare nisi volutpat nisi sodales cursus. Nam ante odio, congue vel turpis non, viverra congue mauris. Maecenas ullamcorper ligula eget lorem ornare mollis. Interdum et malesuada fames ac ante ipsum primis in faucibus. - -Sed sem odio, malesuada ut convallis nec, accumsan sit amet nulla. Morbi fringilla, purus vestibulum lacinia suscipit, massa mi pulvinar lorem, sit amet vestibulum purus turpis ut dolor. Integer felis eros, accumsan id urna ac, tincidunt vehicula purus. Pellentesque felis massa, convallis euismod vestibulum a, molestie non ante. Nulla sodales fermentum ultricies. In id malesuada diam, eget blandit arcu. Nullam a lacus a mauris rhoncus maximus eu ut ex. Phasellus non mauris mi. Duis at lectus sollicitudin, malesuada augue malesuada, tempor velit. Etiam vehicula leo id sapien feugiat consequat. Donec eget ex at sapien facilisis dapibus. Morbi condimentum magna nec venenatis vulputate. Nullam lobortis ante turpis, ac fermentum ipsum posuere id. Nullam pharetra velit vel dolor faucibus vehicula. Fusce quis ipsum nec felis blandit elementum a ut augue. - -Integer faucibus enim id odio auctor, ut sagittis diam luctus. Mauris iaculis rutrum risus, quis sagittis dolor fermentum eget. Praesent sit amet augue vitae erat efficitur placerat dictum ut magna. Suspendisse consectetur, risus quis pharetra molestie, enim dui accumsan erat, sed imperdiet orci dolor et nibh. Cras odio justo, pretium sit amet consequat luctus, imperdiet a lorem. Nam vulputate tincidunt erat, eget pellentesque dui elementum non. Sed vitae ante faucibus, pulvinar felis ornare, ornare felis. - -Donec nec lorem velit. Mauris sollicitudin quam turpis, quis finibus mauris semper in. Nullam efficitur faucibus lectus, vitae sagittis neque pellentesque in. Vivamus neque tellus, mollis at ultricies at, dignissim sit amet odio. Curabitur nec mi et lacus interdum hendrerit at et est. Nullam varius purus eu volutpat luctus. Vestibulum non sem eros. Nulla tempor, leo eu varius euismod, massa est mattis massa, id finibus mi erat a odio. Quisque et tincidunt justo. Curabitur eu lacus leo. Aliquam eget odio tempor, tincidunt nunc a, maximus diam. Curabitur venenatis nunc risus, in ullamcorper neque pharetra sit amet. Sed euismod dolor sed enim venenatis dapibus. Mauris congue magna nisl, et tincidunt dui vulputate vel. -- cgit v1.2.3 From cd21a4b699fd692800e0fb6ef961d98e786925b6 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 30 Jun 2016 21:32:50 -0700 Subject: Remove scroll fixing from ui preview --- ui/index.html | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/ui/index.html b/ui/index.html index ba8a8baac..9dfaefbb3 100644 --- a/ui/index.html +++ b/ui/index.html @@ -14,25 +14,7 @@
- -
- + - \ No newline at end of file + -- cgit v1.2.3 From c3f18fcf2bbb66181703b9b96536ebe257dc2542 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 30 Jun 2016 21:35:24 -0700 Subject: Remove debugs from development --- development/index.html | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/development/index.html b/development/index.html index 02fd01b03..deb3dc690 100644 --- a/development/index.html +++ b/development/index.html @@ -10,28 +10,5 @@
- - -
- - -
- -- cgit v1.2.3 From a95b5c4a96d5b850d4b61f1cf61d02b3f97a8f12 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 30 Jun 2016 21:39:50 -0700 Subject: Add query param restoring to mocker --- development/mocker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/development/mocker.js b/development/mocker.js index 098d46c75..593037f2e 100644 --- a/development/mocker.js +++ b/development/mocker.js @@ -9,13 +9,13 @@ const Selector = require('./selector') const qs = require('qs') let queryString = qs.parse(window.location.href.split('#')[1]) let selectedView = queryString.view || 'account detail' +const firstState = states[selectedView] +updateQueryParams(selectedView) // CSS const MetaMaskUiCss = require('../ui/css') const injectCss = require('inject-css') -const firstState = states[selectedView] -updateQueryParams() function updateQueryParams(newView) { queryString.view = newView -- cgit v1.2.3 From 5a917431d8ce2587284d938b6135a62bff6e17d1 Mon Sep 17 00:00:00 2001 From: kumavis Date: Thu, 30 Jun 2016 21:46:19 -0700 Subject: disclaimer - render via react-markdown --- package.json | 1 + ui/app/first-time/disclaimer.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2aca46948..f46d41431 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "react-addons-css-transition-group": "^15.0.2", "react-dom": "^15.0.2", "react-hyperscript": "^2.2.2", + "react-markdown": "^2.3.0", "react-redux": "^4.4.5", "react-tooltip-component": "^0.3.0", "readable-stream": "^2.1.2", diff --git a/ui/app/first-time/disclaimer.js b/ui/app/first-time/disclaimer.js index 4a9e234b1..929624814 100644 --- a/ui/app/first-time/disclaimer.js +++ b/ui/app/first-time/disclaimer.js @@ -3,6 +3,7 @@ const Component = require('react').Component const h = require('react-hyperscript') const connect = require('react-redux').connect const actions = require('../actions') +const ReactMarkdown = require('react-markdown') const fs = require('fs') const path = require('path') const disclaimer = fs.readFileSync(path.join(__dirname, '..', '..', '..', 'USER_AGREEMENT.md')).toString() @@ -36,14 +37,21 @@ DisclaimerScreen.prototype.render = function () { h('div', { style: { - whiteSpace: 'pre-line', + // whiteSpace: 'pre-line', background: 'rgb(235, 235, 235)', height: '310px', padding: '6px', width: '80%', overflowY: 'scroll', }, - }, disclaimer), + }, [ + + h(ReactMarkdown, { + source: disclaimer, + skipHtml: true, + }), + + ]), h('button', { style: { marginTop: '18px' }, -- cgit v1.2.3 From d1545245c29dea3beedb0ea1c8daadf5b2c2d93c Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 30 Jun 2016 22:53:52 -0700 Subject: Clean up beefy usage Now properly uses brfs transform so it can reload on state object changes. --- development/beefy.js | 14 ++------------ package.json | 4 +--- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/development/beefy.js b/development/beefy.js index 0ed40f177..9eff94320 100644 --- a/development/beefy.js +++ b/development/beefy.js @@ -2,28 +2,18 @@ const beefy = require('beefy') const http = require('http') const fs = require('fs') const path = require('path') -const states = require('./states') - -const statesPath = path.join(__dirname, 'states.js') -const statesJson = JSON.stringify(states) -fs.writeFileSync(statesPath, statesJson) const port = 8124 const handler = beefy({ - entries: ['mocker.js'] + entries: {'mocker.js': 'bundle.js'} , cwd: __dirname , live: true + , open: true , quiet: false , bundlerFlags: ['-t', 'brfs'] }) -console.dir(handler) http.createServer(handler).listen(port) console.log(`Now listening on port ${port}`) - -function on404(req, resp) { - resp.writeHead(404, {}) - resp.end('sorry folks!') -} diff --git a/package.json b/package.json index f46d41431..aa2622903 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "start": "gulp dev", "test": "mocha --require test/helper.js --compilers js:babel-register --recursive", "watch": "mocha watch --compilers js:babel-register --recursive", - "ui": "cd development && node genStates.js && beefy mocker.js:bundle.js --live --open" + "ui": "cd development && beefy mocker.js:bundle.js --live --open" }, "browserify": { "transform": [ @@ -24,8 +24,6 @@ }, "dependencies": { "async": "^1.5.2", - "babel-preset-es2015": "^6.9.0", - "babel-register": "^6.9.0", "browserify-derequire": "^0.9.4", "clone": "^1.0.2", "copy-to-clipboard": "^2.0.0", -- cgit v1.2.3 From 50afc386e55ef5ac329557e9ac478c03b84c3f89 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 30 Jun 2016 23:15:38 -0700 Subject: Simplify ui task command --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aa2622903..00cc4c23a 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "start": "gulp dev", "test": "mocha --require test/helper.js --compilers js:babel-register --recursive", "watch": "mocha watch --compilers js:babel-register --recursive", - "ui": "cd development && beefy mocker.js:bundle.js --live --open" + "ui": "beefy development/mocker.js:bundle.js --live --open --cwd development --index=./development/index.html" }, "browserify": { "transform": [ -- cgit v1.2.3 From 7f9200b1bf50238e0452adb2d7867dc48868d775 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 30 Jun 2016 23:15:45 -0700 Subject: Added some basic styles --- ui/app/first-time/disclaimer.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ui/app/first-time/disclaimer.js b/ui/app/first-time/disclaimer.js index 929624814..f25bf9245 100644 --- a/ui/app/first-time/disclaimer.js +++ b/ui/app/first-time/disclaimer.js @@ -35,7 +35,20 @@ DisclaimerScreen.prototype.render = function () { 'MetaMask Terms & Conditions', ]), - h('div', { + h('style', ` + + .markdown { + font-family: Times New Roman; + } + .markdown h1,h2,h3,h4 { + margin: 10px 0; + font-family: arial sans-serif; + font-weight: bold; + } + + `), + + h('div.markdown', { style: { // whiteSpace: 'pre-line', background: 'rgb(235, 235, 235)', -- cgit v1.2.3 From 6ec387b6751273ad09aed876a03f7ee95dc86c1a Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 30 Jun 2016 23:50:20 -0700 Subject: Formatted dev mode better --- development/index.html | 12 ++++++++++++ development/mocker.js | 2 ++ development/selector.js | 3 +++ ui/app/app.js | 5 +++-- ui/app/first-time/disclaimer.js | 5 +++-- ui/app/first-time/disclaimer.txt | 3 --- 6 files changed, 23 insertions(+), 7 deletions(-) delete mode 100644 ui/app/first-time/disclaimer.txt diff --git a/development/index.html b/development/index.html index deb3dc690..aca074f3e 100644 --- a/development/index.html +++ b/development/index.html @@ -11,4 +11,16 @@ + + diff --git a/development/mocker.js b/development/mocker.js index 593037f2e..0656e66ea 100644 --- a/development/mocker.js +++ b/development/mocker.js @@ -54,6 +54,8 @@ render( style: { height: '500px', width: '360px', + boxShadow: '2px 2px 5px grey', + margin: '20px', }, }, [ h(Root, { diff --git a/development/selector.js b/development/selector.js index b58904cdf..c466905ca 100644 --- a/development/selector.js +++ b/development/selector.js @@ -17,6 +17,9 @@ NewComponent.prototype.render = function () { const selected = state.selected || selectedKey return h('select', { + style: { + margin: '20px 20px 0px', + }, value: selected, onChange:(event) => { const selectedKey = event.target.value diff --git a/ui/app/app.js b/ui/app/app.js index 938caffd9..f58f695af 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -61,6 +61,7 @@ App.prototype.render = function () { style: { // Windows was showing a vertical scroll bar: overflow: 'hidden', + position: 'relative', }, }, [ @@ -197,7 +198,7 @@ App.prototype.renderNetworkDropdown = function () { this.setState({ isNetworkMenuOpen: !isOpen }) }, style: { - position: 'fixed', + position: 'absolute', left: 0, zIndex: 0, }, @@ -246,7 +247,7 @@ App.prototype.renderDropdown = function () { this.props.dispatch(actions.closeMenu()) }, style: { - position: 'fixed', + position: 'absolute', right: 0, zIndex: 0, }, diff --git a/ui/app/first-time/disclaimer.js b/ui/app/first-time/disclaimer.js index f25bf9245..c6174a220 100644 --- a/ui/app/first-time/disclaimer.js +++ b/ui/app/first-time/disclaimer.js @@ -22,13 +22,14 @@ DisclaimerScreen.prototype.render = function () { return ( h('.flex-column.flex-center.flex-grow', [ - h('h3.flex-center.text-transform-uppercase', { + h('h3.flex-center.text-transform-uppercase.terms-header', { style: { background: '#EBEBEB', color: '#AEAEAE', marginBottom: 24, width: '100%', fontSize: '20px', + textAlign: 'center', padding: 6, }, }, [ @@ -40,7 +41,7 @@ DisclaimerScreen.prototype.render = function () { .markdown { font-family: Times New Roman; } - .markdown h1,h2,h3,h4 { + .markdown h1, .markdown h2, .markdown h3 { margin: 10px 0; font-family: arial sans-serif; font-weight: bold; diff --git a/ui/app/first-time/disclaimer.txt b/ui/app/first-time/disclaimer.txt deleted file mode 100644 index b7c2cf13e..000000000 --- a/ui/app/first-time/disclaimer.txt +++ /dev/null @@ -1,3 +0,0 @@ -Full disclaimer coming soon. In the meanwhile, be aware this is experimental software. We are not responsible for how you use MetaMask, or any funds that you spend or lose with it. The only way to be absolutely sure you will lose no funds on the internet is to put no funds onto the internet. Enjoy! - - -- cgit v1.2.3 From 51a5e66cbbbf35baa62e74e3545cf478cc05241e Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Fri, 1 Jul 2016 10:25:19 -0700 Subject: Move main drop-down state to component state --- ui/app/actions.js | 19 ------------------- ui/app/app.js | 15 +++++++++------ ui/app/reducers/app.js | 10 ---------- 3 files changed, 9 insertions(+), 35 deletions(-) diff --git a/ui/app/actions.js b/ui/app/actions.js index c6b57d29d..3e0fe55c0 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -2,10 +2,6 @@ var actions = { GO_HOME: 'GO_HOME', goHome: goHome, // menu state - TOGGLE_MENU: 'TOGGLE_MENU', - toggleMenu: toggleMenu, - SET_MENU_STATE: 'SET_MENU_STATE', - closeMenu: closeMenu, getNetworkStatus: 'getNetworkStatus', // remote state @@ -125,21 +121,6 @@ function goHome () { } } -// menu state - -function toggleMenu () { - return { - type: actions.TOGGLE_MENU, - } -} - -function closeMenu () { - return { - type: actions.SET_MENU_STATE, - value: false, - } -} - // async actions function tryUnlockMetamask (password) { diff --git a/ui/app/app.js b/ui/app/app.js index f58f695af..4652d36ff 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -178,7 +178,7 @@ App.prototype.renderAppBar = function () { onClick: (event) => { event.preventDefault() event.stopPropagation() - this.props.dispatch(actions.toggleMenu()) + this.setState({ isMainMenuOpen: true }) }, }), ]), @@ -241,10 +241,13 @@ App.prototype.renderNetworkDropdown = function () { App.prototype.renderDropdown = function () { const props = this.props + const state = this.state || {} + const isOpen = state.isMainMenuOpen + return h(MenuDroppo, { - isOpen: props.menuOpen, + isOpen: isOpen, onClickOutside: (event) => { - this.props.dispatch(actions.closeMenu()) + this.setState({ isMainMenuOpen: !isOpen }) }, style: { position: 'absolute', @@ -263,21 +266,21 @@ App.prototype.renderDropdown = function () { h(DropMenuItem, { label: 'Settings', - closeMenu: () => this.props.dispatch(actions.closeMenu()), + closeMenu: () => this.setState({ isMainMenuOpen: !isOpen }), action: () => this.props.dispatch(actions.showConfigPage()), icon: h('i.fa.fa-gear.fa-lg', { ariaHidden: true }), }), h(DropMenuItem, { label: 'Lock', - closeMenu: () => this.props.dispatch(actions.closeMenu()), + closeMenu: () => this.setState({ isMainMenuOpen: !isOpen }), action: () => this.props.dispatch(actions.lockMetamask()), icon: h('i.fa.fa-lock.fa-lg', { ariaHidden: true }), }), h(DropMenuItem, { label: 'Help', - closeMenu: () => this.props.dispatch(actions.closeMenu()), + closeMenu: () => this.setState({ isMainMenuOpen: !isOpen }), action: () => this.props.dispatch(actions.showInfoPage()), icon: h('i.fa.fa-question.fa-lg', { ariaHidden: true }), }), diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index f45be0433..06afd0ae1 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -43,16 +43,6 @@ function reduceApp (state, action) { switch (action.type) { - case actions.TOGGLE_MENU: - return extend(appState, { - menuOpen: !appState.menuOpen, - }) - - case actions.SET_MENU_STATE: - return extend(appState, { - menuOpen: action.value, - }) - // intialize case actions.SHOW_CREATE_VAULT: -- cgit v1.2.3 From 287222df25caa696583afee27f5aa77dfe0d8895 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Fri, 1 Jul 2016 10:32:54 -0700 Subject: Linted --- ui/app/app.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/app/app.js b/ui/app/app.js index 4652d36ff..dcc44ee65 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -240,7 +240,6 @@ App.prototype.renderNetworkDropdown = function () { } App.prototype.renderDropdown = function () { - const props = this.props const state = this.state || {} const isOpen = state.isMainMenuOpen -- cgit v1.2.3