Skip to content

Commit

Permalink
trying to fix truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Jan 17, 2024
1 parent 36e863c commit ba685cf
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 8 additions & 5 deletions ui/shared/address/AddressFromTo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,21 @@ const AddressFromTo = ({ from, to, current, mode: modeProp, className, isLoading
);
}

const isOutgoing = current === from.hash;
const iconSizeWithMargins = (5 + (isOutgoing ? 4 : 2) + 3) * 4;

return (
<Flex className={ className } alignItems="center">
<Entity
address={ from }
isLoading={ isLoading }
noLink={ current === from.hash }
noCopy={ current === from.hash }
noLink={ isOutgoing }
noCopy={ isOutgoing }
noIcon={ noIcon }
tokenHash={ tokenHash }
truncation={ truncation }
maxW={ truncation === 'constant' ? undefined : 'calc(50% - 20px)' }
mr={ current === from.hash ? 4 : 2 }
maxW={ truncation === 'constant' ? undefined : `calc(50% - ${ iconSizeWithMargins / 2 }px)` }
mr={ isOutgoing ? 4 : 2 }
/>
<AddressFromToIcon
isLoading={ isLoading }
Expand All @@ -101,7 +104,7 @@ const AddressFromTo = ({ from, to, current, mode: modeProp, className, isLoading
noIcon={ noIcon }
tokenHash={ tokenHash }
truncation={ truncation }
maxW={ truncation === 'constant' ? undefined : 'calc(50% - 20px)' }
maxW={ truncation === 'constant' ? undefined : `calc(50% - ${ iconSizeWithMargins / 2 }px)` }
ml={ 3 }
/>
) : <span>-</span> }
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ba685cf

Please sign in to comment.