From 3d598473a0925bda1f3a9fb6fcd2fa4560e4d05a Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Fri, 22 Nov 2019 22:48:46 -0330 Subject: [PATCH] Convert AccountPanel component to use JSX (#7505) --- ui/app/components/app/account-panel.js | 54 +++++++++----------------- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/ui/app/components/app/account-panel.js b/ui/app/components/app/account-panel.js index e61cb8ad6..2bae0a296 100644 --- a/ui/app/components/app/account-panel.js +++ b/ui/app/components/app/account-panel.js @@ -1,6 +1,5 @@ +import React, { Component } from 'react' const inherits = require('util').inherits -const Component = require('react').Component -const h = require('react-hyperscript') import Identicon from '../ui/identicon' const formatBalance = require('../../helpers/utils/util').formatBalance const addressSummary = require('../../helpers/utils/util').addressSummary @@ -33,39 +32,24 @@ AccountPanel.prototype.render = function () { } return ( - - h('.identity-panel.flex-row.flex-space-between', { - style: { - flex: '1 0 auto', - cursor: panelState.onClick ? 'pointer' : undefined, - }, - onClick: panelState.onClick, - }, [ - - // account identicon - h('.identicon-wrapper.flex-column.select-none', [ - h(Identicon, { - address: panelState.identiconKey, - imageify: state.imageifyIdenticons, - }), - h('span.font-small', panelState.identiconLabel.substring(0, 7) + '...'), - ]), - - // account address, balance - h('.identity-data.flex-column.flex-justify-center.flex-grow.select-none', [ - - panelState.attributes.map((attr) => { - return h('.flex-row.flex-space-between', { - key: '' + Math.round(Math.random() * 1000000), - }, [ - h('label.font-small.no-select', attr.key), - h('span.font-small', attr.value), - ]) - }), - ]), - - ]) - +
+
+ + {panelState.identiconLabel.substring(0, 7) + '...'} +
+
+ {panelState.attributes.map((attr) => ( +
+ + {attr.value} +
+ ))} +
+
) }