Skip to content

Commit

Permalink
update: display the type of proxy on multisig view (#490)
Browse files Browse the repository at this point in the history
Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
  • Loading branch information
bolajahmad and Tbaut authored Jan 29, 2024
1 parent 0f211d5 commit 1370806
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
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]]'),
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'

0 comments on commit 1370806

Please sign in to comment.