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

update: display the type of proxy on multisig view #490

Merged
merged 7 commits into from
Jan 29, 2024
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 packages/ui/cypress/support/page-objects/multisigPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const multisigPage = {
multisigDetailsContainer: () => cy.get('[data-cy=container-multisig-details]'),
multisigAccountSummary: () => cy.get('[data-cy=container-multisig-account-summary]'),
thresholdListItem: () => cy.get('[data-cy=list-item-threshold]'),
proxyTypeListItem: () => cy.get('[data-cy=list-item-proxy-type]]'),
Tbaut marked this conversation as resolved.
Show resolved Hide resolved
balanceListItem: () => cy.get('[data-cy=list-item-balance]'),
signatoriesAccordion: () => cy.get('[data-cy=accordion-signatories]'),
expandSignatoriesIcon: () => cy.get('[data-cy=icon-expand-signatories-summary]'),
Expand Down
13 changes: 13 additions & 0 deletions packages/ui/src/pages/Home/MultisigView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Chip } from '@mui/material'
import { useMultiProxy } from '../../contexts/MultiProxyContext'
import MultisigAccordion from './MultisigAccordion'
import { Balance } from '../../components/library'
import { camelcasetoString } from '../../utils'

const MultisigView = () => {
const { selectedMultiProxy, selectedHasProxy } = useMultiProxy()
Expand Down Expand Up @@ -46,6 +47,12 @@ const MultisigView = () => {
<ListFieldText>Threshold</ListFieldText>
<ChipStyled label={`${multisig.threshold}/${multisig.signatories?.length}`} />
</ListElement>
{multisig.type && (
<ListElement data-cy="list-item-proxy-type">
<ListFieldText>Proxy Type</ListFieldText>
<ListFieldValue>{camelcasetoString(multisig.type)}</ListFieldValue>
</ListElement>
)}
{selectedHasProxy && (
<ListElement data-cy="list-item-balance">
<ListFieldText>Balance</ListFieldText>
Expand Down Expand Up @@ -134,6 +141,12 @@ const ListFieldText = styled('div')`
color: ${({ theme }) => theme.custom.gray[800]};
`

const ListFieldValue = styled('div')`
color: ${({ theme }) => theme.custom.text.secondary};
font-size: 1rem;
font-weight: 400;
`

const AccountDisplayWrapperStyled = styled('div')`
width: 100%;
display: flex;
Expand Down
4 changes: 4 additions & 0 deletions packages/ui/src/utils/camelcasetoString.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const camelcasetoString = (proxy: string) =>
proxy.replace(/[A-Z]/g, function (match, index) {
return index === 0 ? match : ` ${match}`
})
1 change: 1 addition & 0 deletions packages/ui/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ export * from './getApproveAsMultiTx'
export * from './getAsMultiTx'
export * from './getErrorMessageReservedFunds'
export * from './extinsicErrorChecks'
export * from './camelcasetoString'
Loading