Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added icons for consensus.Delegate and consensus.Undelegate #906

Merged
merged 4 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/906.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added icons for consensus.Delegate and consensus.Undelegate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use present tense for inclusion in the change log.

2 changes: 1 addition & 1 deletion .storybook/public/mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */

/**
* Mock Service Worker (1.2.5).
* Mock Service Worker (1.3.1).
* @see https://github.com/mswjs/msw
* - Please do NOT modify this file.
* - Please do NOT serve this file on production.
Expand Down
21 changes: 21 additions & 0 deletions src/app/components/CustomIcons/Delegate.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { FC } from 'react'
import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'

export const DelegateIcon: FC<SvgIconProps> = props => {
return (
<SvgIcon {...props}>
<defs>
<clipPath id="clippath">
<rect fill="none" x="4.2" y="4.2" width="15.6" height="15.6" />
</clipPath>
</defs>
<circle fill="#E8F6FF" cx="12" cy="12" r="12" />
<g clipPath="url(#clippath)">
<path
fill="#6665D8"
d="M11.46,17.36H7.18v-3.75h1.61v-2.14h2.68v-1.07h-1.61v-3.75h4.29v3.75h-1.61v1.07h2.68v2.14h1.61v3.75h-4.29v-3.75h1.61v-1.07h-4.29v1.07h1.61v3.75Z"
/>
</g>
</SvgIcon>
)
}
26 changes: 26 additions & 0 deletions src/app/components/CustomIcons/Undelegate.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { FC } from 'react'
import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'

export const UndelegateIcon: FC<SvgIconProps> = props => {
return (
<SvgIcon {...props}>
<defs>
<clipPath id="clippath">
<rect fill="none" x="4.2" y="4.2" width="15.6" height="15.6" />
</clipPath>
</defs>
<circle fill="#E8F6FF" cx="12" cy="12" r="12" />
<g clipPath="url(#clippath)">
<g>
<path
fill="#6665D8"
d="M7.05,6.83l-.22-.22-.76,.76,4.09,4.09h-1.39v2.16h-1.62v3.77h4.31v-3.77h-1.62v-1.08h1.39l1.3,1.3v3.55h3.55l.65,.65,.76-.76-.57-.57h0S7.05,6.83,7.05,6.83h0Z"
/>
<path fill="#6665D8" d="M16.85,15.11v-1.49h-1.49l1.49,1.49Z" />
<path fill="#6665D8" d="M15.23,13.49v-2.03h-2.03l2.03,2.03Z" />
<path fill="#6665D8" d="M12.54,10.8v-.42h1.62v-3.77h-4.31v1.49l2.7,2.7Z" />
</g>
</g>
</SvgIcon>
)
}
12 changes: 12 additions & 0 deletions src/app/components/RuntimeTransactionLabel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { ContractCallIcon } from './../CustomIcons/ContractCall'
import { DepositIcon } from './../CustomIcons/Deposit'
import { WithdrawIcon } from './../CustomIcons/Withdraw'
import { TransferIcon } from './../CustomIcons/Transfer'
import { DelegateIcon } from '../CustomIcons/Delegate'
import { UndelegateIcon } from '../CustomIcons/Undelegate'

const getRuntimeTransactionLabel = (t: TFunction, method: string | undefined) => {
switch (method) {
Expand All @@ -25,6 +27,10 @@ const getRuntimeTransactionLabel = (t: TFunction, method: string | undefined) =>
return t('transactions.method.consensus.withdraw')
case 'accounts.Transfer':
return t('transactions.method.accounts.transfer')
case 'consensus.Delegate':
return t('transactions.method.consensus.delegate')
case 'consensus.Undelegate':
return t('transactions.method.consensus.undelegate')
default:
return t('transactions.method.unknown', { method })
}
Expand All @@ -44,6 +50,10 @@ const getRuntimeTransactionIcon = (method: string | undefined) => {
return <DepositIcon sx={iconStyles} />
case 'consensus.Withdraw':
return <WithdrawIcon sx={iconStyles} />
case 'consensus.Delegate':
return <DelegateIcon sx={iconStyles} />
case 'consensus.Undelegate':
return <UndelegateIcon sx={iconStyles} />
case 'accounts.Transfer':
return <TransferIcon sx={iconStyles} />
default:
Expand All @@ -62,6 +72,8 @@ type RuntimeTransactionLabelProps = {
* - "accounts.Transfer"
* - "consensus.Deposit"
* - "consensus.Withdraw"
* - "consensus.Delegate"
* - "consensus.Undelegate"
* - "evm.Create"
* - "evm.Call"
*/
Expand Down
2 changes: 2 additions & 0 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@
},
"consensus": {
"deposit": "Consensus Deposit",
"delegate": "Consensus Delegate",
"undelegate": "Consensus Undelegate",
"withdraw": "Consensus Withdraw"
},
"evm": {
Expand Down
6 changes: 5 additions & 1 deletion src/oasis-nexus/generated/api.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.