aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/app/app.js5
-rw-r--r--ui/app/components/account-menu/index.js56
-rw-r--r--ui/app/components/dropdowns/components/menu.js44
-rw-r--r--ui/app/css/itcss/components/account-menu.scss44
-rw-r--r--ui/app/css/itcss/components/header.scss4
-rw-r--r--ui/app/css/itcss/components/index.scss4
-rw-r--r--ui/app/css/itcss/components/menu.scss43
7 files changed, 199 insertions, 1 deletions
diff --git a/ui/app/app.js b/ui/app/app.js
index 360ba04cf..92fc5e697 100644
--- a/ui/app/app.js
+++ b/ui/app/app.js
@@ -34,6 +34,7 @@ const HDRestoreVaultScreen = require('./keychains/hd/restore-vault')
const RevealSeedConfirmation = require('./keychains/hd/recover-seed/confirmation')
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
const NetworkDropdown = require('./components/dropdowns/network-dropdown')
+const AccountMenu = require('./components/account-menu')
// Global Modals
const Modal = require('./components/modals/index').Modal
@@ -130,6 +131,8 @@ App.prototype.render = function () {
frequentRpcList: this.props.frequentRpcList,
}, []),
+ h(AccountMenu),
+
h(Loading, {
isLoading: isLoading || isLoadingNetwork,
loadingMessage: loadMessage,
@@ -344,7 +347,7 @@ App.prototype.renderPrimary = function () {
case 'sendTransaction':
log.debug('rendering send tx screen')
-
+
const SendComponentToRender = checkFeatureToggle('send-v2')
? SendTransactionScreen2
: SendTransactionScreen
diff --git a/ui/app/components/account-menu/index.js b/ui/app/components/account-menu/index.js
new file mode 100644
index 000000000..7dc3d10a5
--- /dev/null
+++ b/ui/app/components/account-menu/index.js
@@ -0,0 +1,56 @@
+const inherits = require('util').inherits
+const Component = require('react').Component
+const connect = require('react-redux').connect
+const h = require('react-hyperscript')
+const actions = require('../../actions')
+const { Menu, Item, Divider } = require('../dropdowns/components/menu')
+
+module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountMenu)
+
+inherits(AccountMenu, Component)
+function AccountMenu () { Component.call(this) }
+
+function mapStateToProps (state) {
+ return {
+ selectedAddress: state.metamask.selectedAddress,
+ }
+}
+
+function mapDispatchToProps () {
+ return {}
+}
+
+AccountMenu.prototype.render = function () {
+ return h(Menu, { className: 'account-menu' }, [
+ h(Item, { className: 'account-menu__header' }, [
+ 'My Accounts',
+ h('button.account-menu__logout-button', 'Log out'),
+ ]),
+ h(Divider),
+ h(Item, { text: 'hi' }),
+ h(Divider),
+ h(Item, {
+ onClick: true,
+ icon: h('img', { src: 'images/plus-btn-white.svg' }),
+ text: 'Create Account',
+ }),
+ h(Item, {
+ onClick: true,
+ icon: h('img', { src: 'images/import-account.svg' }),
+ text: 'Import Account',
+ }),
+ h(Divider),
+ h(Item, {
+ onClick: true,
+ icon: h('img', { src: 'images/mm-info-icon.svg' }),
+ text: 'Info & Help',
+ }),
+ h(Item, {
+ onClick: true,
+ icon: h('img', { src: 'images/settings.svg' }),
+ text: 'Settings',
+ }),
+ ])
+}
+
+
diff --git a/ui/app/components/dropdowns/components/menu.js b/ui/app/components/dropdowns/components/menu.js
new file mode 100644
index 000000000..0cbe0f342
--- /dev/null
+++ b/ui/app/components/dropdowns/components/menu.js
@@ -0,0 +1,44 @@
+const inherits = require('util').inherits
+const Component = require('react').Component
+const h = require('react-hyperscript')
+
+inherits(Menu, Component)
+function Menu () { Component.call(this) }
+
+Menu.prototype.render = function () {
+ const { className = '', children, isShowing } = this.props
+ return isShowing
+ ? h('div', { className: `menu ${className}` }, children)
+ : h('noscript')
+}
+
+inherits(Item, Component)
+function Item () { Component.call(this) }
+
+Item.prototype.render = function () {
+ const {
+ icon,
+ children,
+ text,
+ className = '',
+ onClick,
+ } = this.props
+ const itemClassName = `menu__item ${className} ${onClick ? 'menu__item--clickable' : ''}`
+ const iconComponent = icon ? h('div.menu__item__icon', [icon]) : null
+ const textComponent = text ? h('div.menu__item__text', text) : null
+
+ return children
+ ? h('div', { className: itemClassName }, children)
+ : h('div.menu__item', { className: itemClassName }, [ iconComponent, textComponent ]
+ .filter(d => Boolean(d))
+ )
+}
+
+inherits(Divider, Component)
+function Divider () { Component.call(this) }
+
+Divider.prototype.render = function () {
+ return h('div.menu__divider')
+}
+
+module.exports = { Menu, Item, Divider }
diff --git a/ui/app/css/itcss/components/account-menu.scss b/ui/app/css/itcss/components/account-menu.scss
new file mode 100644
index 000000000..8b08c02fd
--- /dev/null
+++ b/ui/app/css/itcss/components/account-menu.scss
@@ -0,0 +1,44 @@
+.account-menu {
+ position: fixed;
+ z-index: 100;
+ top: 58px;
+ width: 310px;
+
+ @media screen and (max-width: 575px) {
+ right: calc((100vw - 100%) / 2);
+ }
+
+ @media screen and (min-width: 576px) {
+ right: calc((100vw - 85vw) / 2);
+ }
+
+ @media screen and (min-width: 769px) {
+ right: calc((100vw - 80vw) / 2);
+ }
+
+ @media screen and (min-width: 1281px) {
+ right: calc((100vw - 65vw) / 2);
+ }
+
+ &__header {
+ display: flex;
+ flex-flow: row nowrap;
+ justify-content: space-between;
+ align-items: center;
+ }
+
+ &__logout-button {
+ border: 1px solid $dusty-gray;
+ background-color: transparent;
+ color: $white;
+ border-radius: 4px;
+ font-size: 12px;
+ line-height: 23px;
+ padding: 0 24px;
+ }
+
+ img {
+ width: 16px;
+ height: 16px;
+ }
+}
diff --git a/ui/app/css/itcss/components/header.scss b/ui/app/css/itcss/components/header.scss
index 4fa80f047..512cbd995 100644
--- a/ui/app/css/itcss/components/header.scss
+++ b/ui/app/css/itcss/components/header.scss
@@ -84,4 +84,8 @@ h2.page-subtitle {
display: flex;
flex-flow: row nowrap;
align-items: center;
+
+ .identicon {
+ cursor: pointer;
+ }
}
diff --git a/ui/app/css/itcss/components/index.scss b/ui/app/css/itcss/components/index.scss
index f24a9caa8..dee0959b7 100644
--- a/ui/app/css/itcss/components/index.scss
+++ b/ui/app/css/itcss/components/index.scss
@@ -31,3 +31,7 @@
@import './add-token.scss';
@import './currency-display.scss';
+
+@import './account-menu.scss';
+
+@import './menu.scss';
diff --git a/ui/app/css/itcss/components/menu.scss b/ui/app/css/itcss/components/menu.scss
new file mode 100644
index 000000000..d01c24a70
--- /dev/null
+++ b/ui/app/css/itcss/components/menu.scss
@@ -0,0 +1,43 @@
+.menu {
+ border-radius: 4px;
+ background: rgba($black, .8);
+ box-shadow: rgba($black, .15) 0 2px 2px 2px;
+ min-width: 150px;
+ color: $white;
+
+ &__item {
+ padding: 18px;
+ display: flex;
+ flex-flow: row nowrap;
+ align-items: center;
+
+ &--clickable {
+ cursor: pointer;
+
+ &:hover {
+ background-color: rgba($white, .05);
+ }
+
+ &:active {
+ background-color: rgba($white, .1);
+ }
+ }
+
+ &__icon {
+ height: 16px;
+ width: 16px;
+ margin-right: 14px;
+ }
+
+ &__text {
+ font-size: 16px;
+ line-height: 21px;
+ }
+ }
+
+ &__divider {
+ background-color: $scorpion;
+ width: 100%;
+ height: 1px;
+ }
+}