-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature - introduce ambassador Base (Members and Referenda) (#10838)
* Ambassador Base (Members and Referenda) * Minor fixes
- Loading branch information
Showing
18 changed files
with
120 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2017-2024 @polkadot/apps-routing authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import type { Route, TFunction } from './types.js'; | ||
|
||
import Component, { useCounter } from '@polkadot/app-ambassador'; | ||
|
||
export default function create (t: TFunction): Route { | ||
return { | ||
Component, | ||
display: { | ||
needsAccounts: true, | ||
needsApi: [ | ||
'tx.ambassadorCollective.vote', | ||
'tx.ambassadorReferenda.submit', | ||
'consts.ambassadorReferenda.tracks' | ||
] | ||
}, | ||
group: 'governance', | ||
icon: 'user-friends', | ||
name: 'ambassador', | ||
text: t('nav.ambassador', 'Ambassador', { ns: 'apps-routing' }), | ||
useCounter | ||
}; | ||
} |
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 @@ | ||
{} |
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
Empty file.
Empty file.
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 @@ | ||
# @polkadot/app-ambassador |
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,23 @@ | ||
{ | ||
"bugs": "https://github.com/polkadot-js/apps/issues", | ||
"engines": { | ||
"node": ">=18" | ||
}, | ||
"homepage": "https://github.com/polkadot-js/apps/tree/master/packages/page-ambassador#readme", | ||
"license": "Apache-2.0", | ||
"name": "@polkadot/app-ambassador", | ||
"private": true, | ||
"repository": { | ||
"directory": "packages/page-ambassador", | ||
"type": "git", | ||
"url": "https://github.com/polkadot-js/apps.git" | ||
}, | ||
"sideEffects": false, | ||
"type": "module", | ||
"version": "0.142.2-25-x", | ||
"peerDependencies": { | ||
"react": "*", | ||
"react-dom": "*", | ||
"react-is": "*" | ||
} | ||
} |
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,26 @@ | ||
// Copyright 2017-2024 @polkadot/app-fellowship authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import React from 'react'; | ||
|
||
import Main from '@polkadot/app-ranked/App'; | ||
|
||
export { default as useCounter } from './useCounter.js'; | ||
|
||
interface Props { | ||
basePath: string; | ||
className?: string; | ||
} | ||
|
||
function App ({ basePath, className }: Props): React.ReactElement<Props> { | ||
return ( | ||
<Main | ||
basePath={basePath} | ||
className={className} | ||
palletColl='ambassadorCollective' | ||
palletPoll='ambassadorReferenda' | ||
/> | ||
); | ||
} | ||
|
||
export default React.memo(App); |
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,11 @@ | ||
// Copyright 2017-2024 @polkadot/app-ranked authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { useCounterNamed } from '@polkadot/app-referenda/useCounter'; | ||
import { createNamedHook } from '@polkadot/react-hooks'; | ||
|
||
function useCounterImpl (): number { | ||
return useCounterNamed('ambassadorReferenda'); | ||
} | ||
|
||
export default createNamedHook('useCounter', useCounterImpl); |
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,12 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"baseUrl": "..", | ||
"outDir": "./build", | ||
"rootDir": "./src" | ||
}, | ||
"references": [ | ||
{ "path": "../page-ranked/tsconfig.build.json" }, | ||
{ "path": "../react-components/tsconfig.build.json" } | ||
] | ||
} |
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