Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard: stats widget #229

Merged
merged 27 commits into from
Mar 27, 2020
Merged

Dashboard: stats widget #229

merged 27 commits into from
Mar 27, 2020

Conversation

rperez89
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Mar 10, 2020

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/aragon/court-dashboard/lne7j19dz
✅ Preview: https://court-dashboard-git-dashboard-stats.aragon.now.sh

Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of quick clean up comments, and then we'll likely want to re-work the hooks for fetching the stats.

Let's test this a bit more on mainnet and the rinkeby environments, so it works properly there!

decimals: 18,
symbol: 'ANJ',
},
rpc: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we use rpc for rinkeby too, or should we provide a rinkeby config here?

Copy link
Contributor Author

@rperez89 rperez89 Mar 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh that was i mistake to test it locally , but maybe we should only leave here the mainnet config since we are not going to fetch the price for another environments

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds reasonable too. Are these configs only used for fetching price (would be nice to comment this or make that assumption a bit more obvious)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes is only for fetching the price!, cool will comment something

src/networks.js Outdated Show resolved Hide resolved
src/web3-contracts.js Outdated Show resolved Hide resolved
src/lib/web3-utils.js Show resolved Hide resolved
src/components/Dashboard/CourtStats.js Outdated Show resolved Hide resolved
src/components/Dashboard/CourtStats.js Show resolved Hide resolved
src/components/Dashboard/CourtStats.js Outdated Show resolved Hide resolved
src/networks.js Outdated Show resolved Hide resolved
src/components/Dashboard/CourtStats.js Outdated Show resolved Hide resolved
@rperez89 rperez89 changed the title Dashboard stats dashboard: stats widget Mar 23, 2020
src/endpoints.js Outdated Show resolved Hide resolved
src/hooks/query-hooks.js Outdated Show resolved Hide resolved
src/networks.js Outdated Show resolved Hide resolved
const ethEndpoint = networkConfigs[getNetworkType()].nodes.defaultEth

const ethProvider = useMemo(
() => (ethEndpoint ? new Providers.JsonRpcProvider(ethEndpoint) : null),
Copy link
Contributor

@sohkai sohkai Mar 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A note for later: I think for now this is totally fine, since this provider uses http (it's maybe just a little memory in-efficient), but when we switch to websockets, we'll most likely want to initialize a singleton provider to maintain a single websocket connection for all contracts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let's keep that in mind

src/hooks/useCourtStats.js Outdated Show resolved Hide resolved
Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅✅✅This is looking good for me 🏁🏁🏁

src/hooks/useCourtContracts.js Outdated Show resolved Hide resolved
Comment on lines 3 to 8
// import environment from '../environment'
import { useCourtConfigSubscription } from '../hooks/subscription-hooks'
import { getNetworkType } from '../lib/web3-utils'
import { networks } from '../networks'
// import { getNetworkType } from '../lib/web3-utils'
import { getNetwork } from '../networks'

const CHAIN_ID = environment('CHAIN_ID')
// const CHAIN_ID = environment('CHAIN_ID')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this comments

@@ -578,7 +582,7 @@ export function useTotalANTStakedPolling(timeout = 1000) {
let cancelled = false
let timeoutId

if (getNetworkType() === 'local') {
if (getInternalNetworkName() === 'local') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use isLocalOrUnknownNetwork ?

src/endpoints.js Outdated
@@ -27,7 +27,7 @@ function getAPIBase() {
export default function endpoints() {
const [API_BASE_HTTP, API_BASE_WS] = getAPIBase()
const networkType =
getNetworkType(CHAIN_ID) === 'local' ? 'rpc' : getNetworkType(CHAIN_ID)
getNetworkType(CHAIN_ID) === 'private' ? 'rpc' : getNetworkType(CHAIN_ID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here ? isLocalOrUnknownNetwork

@vercel vercel bot temporarily deployed to Preview March 27, 2020 16:15 Inactive
Copy link
Contributor

@fabriziovigevani fabriziovigevani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌 🙌 🙌

@rperez89 rperez89 merged commit e4415f1 into development Mar 27, 2020
@sohkai sohkai mentioned this pull request Mar 27, 2020
@sohkai sohkai deleted the dashboard-stats branch July 3, 2020 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants