Commit ba685cfc authored by tom's avatar tom

trying to fix truncation

parent 36e863cd
...@@ -75,18 +75,21 @@ const AddressFromTo = ({ from, to, current, mode: modeProp, className, isLoading ...@@ -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 ( return (
<Flex className={ className } alignItems="center"> <Flex className={ className } alignItems="center">
<Entity <Entity
address={ from } address={ from }
isLoading={ isLoading } isLoading={ isLoading }
noLink={ current === from.hash } noLink={ isOutgoing }
noCopy={ current === from.hash } noCopy={ isOutgoing }
noIcon={ noIcon } noIcon={ noIcon }
tokenHash={ tokenHash } tokenHash={ tokenHash }
truncation={ truncation } truncation={ truncation }
maxW={ truncation === 'constant' ? undefined : 'calc(50% - 20px)' } maxW={ truncation === 'constant' ? undefined : `calc(50% - ${ iconSizeWithMargins / 2 }px)` }
mr={ current === from.hash ? 4 : 2 } mr={ isOutgoing ? 4 : 2 }
/> />
<AddressFromToIcon <AddressFromToIcon
isLoading={ isLoading } isLoading={ isLoading }
...@@ -101,7 +104,7 @@ const AddressFromTo = ({ from, to, current, mode: modeProp, className, isLoading ...@@ -101,7 +104,7 @@ const AddressFromTo = ({ from, to, current, mode: modeProp, className, isLoading
noIcon={ noIcon } noIcon={ noIcon }
tokenHash={ tokenHash } tokenHash={ tokenHash }
truncation={ truncation } truncation={ truncation }
maxW={ truncation === 'constant' ? undefined : 'calc(50% - 20px)' } maxW={ truncation === 'constant' ? undefined : `calc(50% - ${ iconSizeWithMargins / 2 }px)` }
ml={ 3 } ml={ 3 }
/> />
) : <span>-</span> } ) : <span>-</span> }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment