* Show society skeptics & voters * useCounter for candidates * Sort founder to bottom * payouts due * sizing * remove header
14 lines
391 B
TypeScript
14 lines
391 B
TypeScript
// Copyright 2017-2021 @polkadot/app-society authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { Bid } from '@polkadot/types/interfaces';
|
|
|
|
import { useApi, useCall } from '@polkadot/react-hooks';
|
|
|
|
export default function useCounter (): number {
|
|
const { api } = useApi();
|
|
const bids = useCall<Bid[]>(api.query.society?.candidates);
|
|
|
|
return bids?.length || 0;
|
|
}
|