Skip to content

Commit

Permalink
updating styles in universal dapp
Browse files Browse the repository at this point in the history
  • Loading branch information
ryestew committed Apr 4, 2019
1 parent 2572396 commit ac227f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/universal-dapp-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ var css = csjs`
font-size: 16px;
padding-top: 5px;
vertical-align: top;
}
.cActionsWrapper {
}
.group:after {
content: "";
Expand Down
14 changes: 10 additions & 4 deletions src/universal-dapp-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,29 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address

var shortAddress = helper.shortenAddress(address)
var title = yo`
<div class="${css.title}">
<button onclick=${toggleClass}"><i class="fa fa-caret-square-o-right" aria-hidden="true"></i></button>
<div class="${css.title} alert alert-dark">
<button onclick="${(e) => { toggleClass(e) }}"><i class="fa fa-caret-right" aria-hidden="true"></i></button>
<div class="${css.titleText}"> ${contractName} at ${shortAddress} (${context}) </div>
${copyToClipboard(() => address)}
</div>`

var close = yo`<div class="${css.udappClose}" onclick=${remove}><i class="${css.closeIcon} fa fa-close" aria-hidden="true"></i></div>`
title.appendChild(close)

var contractActionsWrapper = yo`
<div class="${css.cActionsWrapper}">
</div>`

function remove () {
instance.remove()
// @TODO perhaps add a callack here to warn the caller that the instance has been removed
}

function toggleClass () {
console.log('hit')
function toggleClass (e) {
$(instance).toggleClass(`${css.hidesub}`)
// e.currentTarget.querySelector('i')
e.currentTarget.querySelector('i').classList.toggle(`fa-caret-right`)
e.currentTarget.querySelector('i').classList.toggle(`fa-caret-down`)
}

instance.appendChild(title)
Expand Down

0 comments on commit ac227f6

Please sign in to comment.