@@ -3,7 +3,7 @@ import BN from 'bn.js'
33
44// Assets
55import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
6- import { faClock , faPlus , faMinus } from '@fortawesome/free-solid-svg-icons'
6+ import { faClock , faPlus , faMinus , faBaby } from '@fortawesome/free-solid-svg-icons'
77import { MinusSVG , PlusSVG } from 'assets/img/SVG'
88
99// const, utils, types
@@ -24,6 +24,7 @@ import { TokenRow, RowClaimButton, RowClaimSpan } from 'components/DepositWidget
2424import useNoScroll from 'hooks/useNoScroll'
2525import { TokenLocalState } from 'reducers-actions'
2626import { TokenSymbol } from 'components/TokenSymbol'
27+ import { HelpTooltip , HelpTooltipContainer } from 'components/Tooltip'
2728
2829export interface RowProps extends Record < keyof TokenLocalState , boolean > {
2930 ethBalance : BN | null
@@ -37,6 +38,12 @@ export interface RowProps extends Record<keyof TokenLocalState, boolean> {
3738}
3839
3940const spinner = < Spinner style = { { marginRight : 7 } } />
41+ const ImmatureClaimTooltip : React . FC < { displayName : string } > = ( { displayName } ) => (
42+ < HelpTooltipContainer >
43+ You cannot withdraw in this batch because you received { displayName } in the previous batch and the protocol requires
44+ one additional batch for settling the received tokens. Wait for the next batch (max 5 min) and try again.
45+ </ HelpTooltipContainer >
46+ )
4047
4148export const Row : React . FC < RowProps > = ( props : RowProps ) => {
4249 const {
@@ -53,6 +60,7 @@ export const Row: React.FC<RowProps> = (props: RowProps) => {
5360 claiming,
5461 withdrawing,
5562 depositing,
63+ immatureClaim : isImmatureClaim ,
5664 } = props
5765
5866 const {
@@ -72,10 +80,11 @@ export const Row: React.FC<RowProps> = (props: RowProps) => {
7280 } = tokenBalances
7381
7482 const [ visibleForm , showForm ] = useState < 'deposit' | 'withdraw' | void > ( )
83+ // block background scrolling on open modals
84+ useNoScroll ( ! ! visibleForm )
7585
7686 // Checks innerWidth
7787 const showResponsive = ! ! innerWidth && innerWidth < MEDIA . MOBILE_LARGE_PX
78- useNoScroll ( ! ! visibleForm && showResponsive )
7988
8089 let className
8190 if ( highlighted ) {
@@ -116,7 +125,15 @@ export const Row: React.FC<RowProps> = (props: RowProps) => {
116125 < RowClaimButton className = "success" onClick = { onClaim } disabled = { claiming } >
117126 { ( claiming || withdrawing ) && spinner }
118127 { formatSmart ( pendingWithdraw . amount , decimals ) }
119- < RowClaimSpan className = { claiming || withdrawing ? 'disabled' : 'success' } > Claim</ RowClaimSpan >
128+ < div >
129+ < RowClaimSpan className = { claiming || withdrawing ? 'disabled' : 'success' } > Claim</ RowClaimSpan >
130+ { isImmatureClaim && (
131+ < span className = "immatureClaimTooltip" >
132+ < FontAwesomeIcon icon = { faBaby } />
133+ < HelpTooltip tooltip = { < ImmatureClaimTooltip displayName = { symbol || name || 'tokens' } /> } />
134+ </ span >
135+ ) }
136+ </ div >
120137 </ RowClaimButton >
121138 </ >
122139 ) : pendingWithdraw . amount . gt ( ZERO ) ? (
@@ -129,17 +146,24 @@ export const Row: React.FC<RowProps> = (props: RowProps) => {
129146 < > { withdrawing && spinner } 0</ >
130147 ) }
131148 </ td >
132- < td data-label = "Wallet" >
149+ < td
150+ data-label = "Wallet"
151+ title = { ( ! isWeth && formatAmountFull ( { amount : walletBalance , precision : decimals } ) ) || '' }
152+ >
133153 { isWeth ? (
134154 < ul >
135155 < li title = { ethBalance ? formatAmountFull ( { amount : ethBalance , precision : decimals } ) : undefined } >
136- { ethBalance ? formatSmart ( ethBalance , decimals ) : '-' } ETH{ ' ' }
156+ < span >
157+ { ethBalance ? formatSmart ( ethBalance , decimals ) : '-' } < span > ETH</ span >
158+ </ span > { ' ' }
137159 < WrapEtherBtn label = "Wrap" className = "wrapUnwrapEther" />
138160 </ li >
139161 < li title = { formatAmountFull ( { amount : walletBalance , precision : decimals } ) || undefined } >
140162 { ( claiming || depositing ) && spinner }
141- { formatSmart ( walletBalance , decimals ) + ' ' }
142- WETH < UnwrapEtherBtn label = "Unwrap" className = "wrapUnwrapEther" />
163+ < span >
164+ { formatSmart ( walletBalance , decimals ) } < span > WETH</ span >
165+ </ span > { ' ' }
166+ < UnwrapEtherBtn label = "Unwrap" className = "wrapUnwrapEther" />
143167 </ li >
144168 </ ul >
145169 ) : (
0 commit comments