-
Notifications
You must be signed in to change notification settings - Fork 5
refactor: 'Account' instead of 'Account Holder' #1585
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2019-2024 @polkadot/extension-polkagate authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
/* eslint-disable react/jsx-max-props-per-line */ | ||
|
||
import type { TxInfo } from '../util/types'; | ||
|
||
import { Grid, Typography } from '@mui/material'; | ||
import React from 'react'; | ||
|
||
import { useTranslation } from '../hooks'; | ||
import { ThroughProxy } from '../partials'; | ||
import { ShortAddress } from '.'; | ||
|
||
interface Props { | ||
txInfo: TxInfo; | ||
label?: string; | ||
} | ||
|
||
export default function AccountWithProxyInConfirmation ({ label, txInfo }: Props): React.ReactElement { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<> | ||
<Grid alignItems='end' container justifyContent='center' sx={{ m: 'auto', pt: '5px', width: '90%' }}> | ||
<Typography fontSize='16px' fontWeight={400} lineHeight='23px'> | ||
{ label || t('Account')}: | ||
</Typography> | ||
<Typography fontSize='16px' fontWeight={400} lineHeight='23px' maxWidth='45%' overflow='hidden' pl='5px' textOverflow='ellipsis' whiteSpace='nowrap'> | ||
{txInfo.from.name} | ||
</Typography> | ||
<Grid fontSize='16px' fontWeight={400} item lineHeight='22px' pl='5px'> | ||
<ShortAddress | ||
address={txInfo.from.address} | ||
inParentheses | ||
style={{ fontSize: '16px' }} | ||
/> | ||
</Grid> | ||
</Grid> | ||
{txInfo.throughProxy && | ||
<Grid container m='auto' maxWidth='92%'> | ||
<ThroughProxy | ||
address={txInfo.throughProxy.address} | ||
chain={txInfo.chain} | ||
/> | ||
</Grid> | ||
} | ||
</> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2019-2024 @polkadot/extension-polkagate authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
/* eslint-disable react/jsx-max-props-per-line */ | ||
|
||
import { Divider, Grid, Typography } from '@mui/material'; | ||
import React from 'react'; | ||
|
||
interface Props { | ||
caption: string; | ||
value: any | React.ReactNode | string | undefined; | ||
showDivider?: boolean; | ||
fontSize?: string; | ||
fontWeight?: number; | ||
} | ||
Nick-1979 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
export default function DisplayInfo ({ caption, fontSize = '16px', fontWeight = 400, showDivider = true, value }: Props) { | ||
return ( | ||
<Grid alignItems='center' container direction='column' fontSize={fontSize} fontWeight={fontWeight} justifyContent='center'> | ||
<Grid container item width='fit-content'> | ||
<Typography lineHeight='40px' pr='5px'> | ||
{caption} | ||
</Typography> | ||
<Typography lineHeight='40px'> | ||
{value || ''} | ||
</Typography> | ||
</Grid> | ||
{showDivider && | ||
<Grid alignItems='center' container item justifyContent='center'> | ||
<Divider sx={{ bgcolor: 'secondary.main', height: '2px', mx: '6px', width: '240px' }} /> | ||
</Grid>} | ||
</Grid> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ export { default as AccountHolderWithProxy } from './AccountHolderWithProxy'; | |
export { default as AccountInputWithIdentity } from './AccountInputWithIdentity'; | ||
export { default as AccountNamePasswordCreation } from './AccountNamePasswordCreation'; | ||
export { default as AccountsTable } from './AccountsTable'; | ||
export { default as AccountWithProxyInConfirmation } from './AccountWithProxyInConfirmation'; | ||
export { default as ActionText } from './ActionText'; | ||
export { default as Address } from './Address'; | ||
export { default as AddressInput } from './AddressInput'; | ||
|
@@ -29,6 +30,7 @@ export { default as ColorContext } from './ColorContext'; | |
export * from './contexts'; | ||
export { default as Convictions } from './Convictions'; | ||
export { default as CopyAddressButton } from './CopyAddressButton'; | ||
export { default as DisplayInfo } from './DisplayInfo'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification DisplayInfo Component Export Does Not Match Expected Pattern
🔗 Analysis chainLGTM! Verify the new component and clarify its purpose. The export for To ensure the component exists and is implemented correctly, run the following script: Could you please clarify how the 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify the existence and basic structure of the DisplayInfo component
# Test: Check if the file exists
fd -t f "DisplayInfo.tsx" -X echo "File exists: {}"
# Test: Verify the component's basic structure
ast-grep --lang typescript --pattern $'export default function DisplayInfo($_) {
$$$
}'
Length of output: 217 |
||
export { default as ErrorBoundary } from './ErrorBoundary'; | ||
export { default as FormatBalance } from './FormatBalance'; | ||
export { default as FormatBalance2 } from './FormatBalance2'; | ||
|
Uh oh!
There was an error while loading. Please reload this page.