git ssb

16+

Dominic / patchbay



Commit 24cc1bbcdbe7eb74bfd8a4efd74ec1231bea7be6

added display of your current funds

Joran committed on 8/9/2017, 10:21:41 PM
Parent: 24b00586b37236750beffd73b85a981bddff77fc

Files changed

about/html/edit.jschanged
about/html/edit.mcsschanged
package-lock.jsonchanged
package.jsonchanged
about/html/edit.jsView
@@ -2,8 +2,10 @@
22 const dataurl = require('dataurl-')
33 const hyperfile = require('hyperfile')
44 const hypercrop = require('hypercrop')
55 const hyperlightbox = require('hyperlightbox')
6 +const Mutual = require('ssb-mutual')
7 +
68 const {
79 h, Value, Array: MutantArray, Dict: MutantObject, Struct,
810 map, computed, when, dictToCollection
911 } = require('mutant')
@@ -34,8 +36,10 @@
3436 })
3537
3638 // TODO refactor this to use obs better
3739 function edit (id) {
40 + var mutual = Mutual.init(api.sbot)
41 +
3842 var avatar = Struct({
3943 current: api.about.obs.imageUrl(id),
4044 new: MutantObject()
4145 })
@@ -77,8 +81,26 @@
7781 if (name.new) return name.new
7882 else return name.current
7983 })
8084
85 +
86 + var balances_div = h('div.balances')
87 +
88 + mutual.getAccountBalances(id, (error, balances) => {
89 + console.log("balances")
90 + console.log(error)
91 + console.log(balances)
92 + if (balances == null) return ''
93 +
94 + var balance_els = [];
95 + Object.keys(balances).forEach(function(key) {
96 + console.log(key)
97 + balances_div.appendChild(
98 + h('div', `💰 ${balances[key]} ${key}`)
99 + )
100 + });
101 + })
102 +
81103 return h('AboutEditor', [
82104 h('section.lightbox', lb),
83105 h('section.avatar', [
84106 h('section', [
@@ -89,8 +111,9 @@
89111 h('section.description', computed(api.about.obs.description(id), (descr) => {
90112 if (descr == null) return '' // TODO: should be in patchcore, I think...
91113 return api.message.html.markdown(descr)
92114 })),
115 + h('section.credit', balances_div),
93116 h('section.aliases', [
94117 h('header', 'Aliases'),
95118 h('section.avatars', [
96119 h('header', 'Avatars'),
@@ -186,5 +209,4 @@
186209 h('button.okay', { 'ev-click': () => cb(null, canvas.selection.toDataURL()) }, 'okay')
187210 ])
188211 ])
189212 }
190-
about/html/edit.mcssView
@@ -3,9 +3,9 @@
33 font-weight: 600
44 margin-bottom: .5rem
55 }
66
7- canvas {
7 + canvas {
88 margin: 0 auto
99 width: 100%
1010 }
1111
@@ -56,8 +56,15 @@
5656
5757 margin-top: 1rem
5858 }
5959
60 + section.credit {
61 + flex-basis: 40%
62 + flex-grow: 1
63 +
64 + margin-top: 1rem
65 + }
66 +
6067 section.aliases {
6168 flex-basis: 100%
6269
6370 margin-top: 1rem
@@ -185,7 +192,4 @@
185192 }
186193 }
187194 }
188195 }
189-
190-
191-
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 249049 bytes
New file size: 269203 bytes
package.jsonView
@@ -63,11 +63,12 @@
6363 "pull-stream": "^3.5.0",
6464 "read-directory": "^2.0.0",
6565 "require-style": "^1.0.0",
6666 "setimmediate": "^1.0.5",
67 + "ssb-chess": "1.2.1",
6768 "ssb-horcrux": "^0.1.3",
6869 "ssb-mentions": "~0.4.0",
69- "ssb-chess": "1.2.1",
70 + "ssb-mutual": "^0.1.0",
7071 "style-resolve": "^1.0.1",
7172 "suggest-box": "^2.2.3",
7273 "text-node-searcher": "^1.1.1",
7374 "xtend": "^4.0.1"

Built with git-ssb-web