Skip to content

Commit

Permalink
Merge master (#13)
Browse files Browse the repository at this point in the history
* add language options inside app-settings (polkadot-js#1929)

* [CI Skip]  0.37.0-beta.115

skip-checks: true

* Fix Vec<u8> issue (polkadot-js#1924)

* fix vec<u8>

* api version

* console

* lint

* fix struct display

* registry

* arg order

* [CI Skip]  0.37.0-beta.116

skip-checks: true

* Bump API, fixup storage types (polkadot-js#1933)

* [CI Skip]  0.37.0-beta.117

skip-checks: true

* Remove empty rewards from cache (polkadot-js#1935)

* Remove empty rewards from cache

* Update MAX_BLOCKS

* Revert count change

* [CI Skip]  0.37.0-beta.118

skip-checks: true

* Allow signRaw usable from extension (polkadot-js#1936)

* Allow signRaw usable from extension

* Add sign button

* Allow signing via extension

* Cleanup states, this was really messy...

* null check... ok, just need to test through

* Minor ocd

* Cleanup sign  unlock

* Cleanup display flashing

* Message for extension

* [CI Skip]  0.37.0-beta.119

skip-checks: true

* Remove disabled state (polkadot-js#1939)

* [CI Skip]  0.37.0-beta.120

skip-checks: true

* Bump API deps (polkadot-js#1942)

* [CI Skip]  0.37.0-beta.121

skip-checks: true

* Check for controller availability (unlock) (polkadot-js#1940)

* [CI Skip]  0.37.0-beta.122

skip-checks: true

* Refactor Backup component with hooks (polkadot-js#1927)

* refactor Backup component with hooks

* show error only when password is touched

* [CI Skip]  0.37.0-beta.123

skip-checks: true

* Don't display on-network divider (development) (polkadot-js#1943)

* [CI Skip]  0.37.0-beta.124

skip-checks: true

* Always pass hex to signRaw (polkadot-js#1945)

* [CI Skip]  0.37.0-beta.125

skip-checks: true

* API Bumps (node-template detection) (polkadot-js#1947)

* [CI Skip]  0.37.0-beta.126

skip-checks: true

* Bump deps (polkadot-js#1948)

* [CI Skip]  0.37.0-beta.127

skip-checks: true

* Rework status name display (polkadot-js#1949)

* Rework status name display

* Fix props

* [CI Skip]  0.37.0-beta.128

skip-checks: true

* Nomination target dashboard (polkadot-js#1953)

* Nomination target dashboard

* Bump API

* [CI Skip]  0.37.0-beta.129

skip-checks: true

* Small table styling tweaks

* [CI Skip]  0.37.0-beta.130

skip-checks: true

* Support v9 metadata (polkadot-js#1934)

* Support v9 metadata

* Cleanup key expansion

* Add isIterable

* Bump API (with V9)

* Bump common

* [CI Skip]  0.37.0-beta.131

skip-checks: true

* CC3 (polkadot-js#1955)

* CC3

* Bump API with type injection

* [CI Skip]  0.37.0-beta.132

skip-checks: true

* Highlight validator participation (polkadot-js#1956)

* Highlight validator participation

* Linting

* [CI Skip]  0.37.0-beta.133

skip-checks: true

* Bump API (polkadot-js#1957)

* [CI Skip]  0.37.0-beta.134

skip-checks: true

* Update ValidatorPrefs with commission (polkadot-js#1959)

* Update ValidatorPrefs with commission

* Bump API

* Remove crashy console.log

* Update Edgeware types (ValidatorPrefs)

* [CI Skip]  0.37.0-beta.135

skip-checks: true

* Remove validator heading (obvious)

* [CI Skip]  0.37.0-beta.136

skip-checks: true

* Non-disabled on POA states (polkadot-js#1960)

* [CI Skip]  0.37.0-beta.137

skip-checks: true

* Allow network prefs for signer accounts (polkadot-js#1961)

* [CI Skip]  0.37.0-beta.138

skip-checks: true

* Apply locks per genesis range (polkadot-js#1962)

* Apply locks per genesis range

* Calc locks up-front

* [CI Skip]  0.37.0-beta.139

skip-checks: true

* Swap to CC3 for Kusama (polkadot-js#1963)

* Swap to CC3 for Kusama

* 0.37

* CC3

* API bump

* [CI Skip]  0.37.1

skip-checks: true

* Fix change session keys

* [CI Skip]  0.38.0-beta.0

skip-checks: true

* Fix historic blocks produced display (polkadot-js#1966)

* [CI Skip]  0.38.0-beta.1

skip-checks: true

* Render staking accounts in background (polkadot-js#1967)

* Render staking accounts in background

* Extract location.pathname

* [CI Skip]  0.38.0-beta.2

skip-checks: true

* Rework dropdown changes (polkadot-js#1964)

* [CI Skip]  0.38.0-beta.3

skip-checks: true

* Proposal depositors

* [CI Skip]  0.38.0-beta.4

skip-checks: true

* Move seconding (polkadot-js#1968)

* [CI Skip]  0.38.0-beta.5

skip-checks: true

* Adjust FormatBalance component (polkadot-js#1969)

* [CI Skip]  0.38.0-beta.6

skip-checks: true

* Disable democracy until updated (polkadot-js#1971)

* [CI Skip]  0.38.0-beta.7

skip-checks: true

* Rework staking lists, more info per page (polkadot-js#1972)

* Rework staking lists, more info per page

* Progress

* Thin cards as table rows

* Adjust label opacity

* Adj.

* [CI Skip]  0.38.0-beta.8

skip-checks: true

* Support democracy with preimages (polkadot-js#1973)

* Add derive.democracy.proposals

* Preimage button

* Preimages work

* Allow Proposals, display referendums

* Update with height/width hack

* Bump deps

* [CI Skip]  0.38.0-beta.9

skip-checks: true

* Fix motions address display

* [CI Skip]  0.38.0-beta.10

skip-checks: true

* Democracy display updates (polkadot-js#1974)

* Democracy updates

* Democracy UI cleanups

* Cleanup labels

* Move seconding, again...

* [CI Skip]  0.38.0-beta.11

skip-checks: true

* AddressMini withShrink

* [CI Skip]  0.38.0-beta.12

skip-checks: true

* Rework council display (polkadot-js#1976)

* Rework council layout

* Updates

* Bump API

* [CI Skip]  0.38.0-beta.13

skip-checks: true

* Basic tech committee (polkadot-js#1977)

* Tech comm

* Basic tech committee app (excl. proposals)

* [CI Skip]  0.38.0-beta.14

skip-checks: true

* Add motion count

* [CI Skip]  0.38.0-beta.15

skip-checks: true

* Proposal counters (polkadot-js#1982)

* [CI Skip]  0.38.0-beta.16

skip-checks: true

* fix SummaryBar (polkadot-js#1981)

* [CI Skip]  0.38.0-beta.17

skip-checks: true

* Layout changes for motions (polkadot-js#1983)

* [CI Skip]  0.38.0-beta.18

skip-checks: true

* Remove broken tooltip expand (polkadot-js#1984)

* Remove tooltip click

* Tooltip click

* Use end + delay for activation

* Fix motion top layout

* [CI Skip]  0.38.0-beta.19

skip-checks: true

* Replace TxComponent and TxModal (base) (polkadot-js#1951)

* essentials

* cleanup

* versions

* rv file

* useForm function refs

* restore button ref

* adjust TxModalNew

* refactor

* useTx

* arg

* rework

* linting

* restore changed comps

* [CI Skip]  0.38.0-beta.20

skip-checks: true

* Remove TxButton assert (polkadot-js#1988)

* Remove TxButton assert

* Linting

* [CI Skip]  0.38.0-beta.21

skip-checks: true

* fix: Fixes polkadot-js#1986 proposals of undefined (polkadot-js#1987)

* fix: Fixes polkadot-js#1986 proposals of undefined

* fix: Prevent undefined proposals in packages/app-council/src/useCounter.ts

Co-Authored-By: Jaco Greeff <jacogr@gmail.com>

* fix: Revert change since api.derive.democracy is always defined

* [CI Skip]  0.38.0-beta.22

skip-checks: true

* Table summary overflow

* [CI Skip]  0.38.0-beta.23

skip-checks: true

* Optional proposal, hash required

* [CI Skip]  0.38.0-beta.24

skip-checks: true

* Note imminent (polkadot-js#1993)

* [CI Skip]  0.38.0-beta.25

skip-checks: true

* Show externals

* [CI Skip]  0.38.0-beta.26

skip-checks: true

* Satking account layout changes (polkadot-js#1994)

* [CI Skip]  0.38.0-beta.27

skip-checks: true

* Fix Tech comm proposal display (Option) (polkadot-js#1995)

* Fix Tech comm proposal display (Option)

* Linting

* [CI Skip]  0.38.0-beta.28

skip-checks: true

* Propose tech committee motions (polkadot-js#1996)

* Propose tech committe motions

* bug, ignore .vscode

* linting

* Some cleanups

* Move Propose back

* [CI Skip]  0.38.0-beta.29

skip-checks: true

* Show democracy dispatch queue (polkadot-js#1997)

* Show democracy dispatch queue

* Bump API

* [CI Skip]  0.38.0-beta.30

skip-checks: true

* Nominate update

* [CI Skip]  0.38.0-beta.31

skip-checks: true

* Fix contract deploy crash (polkadot-js#1998)

* tuple deploy crash

* lint

* [CI Skip]  0.38.0-beta.32

skip-checks: true

* Remove contracts call functionality (not working) (polkadot-js#1999)

* [CI Skip]  0.38.0-beta.33

skip-checks: true

* Fix block count chart display

* [CI Skip]  0.38.0-beta.34

skip-checks: true

* Find last available session reward (polkadot-js#2000)

* [CI Skip]  0.38.0-beta.35

skip-checks: true

* Bump deps (polkadot-js#2001)

* Bump deps

* Rewrite

* [CI Skip]  0.38.0-beta.36

skip-checks: true

* Revert _000 (Babel seem to have issues in dev) (polkadot-js#2002)

* [CI Skip]  0.38.0-beta.37

skip-checks: true

* Revert "Remove contracts call functionality (not working) (polkadot-js#1999)" (polkadot-js#2004)

This reverts commit 0aacf3a.

* [CI Skip]  0.38.0-beta.38

skip-checks: true

* Bump API (No contracts hack) (polkadot-js#2006)

* [CI Skip]  0.38.0-beta.39

skip-checks: true

* Seconding grouping

* [CI Skip]  0.38.0-beta.40

skip-checks: true

* Filter sessionRewards (polkadot-js#2005)

* Improve rewards rendering

* [CI Skip]  0.38.0-beta.41

skip-checks: true

* Rework address & accounts layout (polkadot-js#2008)

* Display accounts as rows

* Tags display

* Accounts seem ok (as a start)

* Filter by tags

* Don't add new tags via input

* Convert addresses

* Adjustments

* [CI Skip]  0.38.0-beta.42

skip-checks: true

* Some light tag sorting

* [CI Skip]  0.38.0-beta.43

skip-checks: true

* Bump deps (polkadot-js#2009)

* Bump deps

* Nominating ({{count}})

* [CI Skip]  0.38.0-beta.44

skip-checks: true

* Fix useStream unsub (polkadot-js#2010)

* Fix useStream unsub

* non-deobounced on input

* [CI Skip]  0.38.0-beta.45

skip-checks: true

* Adjust treasury layout (polkadot-js#2011)

* Treasury layout

* Adjust viewport for mobile

* [CI Skip]  0.38.0-beta.46

skip-checks: true

* Fix refresh on council proposals (polkadot-js#2012)

* [CI Skip]  0.38.0-beta.47

skip-checks: true

* Force reward retrieval to single-shot (polkadot-js#2013)

* Force reward retrieval to single-shot

* Remove inner setTimeout

* [CI Skip]  0.38.0-beta.48

skip-checks: true

* Api Bump (DoubleMap) (polkadot-js#2015)

* [CI Skip]  0.38.0-beta.49

skip-checks: true

* More effcicient derive for staking info (polkadot-js#2017)

* [CI Skip]  0.38.0-beta.50

skip-checks: true

* Fixup claims pay message via consts (polkadot-js#2018)

* Fixup claims pay message via consts

* Remove unused

* [CI Skip]  0.38.0-beta.51

skip-checks: true

* Allow voting on treasury page (polkadot-js#2019)

* Allow voting on treasury page

* More re-usable voting components (a start)

* Ficup imports

* Adjust modals

* Bump API

* [CI Skip]  0.38.0-beta.52

skip-checks: true

* Bump API (polkadot-js#2022)

* [CI Skip]  0.38.0-beta.53

skip-checks: true

* Bump API (Polkadot frame-identity types) (polkadot-js#2024)

* Bump API (Polkadot frame-identity types)

* Typo

* [CI Skip]  0.38.0-beta.54

skip-checks: true

* Add header prop on Modal (polkadot-js#2025)

* Add header prop on Modal

* Bump API, fixed electionsPhragmen

* s/HEADER/header/

* [CI Skip]  0.38.0-beta.55

skip-checks: true

* Add ErrorBoundary component (polkadot-js#2026)

* Add ErrorBoundary component

* Decode call via effect

* Cleanups

* [CI Skip]  0.38.0-beta.56

skip-checks: true

* Update extra key (polkadot-js#2027)

* [CI Skip]  0.38.0-beta.57

skip-checks: true

* Add multi-address selection component (polkadot-js#2028)

* [CI Skip]  0.38.0-beta.58

skip-checks: true

* Update ValidatorPrefs for Edgeware (polkadot-js#2029)

* [CI Skip]  0.38.0-beta.59

skip-checks: true

* Bump deps (polkadot-js#2030)

* [CI Skip]  0.38.0-beta.60

skip-checks: true

* Rework staking accounts layout (polkadot-js#2031)

* Rework staking accounts layout

* Optimize sort, simple substract

* Unneeded ?.

* Remove AddressCard

* Bump API

* [CI Skip]  0.38.0-beta.61

skip-checks: true

* Bump API (democracy) (polkadot-js#2034)

* [CI Skip]  0.38.0-beta.62

skip-checks: true

* Small updates for V2 democracy (polkadot-js#2038)

* [CI Skip]  0.38.0-beta.63

skip-checks: true

* Apply useToggle as appropriate (polkadot-js#2036)

* Apply useToggle as appropriate

* Update inset

* [CI Skip]  0.38.0-beta.64

skip-checks: true

* Rollback latest (something went wrong) (polkadot-js#2039)

* Revert "[CI Skip]  0.38.0-beta.64"

This reverts commit 632c224.

* Revert "Apply useToggle as appropriate (polkadot-js#2036)"

This reverts commit 62f7442.

* Revert "[CI Skip]  0.38.0-beta.63"

This reverts commit 635f616.

* Revert "Small updates for V2 democracy (polkadot-js#2038)"

This reverts commit 32db955.

* Revert last bumps

* Update .123trigger

* [CI Skip]  0.38.1

skip-checks: true

* Small cleanups on withCalls (polkadot-js#2040)

* Fixups

* More

* Some withCalls -> useCall

* Linting

* Always defined

* Re-apply democracy changes

* TimePeriod adjusted

* Cleanup imports

* Additional

* More conversions

* Small loading cleanups

* Small context updates

* [CI Skip]  0.39.0-beta.0

skip-checks: true

* Add useIsMountedRef hook (polkadot-js#2041)

* Add useIsMountedRef hook

* Use mounted ref on async operations (staking)

* Rework historic caching

* linting

* [CI Skip]  0.39.0-beta.1

skip-checks: true

* Basis IdentityInfo input component (polkadot-js#2048)

* [CI Skip]  0.39.0-beta.2

skip-checks: true

* Rework reward cache (polkadot-js#2049)

* Rework reward cache

* Linting

* [CI Skip]  0.39.0-beta.3

skip-checks: true

* Update IdentityInfo (polkadot-js#2052)

* Update IdentityInfo

* Remove test data

* Bump API (fixed decodable Data)

* [CI Skip]  0.39.0-beta.4

skip-checks: true

* Display identity names, set identity modal (polkadot-js#2054)

* Display identity names, set identity modal

* Update AddressRow types

* useToggle in accounts modal

* [CI Skip]  0.39.0-beta.5

skip-checks: true

* Use identity displayname default from local name (polkadot-js#2056)

* [CI Skip]  0.39.0-beta.6

skip-checks: true

* Remove balance from commission display (polkadot-js#2058)

* Remove balance from commission display

* Adjust controller mini padding

* [CI Skip]  0.39.0-beta.7

skip-checks: true

* Fix explorer (v1), withObservable unload & democracy images (polkadot-js#2062)

* Fix explorer (v1), withObservable unload & democracy images

* API bump

* Seconding count

* DerivedCollectiveProposal type

* [CI Skip]  0.39.0-beta.8

skip-checks: true

* Add expanded tooltip to per-account breakdown (polkadot-js#2063)

* [CI Skip]  0.39.0-beta.9

skip-checks: true

* Identity judgements (polkadot-js#2064)

* Display identity judgements

* Small badge alignment adjustment

* Linting

* Check namaes against lowercase

* [CI Skip]  0.39.0-beta.10

skip-checks: true

* Adjust name weights

* [CI Skip]  0.39.0-beta.11

skip-checks: true

* Use lookup accountId for IdentiIcon display (polkadot-js#2065)

* [CI Skip]  0.39.0-beta.12

skip-checks: true

* Styling tweaks (polkadot-js#2066)

* Styling tweaks

* Linting

* [CI Skip]  0.39.0-beta.13

skip-checks: true

* (tiny) Badge styling updates (polkadot-js#2067)

* [CI Skip]  0.39.0-beta.14

skip-checks: true

* Disable contracts call RPC if unavailable (polkadot-js#2068)

* disable contract rpc

* bump

* [CI Skip]  0.39.0-beta.15

skip-checks: true

* Fix Identicon on-not-connected (polkadot-js#2070)

* [CI Skip]  0.39.0-beta.16

skip-checks: true

* Hide council voting when not a member (polkadot-js#2071)

* Hide council voting when not a member

* Disable instead of hide

* [CI Skip]  0.39.0-beta.17

skip-checks: true

* Add "send to council" to treasury (polkadot-js#2075)

* [CI Skip]  0.39.0-beta.18

skip-checks: true

* Add useTranslation for all apps (polkadot-js#2076)

* [CI Skip]  0.39.0-beta.19

skip-checks: true

* Display all identity info on hover (polkadot-js#2077)

* Display all identity info on hover

* Bump API

* displayName linting

* [CI Skip]  0.39.0-beta.20

skip-checks: true

* Provide judgement via account hover (polkadot-js#2078)

* Provide judgement via account hover

* Click to provide judgement

* [CI Skip]  0.39.0-beta.21

skip-checks: true

* Grayscale identity (polkadot-js#2079)

* [CI Skip]  0.39.0-beta.22

skip-checks: true

* Bump API (derives for proposals) (polkadot-js#2080)

* [CI Skip]  0.39.0-beta.23

skip-checks: true

* Cleanup display from identity (polkadot-js#2081)

* Cleanup display from identity

* Bump API

* [CI Skip]  0.39.0-beta.24

skip-checks: true

* Revert opacity adjustment

* [CI Skip]  0.39.0-beta.25

skip-checks: true

* Updae the council counter refresh (polkadot-js#2082)

* [CI Skip]  0.39.0-beta.26

skip-checks: true

* fix build

* fix lint

* fix yarn.lock

* fix pacakge.json

Co-authored-by: Luke Sugiura <junichi.sugiura@dappface.com>
Co-authored-by: Keith Ingram <kwingram25@gmail.com>
Co-authored-by: Jaco Greeff <jacogr@gmail.com>
Co-authored-by: Anakorn Tata Kyavatanakij <anakornk@gmail.com>
Co-authored-by: Luke Schoen <ltfschoen@users.noreply.github.com>
Co-authored-by: Drew Stone <drewstone329@gmail.com>
  • Loading branch information
7 people committed Dec 21, 2019
1 parent 8724d94 commit 74fcf81
Show file tree
Hide file tree
Showing 361 changed files with 8,638 additions and 5,509 deletions.
2 changes: 1 addition & 1 deletion .123trigger
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5
6
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea/
.vscode/
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- Convert a large number of components to use hooks
- Display validator graphs
- Refactor of backup modal (Thanks to @LukeSugiura)
- Enable lanugage setting options (Thanks to @LukeSugiura)
- Enable language setting options (Thanks to @LukeSugiura)
- Allow for signRaw to be used in the signing toolbox (injected accounts)
- Display account names in status events
- Nomination targets dashboard
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"packages": [
"packages/*"
],
"version": "0.38.0-beta.0"
"version": "0.39.0-beta.26"
}
27 changes: 10 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.38.0-beta.0",
"version": "0.39.0-beta.26",
"private": true,
"engines": {
"node": ">=10.13.0",
Expand All @@ -10,14 +10,14 @@
"packages/*"
],
"resolutions": {
"@polkadot/api": "^0.98.0-beta.0",
"@polkadot/api-contract": "^0.98.0-beta.0",
"@polkadot/api": "^0.100.0-beta.14",
"@polkadot/api-contract": "^0.100.0-beta.14",
"@polkadot/keyring": "^1.7.1",
"@polkadot/types": "^0.98.0-beta.0",
"@polkadot/types": "^0.100.0-beta.14",
"@polkadot/util": "^1.7.1",
"@polkadot/util-crypto": "^1.7.1",
"babel-core": "^7.0.0-bridge.0",
"typescript": "^3.7.2"
"typescript": "^3.7.3"
},
"scripts": {
"analyze": "yarn run build && cd packages/apps && yarn run source-map-explorer build/main.*.js",
Expand All @@ -34,10 +34,11 @@
"start": "cd packages/apps && webpack --config webpack.config.js"
},
"devDependencies": {
"@babel/core": "^7.7.4",
"@babel/runtime": "^7.7.4",
"@polkadot/dev-react": "^0.32.0-beta.15",
"@polkadot/ts": "^0.1.86",
"@babel/core": "^7.7.5",
"@babel/register": "^7.7.4",
"@babel/runtime": "^7.7.6",
"@polkadot/dev-react": "^0.32.13",
"@polkadot/ts": "^0.1.88",
"autoprefixer": "^9.7.1",
"empty": "^0.10.1",
"html-loader": "^0.5.5",
Expand All @@ -53,13 +54,5 @@
"postcss-simple-vars": "^5.0.0",
"precss": "^4.0.0",
"source-map-explorer": "^2.1.0"
},
"dependencies": {
"@polkadot/api": "^0.97.0-beta.2",
"@polkadot/api-contract": "^0.97.0-beta.16",
"@polkadot/keyring": "^1.7.0-beta.6",
"@polkadot/types": "^0.97.0-beta.16",
"@polkadot/util": "^1.7.0-beta.6",
"@polkadot/util-crypto": "^1.7.0-beta.6"
}
}
6 changes: 3 additions & 3 deletions packages/app-123code/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/app-123code",
"version": "0.38.0-beta.0",
"version": "0.39.0-beta.26",
"description": "A basic app that shows the ropes on customisation",
"main": "index.js",
"scripts": {},
Expand All @@ -10,7 +10,7 @@
],
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.7.4",
"@polkadot/react-components": "^0.38.0-beta.0"
"@babel/runtime": "^7.7.5",
"@polkadot/react-components": "^0.39.0-beta.26"
}
}
6 changes: 3 additions & 3 deletions packages/app-123code/src/AccountSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import React, { useEffect, useState } from 'react';
import styled from 'styled-components';
import { Bubble, InputAddress } from '@polkadot/react-components';
import { AccountIndex, Balance, Nonce } from '@polkadot/react-query';
import { AccountIndex, Bubble, InputAddress } from '@polkadot/react-components';
import { Balance, Nonce } from '@polkadot/react-query';

interface Props {
className?: string;
Expand All @@ -27,7 +27,7 @@ function AccountSelector ({ className, onChange }: Props): React.ReactElement<Pr
/>
<div className='medium'>
<Bubble color='teal' icon='address card' label='index'>
<AccountIndex params={accountId} />
<AccountIndex value={accountId} />
</Bubble>
<Bubble color='yellow' icon='adjust' label='balance'>
<Balance params={accountId} />
Expand Down
40 changes: 16 additions & 24 deletions packages/app-123code/src/SummaryBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,26 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.

import { AccountId } from '@polkadot/types/interfaces';
import { DeriveStakingValidators } from '@polkadot/api-derive/types';
import { BareProps, I18nProps } from '@polkadot/react-components/types';
import { Balance, BlockNumber } from '@polkadot/types/interfaces';

import BN from 'bn.js';
import React from 'react';
import { withCalls } from '@polkadot/react-api';
import { Bubble, IdentityIcon } from '@polkadot/react-components';
import { useApi } from '@polkadot/react-hooks';
import { useApi, useCall } from '@polkadot/react-hooks';
import { formatBalance, formatNumber } from '@polkadot/util';

import translate from './translate';

interface Props extends BareProps, I18nProps {
balances_totalIssuance?: BN;
chain_bestNumber?: BN;
chain_bestNumberLag?: BN;
staking_validators?: AccountId[];
}
interface Props extends BareProps, I18nProps {}

function SummaryBar ({ balances_totalIssuance, chain_bestNumber, chain_bestNumberLag, staking_validators }: Props): React.ReactElement<Props> {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function SummaryBar (props: Props): React.ReactElement<Props> {
const { api, systemChain, systemName, systemVersion } = useApi();
const bestNumber = useCall<BlockNumber>(api.derive.chain.bestNumber, []);
const bestNumberLag = useCall<BlockNumber>(api.derive.chain.bestNumberLag, []);
const totalInsurance = useCall<Balance>(api.query.balances.totalIssuance, []);
const validators = useCall<DeriveStakingValidators>(api.derive.staking.validators, []);

return (
<summary>
Expand All @@ -35,32 +34,25 @@ function SummaryBar ({ balances_totalIssuance, chain_bestNumber, chain_bestNumbe
{systemChain}
</Bubble>
<Bubble icon='code' label='runtime'>
{api.runtimeVersion.implName} v{api.runtimeVersion.implVersion}
{api.runtimeVersion.implName} v{api.runtimeVersion.implVersion.toString(10)}
</Bubble>
<Bubble icon='bullseye' label='best #'>
{formatNumber(chain_bestNumber)} ({formatNumber(chain_bestNumberLag)} lag)
{formatNumber(bestNumber)} ({formatNumber(bestNumberLag)} lag)
</Bubble>
{staking_validators && (
{validators && (
<Bubble icon='chess queen' label='validators'>{
staking_validators.map((accountId, index): React.ReactNode => (
validators.validators.map((accountId, index): React.ReactNode => (
<IdentityIcon key={index} value={accountId} size={20} />
))
}</Bubble>
)}
<Bubble icon='circle' label='total tokens'>
{formatBalance(balances_totalIssuance)}
{formatBalance(totalInsurance)}
</Bubble>
</div>
</summary>
);
}

// inject the actual API calls automatically into props
export default translate(
withCalls<Props>(
'derive.chain.bestNumber',
'derive.chain.bestNumberLag',
'derive.staking.validators',
'query.balances.totalIssuance'
)(SummaryBar)
);
export default translate(SummaryBar);
4 changes: 2 additions & 2 deletions packages/app-123code/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import translate from './translate';
// define our internal types
interface Props extends AppProps, I18nProps {}

function App ({ className }: Props): React.ReactElement<Props> {
function TemplateApp ({ className }: Props): React.ReactElement<Props> {
const [accountId, setAccountId] = useState<string | null>(null);

return (
Expand All @@ -35,4 +35,4 @@ function App ({ className }: Props): React.ReactElement<Props> {
);
}

export default translate(App);
export default translate(TemplateApp);
8 changes: 4 additions & 4 deletions packages/app-accounts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/app-accounts",
"version": "0.38.0-beta.0",
"version": "0.39.0-beta.26",
"main": "index.js",
"repository": "https://github.com/polkadot-js/apps.git",
"author": "Jaco Greeff <jacogr@gmail.com>",
Expand All @@ -10,9 +10,9 @@
"contributors": [],
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.7.4",
"@polkadot/react-components": "^0.38.0-beta.0",
"@polkadot/react-qr": "^0.47.1",
"@babel/runtime": "^7.7.5",
"@polkadot/react-components": "^0.39.0-beta.26",
"@polkadot/react-qr": "^0.48.0-beta.5",
"@types/file-saver": "^2.0.0",
"@types/yargs": "^13.0.2",
"babel-plugin-module-resolver": "^3.1.1",
Expand Down
Loading

0 comments on commit 74fcf81

Please sign in to comment.