Skip to content

Commit

Permalink
feat: connect opt & format code
Browse files Browse the repository at this point in the history
  • Loading branch information
kiner-tang committed Oct 14, 2023
1 parent f8d3a6c commit 94996dc
Showing 1 changed file with 6 additions and 27 deletions.
33 changes: 6 additions & 27 deletions packages/web3/src/address/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,12 @@ import { Space, Tooltip, message } from 'antd';
import React from 'react';

export interface AddressProps {
<<<<<<< Updated upstream
ellipsis?: boolean | {
headClip?: number;
tailClip?: number;
};
=======
ellipsis?:
| boolean
| {
showHead?: number;
showTail?: number;
headClip?: number;
tailClip?: number;
};
>>>>>>> Stashed changes
address?: string;
copyable?: boolean;
tooltip?: boolean | TooltipProps['title'];
Expand All @@ -26,23 +19,13 @@ export const Address: React.FC<AddressProps> = (props) => {
const { ellipsis, address, copyable, tooltip } = props;

const isEllipsis = !!ellipsis;
<<<<<<< Updated upstream
const {
headClip = 6,
tailClip = 4,
} = typeof ellipsis !== 'object' ? {
headClip: 6,
tailClip: 4,
} : ellipsis;
=======
const { showHead = 6, showTail = 4 } =
const { headClip = 6, tailClip = 4 } =
typeof ellipsis !== 'object'
? {
showHead: 6,
showTail: 4,
headClip: 6,
tailClip: 4,
}
: ellipsis;
>>>>>>> Stashed changes

if (!address) {
return null;
Expand All @@ -54,13 +37,9 @@ export const Address: React.FC<AddressProps> = (props) => {
return (
<Space>
<Tooltip title={displayTooltip}>
<<<<<<< Updated upstream
{isEllipsis ? `${filledAddress.slice(0, headClip)}...${filledAddress.slice(-tailClip)}` : filledAddress}
=======
{isEllipsis
? `${filledAddress.slice(0, showHead)}...${filledAddress.slice(-showTail)}`
? `${filledAddress.slice(0, headClip)}...${filledAddress.slice(-tailClip)}`
: filledAddress}
>>>>>>> Stashed changes
</Tooltip>
{copyable && (
<CopyOutlined
Expand Down

0 comments on commit 94996dc

Please sign in to comment.