diff --git a/packages/page-council/src/Motions/ProposeExternal.tsx b/packages/page-council/src/Motions/ProposeExternal.tsx index e328321530..c02c271f3d 100644 --- a/packages/page-council/src/Motions/ProposeExternal.tsx +++ b/packages/page-council/src/Motions/ProposeExternal.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/ui-staking authors & contributors +// Copyright 2017-2020 @polkadot/app-council authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/page-council/src/Motions/ProposeMotion.tsx b/packages/page-council/src/Motions/ProposeMotion.tsx index cb74ec0335..8bec224b85 100644 --- a/packages/page-council/src/Motions/ProposeMotion.tsx +++ b/packages/page-council/src/Motions/ProposeMotion.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/ui-staking authors & contributors +// Copyright 2017-2020 @polkadot/app-council authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/page-council/src/Motions/Slashing.tsx b/packages/page-council/src/Motions/Slashing.tsx index 202569baf0..f59b472993 100644 --- a/packages/page-council/src/Motions/Slashing.tsx +++ b/packages/page-council/src/Motions/Slashing.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/ui-staking authors & contributors +// Copyright 2017-2020 @polkadot/app-council authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/page-council/src/Motions/useAvailableSlashes.ts b/packages/page-council/src/Motions/useAvailableSlashes.ts index 3026b4b821..3081b3978a 100644 --- a/packages/page-council/src/Motions/useAvailableSlashes.ts +++ b/packages/page-council/src/Motions/useAvailableSlashes.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/ui-staking authors & contributors +// Copyright 2017-2020 @polkadot/app-council authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/page-council/src/Overview/SubmitCandidacy.tsx b/packages/page-council/src/Overview/SubmitCandidacy.tsx index 4d032ce14c..2ff3dc5c6e 100644 --- a/packages/page-council/src/Overview/SubmitCandidacy.tsx +++ b/packages/page-council/src/Overview/SubmitCandidacy.tsx @@ -1,50 +1,54 @@ -// Copyright 2017-2020 @polkadot/ui-staking authors & contributors +// Copyright 2017-2020 @polkadot/app-council authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { ApiProps } from '@polkadot/react-api/types'; -import { ComponentProps } from './types'; +import React, { useState } from 'react'; +import { Button, InputAddress, Modal, TxButton } from '@polkadot/react-components'; +import { useApi, useModal } from '@polkadot/react-hooks'; -import React from 'react'; -import { withApi } from '@polkadot/react-api/hoc'; -import { Button } from '@polkadot/react-components'; -import TxModal, { TxModalState as State, TxModalProps } from '@polkadot/react-components/TxModal'; +import { useTranslation } from '../translate'; -import translate from '../translate'; +function SubmitCandidacy (): React.ReactElement { + const { api } = useApi(); + const { t } = useTranslation(); + const [accountId, setAcountId] = useState(null); + const { isOpen, onOpen, onClose } = useModal(); -interface Props extends ApiProps, ComponentProps, TxModalProps {} - -class SubmitCandidacy extends TxModal { - protected headerText = (): string => this.props.t('Submit your council candidacy'); - - protected accountLabel = (): string => this.props.t('Candidate account'); - - protected accountHelp = (): string => this.props.t('This account will be nominated to fill the council slot you specify.'); - - protected txMethod = (): string => - this.props.api.tx.electionsPhragmen - ? 'electionsPhragmen.submitCandidacy' - : 'elections.submitCandidacy'; - - protected txParams = (): [] => []; - - protected isDisabled = (): boolean => { - const { accountId } = this.state; - - return !accountId; - } - - protected renderTrigger = (): React.ReactNode => { - const { t } = this.props; - - return ( + return ( + <> + {isOpen && ( + + + + + + + + + )}