ghost-portal/packages/react-hooks/src/useSubidentities.ts
MiZiet 42ef182879
Style identity and balance sections in sidebar (#6096)
* Add subs modal

* Add tests

* Add Translations

* Improve closing modal

* Improve tests

* Improve styles

* Style balances & identity

* Optimize imports

* Improve styles

* Set greater width to balance section

* Rename subs modal toggle

* Change 'amount' to 'count' in test name

* Set make modal header fixed while content is scrollable

* Style multisig

* Update multisig styles

* Capitalize headers

* Move sidebar tests to Sidebar.spec.tsx

* Remove duplications in tests

* Add UserIcon component

* Revert subs modal changes and add scrollable section in Sidebar

* Remove unused styles

* Use accountsPage clearAccount method

* Wrap subs into Expander

* Add useSubidentities hook

* Adjust api mock in tests

* WIP - split judgements

* Revert mistaken commit

Co-authored-by: Krzysztof Jelski <krzysztof@ethworks.io>
Co-authored-by: Ewa Kowalska <ewcia.kowalska@gmail.com>
2021-09-19 08:49:23 +02:00

14 lines
446 B
TypeScript

// Copyright 2017-2021 @polkadot/react-hooks authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AccountId, BalanceOf } from '@polkadot/types/interfaces';
import { useApi } from './useApi';
import { useCall } from './useCall';
export function useSubidentities (address: string): AccountId[] | undefined {
const { api } = useApi();
return useCall<[BalanceOf, AccountId[]]>(api.query.identity?.subsOf, [address])?.[1];
}