forked from polkadot-js/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split parachain proposals (polkadot-js#4423)
- Loading branch information
Showing
15 changed files
with
109 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2017-2021 @polkadot/app-parachains authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import React from 'react'; | ||
|
||
import { Button } from '@polkadot/react-components'; | ||
import { useAccounts, useToggle } from '@polkadot/react-hooks'; | ||
|
||
import Propose from '../modals/Propose'; | ||
import { useTranslation } from '../translate'; | ||
|
||
interface Props { | ||
className?: string; | ||
} | ||
|
||
function Actions (): React.ReactElement<Props> { | ||
const { t } = useTranslation(); | ||
const { hasAccounts } = useAccounts(); | ||
const [showPropose, togglePropose] = useToggle(); | ||
|
||
return ( | ||
<> | ||
<Button.Group> | ||
<Button | ||
icon='plus' | ||
isDisabled={!hasAccounts} | ||
label={t<string>('Propose')} | ||
onClick={togglePropose} | ||
/> | ||
</Button.Group> | ||
{showPropose && ( | ||
<Propose onClose={togglePropose} /> | ||
)} | ||
</> | ||
); | ||
} | ||
|
||
export default React.memo(Actions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...age-parachains/src/Overview/Proposals.tsx → ...ge-parachains/src/Proposals/Proposals.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2017-2021 @polkadot/app-parachains authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import type { Proposals } from '../types'; | ||
|
||
import React from 'react'; | ||
|
||
import Actions from './Actions'; | ||
import ProposalList from './Proposals'; | ||
|
||
interface Props { | ||
className?: string; | ||
proposals?: Proposals; | ||
} | ||
|
||
function ProposalsTab ({ className, proposals }: Props): React.ReactElement<Props> { | ||
return ( | ||
<div className={className}> | ||
<Actions /> | ||
<ProposalList proposals={proposals} /> | ||
</div> | ||
); | ||
} | ||
|
||
export default React.memo(ProposalsTab); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters