@@ -158,7 +158,7 @@ const KDABlockRewards = ({ query }: Props) => {
158158 const handleBurntFeesValuesMouseLeave = useCallback ( ( ) => onMouseLeaveValues ( burntFeesValuesRef ) , [ onMouseLeaveValues ] ) ;
159159
160160 if ( isLoading ) {
161- return < Skeleton loading = { isLoading } minH = " 140px" maxW = "380px" w = "100%" /> ;
161+ return < Skeleton loading = { isLoading } minH = { hasTxFees && hasBurntFees ? ' 140px' : '24px' } maxW = "380px" w = "100%" /> ;
162162 }
163163
164164 if ( ! calculatedValues ) {
@@ -170,110 +170,118 @@ const KDABlockRewards = ({ query }: Props) => {
170170 < chakra . span fontFamily = "var(--kda-typography-family-monospace-font)" >
171171 { rewardAmount } { currencyUnits . ether }
172172 </ chakra . span >
173- < chakra . div >
174- < Text color = "text.primary" fontWeight = "bold" fontSize = "sm" display = "inline" >
175- Breakdown{ space }
176- </ Text >
177- < chakra . div display = { { base : 'none' , md : 'flex' } } flexDirection = "row" gap = { 2 } alignItems = "center" mt = { 3 } >
178- < KDABreakdownItem
179- ref = { blockRewardValuesRef }
180- isLoading = { isLoading }
181- onMouseEnter = { handleBlockRewardMouseEnter }
182- onMouseLeave = { handleBlockRewardMouseLeave } >
183- < Text color = "text.primary" fontSize = "sm" display = "inline" fontFamily = "var(--global-font-body, var(--font-fallback))" >
184- < chakra . span whiteSpace = "nowrap" >
185- < Hint label = "PoW mining reward" />
186- Mining reward
187- </ chakra . span >
188- </ Text >
189- </ KDABreakdownItem >
190- +
191- < KDABreakdownItem
192- ref = { txFeesValuesRef }
193- isLoading = { isLoading }
194- onMouseEnter = { handleTxFeesMouseEnter }
195- onMouseLeave = { handleTxFeesMouseLeave } >
196- < Text color = "text.primary" fontSize = "sm" display = "inline" fontFamily = "var(--global-font-body, var(--font-fallback))" >
197- < chakra . span whiteSpace = "nowrap" >
198- < Hint label = "Total transaction fees collected from all transactions in the block" />
199- Transaction fees
200- </ chakra . span >
201- </ Text >
202- </ KDABreakdownItem >
203- -
204- < KDABreakdownItem
205- ref = { burntFeesValuesRef }
206- isLoading = { isLoading }
207- onMouseEnter = { handleBurntFeesMouseEnter }
208- onMouseLeave = { handleBurntFeesMouseLeave } >
209- < Text color = "text.primary" fontSize = "sm" display = "inline" fontFamily = "var(--global-font-body, var(--font-fallback))" >
210- < chakra . span whiteSpace = "nowrap" >
211- < Hint label = "Base fees burned (EIP-1559 mechanism)" />
212- Burnt fees
213- </ chakra . span >
214- </ Text >
215- </ KDABreakdownItem >
216- </ chakra . div >
217- < RawDataSnippet
218- data = { (
219- < Text
220- display = "flex"
221- flexDirection = { { base : 'column' , md : 'row' } }
222- color = "text.secondary"
223- fontSize = "sm"
224- whiteSpace = "nowrap"
225- gap = { 1 }
226- fontFamily = "var(--kda-typography-family-monospace-font)" >
227- { hasRewardBaseFee && (
228- < Tooltip content = "Block reward" >
229- < BreakdownLabel
230- ref = { blockRewardLabelRef }
231- onMouseEnterValues = { handleBlockRewardValuesMouseEnter }
232- onMouseLeaveValues = { handleBlockRewardValuesMouseLeave }
233- >
234- < chakra . span display = { { base : '' , md : 'none' } } fontFamily = "var(--global-font-body, var(--font-fallback))" >
235- Reward fee:
236- </ chakra . span >
237- < span > { rewardBaseFee } </ span >
238- </ BreakdownLabel >
239- </ Tooltip >
240- )
241- }
242- { space } +{ space }
243- { hasTxFees && (
244- < Tooltip content = "Total transaction fees" >
245- < BreakdownLabel
246- ref = { txFeesLabelRef }
247- onMouseEnterValues = { handleTxFeesValuesMouseEnter }
248- onMouseLeaveValues = { handleTxFeesValuesMouseLeave }
249- >
250- < chakra . span display = { { base : '' , md : 'none' } } fontFamily = "var(--global-font-body, var(--font-fallback))" >
251- Transaction fees:
252- </ chakra . span >
253- < span > { txFees } </ span >
254- </ BreakdownLabel >
255- </ Tooltip >
256- ) }
257- { space } -{ space }
258- { hasBurntFees && (
259- < Tooltip content = "Burnt fees" >
260- < BreakdownLabel
261- ref = { burntFeesLabelRef }
262- onMouseEnterValues = { handleBurntFeesValuesMouseEnter }
263- onMouseLeaveValues = { handleBurntFeesValuesMouseLeave }
264- >
265- < chakra . span display = { { base : '' , md : 'none' } } fontFamily = "var(--global-font-body, var(--font-fallback))" >
266- Burnt fees:{ ' ' }
267- </ chakra . span >
268- < span > { burntFees } </ span >
269- </ BreakdownLabel >
270- </ Tooltip >
173+ { hasTxFees && hasBurntFees && (
174+ < chakra . div >
175+ < Text color = "text.primary" fontWeight = "bold" fontSize = "sm" display = "inline" >
176+ Breakdown{ space }
177+ </ Text >
178+ < chakra . div display = { { base : 'none' , md : 'flex' } } flexDirection = "row" gap = { 2 } alignItems = "center" mt = { 3 } >
179+ < KDABreakdownItem
180+ ref = { blockRewardValuesRef }
181+ isLoading = { isLoading }
182+ onMouseEnter = { handleBlockRewardMouseEnter }
183+ onMouseLeave = { handleBlockRewardMouseLeave } >
184+ < Text color = "text.primary" fontSize = "sm" display = "inline" fontFamily = "var(--global-font-body, var(--font-fallback))" >
185+ < chakra . span whiteSpace = "nowrap" >
186+ < Hint label = "PoW mining reward" />
187+ Mining reward
188+ </ chakra . span >
189+ </ Text >
190+ </ KDABreakdownItem >
191+ +
192+ < KDABreakdownItem
193+ ref = { txFeesValuesRef }
194+ isLoading = { isLoading }
195+ onMouseEnter = { handleTxFeesMouseEnter }
196+ onMouseLeave = { handleTxFeesMouseLeave } >
197+ < Text color = "text.primary" fontSize = "sm" display = "inline" fontFamily = "var(--global-font-body, var(--font-fallback))" >
198+ < chakra . span whiteSpace = "nowrap" >
199+ < Hint label = "Total transaction fees collected from all transactions in the block" />
200+ Transaction fees
201+ </ chakra . span >
202+ </ Text >
203+ </ KDABreakdownItem >
204+ -
205+ < KDABreakdownItem
206+ ref = { burntFeesValuesRef }
207+ isLoading = { isLoading }
208+ onMouseEnter = { handleBurntFeesMouseEnter }
209+ onMouseLeave = { handleBurntFeesMouseLeave } >
210+ < Text color = "text.primary" fontSize = "sm" display = "inline" fontFamily = "var(--global-font-body, var(--font-fallback))" >
211+ < chakra . span whiteSpace = "nowrap" >
212+ < Hint label = "Base fees burned (EIP-1559 mechanism)" />
213+ Burnt fees
214+ </ chakra . span >
215+ </ Text >
216+ </ KDABreakdownItem >
217+ </ chakra . div >
218+ { hasTxFees && hasBurntFees && (
219+ < RawDataSnippet
220+ data = { (
221+ < Text
222+ display = "flex"
223+ flexDirection = { { base : 'column' , md : 'row' } }
224+ color = "text.secondary"
225+ fontSize = "sm"
226+ whiteSpace = "nowrap"
227+ gap = { 1 }
228+ fontFamily = "var(--kda-typography-family-monospace-font)" >
229+ { hasRewardBaseFee && (
230+ < Tooltip content = "Block reward" >
231+ < BreakdownLabel
232+ ref = { blockRewardLabelRef }
233+ onMouseEnterValues = { handleBlockRewardValuesMouseEnter }
234+ onMouseLeaveValues = { handleBlockRewardValuesMouseLeave }
235+ >
236+ < chakra . span display = { { base : '' , md : 'none' } } fontFamily = "var(--global-font-body, var(--font-fallback))" >
237+ Reward fee:
238+ </ chakra . span >
239+ < span > { rewardBaseFee } </ span >
240+ </ BreakdownLabel >
241+ </ Tooltip >
242+ )
243+ }
244+ { hasTxFees && (
245+ < >
246+ { space } +{ space }
247+ < Tooltip content = "Total transaction fees" >
248+ < BreakdownLabel
249+ ref = { txFeesLabelRef }
250+ onMouseEnterValues = { handleTxFeesValuesMouseEnter }
251+ onMouseLeaveValues = { handleTxFeesValuesMouseLeave }
252+ >
253+ < chakra . span display = { { base : '' , md : 'none' } } fontFamily = "var(--global-font-body, var(--font-fallback))" >
254+ Transaction fees:
255+ </ chakra . span >
256+ < span > { txFees } </ span >
257+ </ BreakdownLabel >
258+ </ Tooltip >
259+ </ >
260+ ) }
261+ { hasBurntFees && (
262+ < >
263+ { space } -{ space }
264+ < Tooltip content = "Burnt fees" >
265+ < BreakdownLabel
266+ ref = { burntFeesLabelRef }
267+ onMouseEnterValues = { handleBurntFeesValuesMouseEnter }
268+ onMouseLeaveValues = { handleBurntFeesValuesMouseLeave }
269+ >
270+ < chakra . span display = { { base : '' , md : 'none' } } fontFamily = "var(--global-font-body, var(--font-fallback))" >
271+ Burnt fees:{ ' ' }
272+ </ chakra . span >
273+ < span > { burntFees } </ span >
274+ </ BreakdownLabel >
275+ </ Tooltip >
276+ </ >
277+ ) }
278+ </ Text >
271279 ) }
272- </ Text >
280+ isLoading = { isLoading }
281+ />
273282 ) }
274- isLoading = { isLoading }
275- />
276- </ chakra . div >
283+ </ chakra . div >
284+ ) }
277285 </ chakra . div >
278286 ) ;
279287} ;
0 commit comments