-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add people parachain #124
Add people parachain #124
Conversation
Deploying delegit with Cloudflare Pages
|
…are-people-parachain
…are-people-parachain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I didn't play with it yet and just went through the code.
I see a lot of useEffect
with the retrieveidentity
where it could have been done probably nicely in a custom useidentity(address)
hook, that returns the identity
.
I see you're not fetching the judgement yet. it can be added later, but I would show no checkmark then for the mean time.
type AccountAddressType = { | ||
address: string | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix this in a subsequent PR
@@ -50,7 +54,7 @@ const AccountContextProvider = ({ children }: AccountContextProps) => { | |||
useEffect(() => { | |||
if (localStorageAccount) { | |||
const account = accounts.find( | |||
(account) => account.address === localStorageAccount, | |||
({ address }: AccountAddressType) => address === localStorageAccount, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accounts
is of type PolkadotAccount[]
so the type is inferred. You don't need to declare anything.
({ address }: AccountAddressType) => address === localStorageAccount, | |
({ address }) => address === localStorageAccount, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this
src/assets/peopleNetworks.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is not needed any more is it? I'd put the network wss in the networks.json
file, under the other networks. But I can do this in another PR.
src/contexts/NetworkContext.tsx
Outdated
} | ||
|
||
const descriptor = descriptorName[network] | ||
const typedApi = client.getTypedApi(descriptor) | ||
|
||
const descriptorPeople = descriptorPeopleName[peopleNetwork!] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need of an assertion here, it's set in any case.
const descriptorPeople = descriptorPeopleName[peopleNetwork!] | |
const descriptorPeople = descriptorPeopleName[peopleNetwork] |
src/lib/types.ts
Outdated
export type PeopleNetworkType = { | ||
nodes: NameUrl[] | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May not be needed if removed.
src/lib/utils.ts
Outdated
@@ -24,6 +32,16 @@ export const getChainInformation = (networkName: NetworksFromConfig) => { | |||
} | |||
} | |||
|
|||
export const getPeopleChainInformation = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used any more
src/lib/utils.ts
Outdated
import { DEFAULT_TIME, lockPeriod, ONE_DAY, THRESHOLD } from './constants' | ||
import { bnMin } from './bnMin' | ||
|
||
const randomFromInterval = (min: number, max: number) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used any more
src/pages/Delegate/index.tsx
Outdated
@@ -101,6 +101,8 @@ export const Delegate = () => { | |||
setAmountVisible('0') | |||
}, [api]) | |||
|
|||
if (!delegate || !api) return <div>No delegate found</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove, unless you're fixing a known bug, there is no need for this, this is handled below.
…/dashboard into nik-prepare-people-parachain
closes #123
Submission checklist:
Functionality
Layout