unscrupelous to unscrupulous (#7935)

This commit is contained in:
joe petrowski 2022-07-29 14:59:25 +02:00 committed by GitHub
parent 3afbd6c4fe
commit 35db0889fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 30 additions and 30 deletions

View File

@ -16,7 +16,7 @@
"The bond will be reserved for the duration of your alliance membership.": "The bond will be reserved for the duration of your alliance membership.",
"The deposit that is reserved": "The deposit that is reserved",
"This account will be submitted to join the aliance. It will be allocated one of the alliance roles upon joining, starting with Ally.": "This account will be submitted to join the aliance. It will be allocated one of the alliance roles upon joining, starting with Ally.",
"Unscrupelous": "Unscrupelous",
"Unscrupulous": "Unscrupulous",
"Up for kicking": "Up for kicking",
"accounts": "accounts",
"alliance account": "alliance account",

View File

@ -1,7 +1,7 @@
// Copyright 2017-2022 @polkadot/app-alliance authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Member, Unscrupelous } from '../types';
import type { Member, Unscrupulous } from '../types';
import React, { useMemo, useState } from 'react';
@ -14,10 +14,10 @@ interface Props {
className?: string;
members: Member[];
onClose: () => void;
unscrupelous: Unscrupelous;
unscrupulous: Unscrupulous;
}
function Join ({ className, members, onClose, unscrupelous: { accounts } }: Props): React.ReactElement<Props> {
function Join ({ className, members, onClose, unscrupulous: { accounts } }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { api } = useApi();
const { allAccounts } = useAccounts();

View File

@ -1,7 +1,7 @@
// Copyright 2017-2022 @polkadot/app-alliance authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Member as MemberType, Rule, Unscrupelous } from '../types';
import type { Member as MemberType, Rule, Unscrupulous } from '../types';
import React from 'react';
@ -19,11 +19,11 @@ interface Props {
members?: MemberType[];
prime?: string | null;
rule?: Rule;
unscrupelous?: Unscrupelous;
unscrupulous?: Unscrupulous;
voters?: string[];
}
function Overview ({ className, members, prime, rule, unscrupelous, voters }: Props): React.ReactElement<Props> {
function Overview ({ className, members, prime, rule, unscrupulous, voters }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const [isJoinOpen, toggleJoin] = useToggle();
@ -36,15 +36,15 @@ function Overview ({ className, members, prime, rule, unscrupelous, voters }: Pr
<Button.Group>
<Button
icon='add'
isDisabled={!members || !unscrupelous}
isDisabled={!members || !unscrupulous}
label={t<string>('Join')}
onClick={toggleJoin}
/>
{members && unscrupelous && isJoinOpen && (
{members && unscrupulous && isJoinOpen && (
<Join
members={members}
onClose={toggleJoin}
unscrupelous={unscrupelous}
unscrupulous={unscrupulous}
/>
)}
</Button.Group>

View File

@ -1,7 +1,7 @@
// Copyright 2017-2022 @polkadot/app-alliance authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Unscrupelous as UnscrupelousType } from '../types';
import type { Unscrupulous as UnscrupulousType } from '../types';
import React, { useRef } from 'react';
@ -13,10 +13,10 @@ import Website from './Website';
interface Props {
className?: string;
unscrupelous?: UnscrupelousType;
unscrupulous?: UnscrupulousType;
}
function Unscrupelous ({ className, unscrupelous }: Props): React.ReactElement<Props> {
function Unscrupulous ({ className, unscrupulous }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const accRef = useRef([
@ -30,10 +30,10 @@ function Unscrupelous ({ className, unscrupelous }: Props): React.ReactElement<P
return (
<div className={className}>
<Table
empty={unscrupelous && unscrupelous.accounts && t<string>('No accounts')}
empty={unscrupulous && unscrupulous.accounts && t<string>('No accounts')}
header={accRef.current}
>
{unscrupelous && unscrupelous.accounts.map((m) => (
{unscrupulous && unscrupulous.accounts.map((m) => (
<Account
key={m}
value={m}
@ -41,10 +41,10 @@ function Unscrupelous ({ className, unscrupelous }: Props): React.ReactElement<P
))}
</Table>
<Table
empty={unscrupelous && unscrupelous.websites && t<string>('No websites')}
empty={unscrupulous && unscrupulous.websites && t<string>('No websites')}
header={webRef.current}
>
{unscrupelous && unscrupelous.websites.map((m) => (
{unscrupulous && unscrupulous.websites.map((m) => (
<Website
key={m}
value={m}
@ -55,4 +55,4 @@ function Unscrupelous ({ className, unscrupelous }: Props): React.ReactElement<P
);
}
export default React.memo(Unscrupelous);
export default React.memo(Unscrupulous);

View File

@ -13,11 +13,11 @@ import { useApi, useCall, useCollectiveMembers } from '@polkadot/react-hooks';
import Announcements from './Announcements';
import Overview from './Overview';
import { useTranslation } from './translate';
import Unscrupelous from './Unscrupelous';
import Unscrupulous from './Unscrupulous';
import useAnnoucements from './useAnnoucements';
import useMembers from './useMembers';
import useRule from './useRule';
import useUnscrupelous from './useUnscrupelous';
import useUnscrupulous from './useUnscrupulous';
interface Props {
basePath: string;
@ -35,7 +35,7 @@ function AllianceApp ({ basePath, className }: Props): React.ReactElement<Props>
const accouncements = useAnnoucements();
const members = useMembers();
const rule = useRule();
const unscrupelous = useUnscrupelous();
const unscrupulous = useUnscrupulous();
const motionFilter = useCallback(
(section: string) => section === 'alliance',
@ -57,8 +57,8 @@ function AllianceApp ({ basePath, className }: Props): React.ReactElement<Props>
text: t<string>('Announcements ({{count}})', { replace: { count: (accouncements && accouncements.length) || 0 } })
},
{
name: 'unscrupelous',
text: t<string>('Unscrupelous')
name: 'unscrupulous',
text: t<string>('Unscrupulous')
}
], [accouncements, proposalHashes, t]);
@ -84,8 +84,8 @@ function AllianceApp ({ basePath, className }: Props): React.ReactElement<Props>
type='alliance'
/>
</Route>
<Route path={`${basePath}/unscrupelous`}>
<Unscrupelous unscrupelous={unscrupelous} />
<Route path={`${basePath}/unscrupulous`}>
<Unscrupulous unscrupulous={unscrupulous} />
</Route>
<Route>
<Overview
@ -93,7 +93,7 @@ function AllianceApp ({ basePath, className }: Props): React.ReactElement<Props>
members={members}
prime={prime}
rule={rule}
unscrupelous={unscrupelous}
unscrupulous={unscrupulous}
voters={voters}
/>
</Route>

View File

@ -26,7 +26,7 @@ export interface Rule {
hasRule: boolean;
}
export interface Unscrupelous {
export interface Unscrupulous {
accounts: string[];
websites: string[];
}

View File

@ -3,7 +3,7 @@
import type { Bytes } from '@polkadot/types';
import type { AccountId32 } from '@polkadot/types/interfaces';
import type { Unscrupelous } from './types';
import type { Unscrupulous } from './types';
import { useMemo } from 'react';
@ -23,7 +23,7 @@ const OPT_WEB = {
mapString(websites.filter((b) => b.isAscii))
};
function useUnscrupelousImpl (): Unscrupelous | undefined {
function useUnscrupulousImpl (): Unscrupulous | undefined {
const { api } = useApi();
const accounts = useCall<string[]>(api.query.alliance.unscrupulousAccounts, [], OPT_ACC);
const websites = useCall<string[]>(api.query.alliance.unscrupulousWebsites, [], OPT_WEB);
@ -34,4 +34,4 @@ function useUnscrupelousImpl (): Unscrupelous | undefined {
);
}
export default createNamedHook('useUnscrupelous', useUnscrupelousImpl);
export default createNamedHook('useUnscrupulous', useUnscrupulousImpl);