-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: viktoriabakun <viktoriabakun00@gmail.com>
- Loading branch information
1 parent
a69e733
commit 60bbe72
Showing
9 changed files
with
158 additions
and
90 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './lib/proposal-list-page'; | ||
export * from './lib/proposal-details-page'; | ||
export * from './lib/components/proposal-list-card'; | ||
export * from './lib/hooks/useGetProposalTypeText'; |
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,44 @@ | ||
import { useTranslate } from '@tolgee/react'; | ||
|
||
export const enum ProposalTypes { | ||
Text = '/cosmos.gov.v1beta1.TextProposal', | ||
SoftwareUpgrade = '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal', | ||
CancelSoftwareUpgrade = '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal', | ||
ParameterChange = '/cosmos.params.v1beta1.ParameterChangeProposal', | ||
ClientUpdate = '/ibc.core.client.v1.ClientUpdateProposal', | ||
RegisterCoin = '/evmos.erc20.v1.RegisterCoinProposal', | ||
RegisterERC20 = '/evmos.erc20.v1.RegisterERC20Proposal', | ||
} | ||
|
||
export function useGetProposalTypeText(type: string) { | ||
const { t } = useTranslate('governance'); | ||
|
||
switch (type) { | ||
case ProposalTypes.Text: | ||
return t('proposal-types.text', 'Text'); | ||
|
||
case ProposalTypes.SoftwareUpgrade: | ||
return t('proposal-types.software-upgrade', 'Software upgrade'); | ||
|
||
case ProposalTypes.CancelSoftwareUpgrade: | ||
return t( | ||
'proposal-types.cancel-software-upgrade', | ||
'Cancel software upgrade', | ||
); | ||
|
||
case ProposalTypes.ClientUpdate: | ||
return t('proposal-types.client-update', 'Client update'); | ||
|
||
case ProposalTypes.ParameterChange: | ||
return t('proposal-types.parameter-change', 'Parameter change'); | ||
|
||
case ProposalTypes.RegisterCoin: | ||
return t('proposal-types.register-coin', 'Register coin'); | ||
|
||
case ProposalTypes.RegisterERC20: | ||
return t('proposal-types.register-erc20', 'Register ERC20'); | ||
|
||
default: | ||
return type; | ||
} | ||
} |
Oops, something went wrong.