@@ -29,6 +29,7 @@ import { showTransactionDetails, showErrorMessage } from 'services/remote'
2929
3030import { localNumberFormatter , shannonToCKBFormatter , uniformTimeFormatter as timeFormatter } from 'utils/formatters'
3131import { PAGE_SIZE , Routes , CONFIRMATION_THRESHOLD } from 'utils/const'
32+ import { backToTop } from 'utils/animations'
3233
3334const TITLE_FONT_SIZE = 'xxLarge'
3435export type ActivityItem = State . Transaction & { confirmations : string ; typeLabel : string }
@@ -68,7 +69,7 @@ const ActivityList = ({
6869 onRenderRow ?: IRenderFunction < IDetailsRowProps >
6970 [ index : string ] : any
7071} > ) => (
71- < Stack >
72+ < Stack verticalFill >
7273 < DetailsList
7374 isHeaderVisible = { false }
7475 layoutMode = { DetailsListLayoutMode . justified }
@@ -81,6 +82,8 @@ const ActivityList = ({
8182 } }
8283 styles = { {
8384 root : {
85+ overflow : 'auto' ,
86+ height : '100%' ,
8487 backgroundColor : 'transparent' ,
8588 } ,
8689 contentWrapper : {
@@ -121,6 +124,15 @@ const Overview = ({
121124 const blockchainInfoRef = useRef < HTMLDivElement > ( null )
122125 const minerInfoRef = useRef < HTMLDivElement > ( null )
123126
127+ useEffect ( ( ) => {
128+ if ( id ) {
129+ const activityListContainer = document . querySelector ( '.ms-DetailsList>div' ) as HTMLElement
130+ if ( activityListContainer ) {
131+ backToTop ( activityListContainer )
132+ }
133+ }
134+ } , [ id ] )
135+
124136 useEffect ( ( ) => {
125137 updateTransactionList ( {
126138 pageNo : 1 ,
@@ -281,10 +293,15 @@ const Overview = ({
281293 if ( item . blockNumber !== undefined ) {
282294 const confirmationCount = 1 + Math . max ( + syncedBlockNumber , + tipBlockNumber ) - + item . blockNumber
283295 typeLabel = genTypeLabel ( item . type , confirmationCount )
284- confirmations =
285- confirmationCount > 1
286- ? `(${ t ( 'overview.confirmations' , { confirmationCount : localNumberFormatter ( confirmationCount ) } ) } )`
287- : `(${ t ( 'overview.confirmation' , { confirmationCount : localNumberFormatter ( confirmationCount ) } ) } )`
296+ if ( confirmationCount === 1 ) {
297+ confirmations = `(${ t ( 'overview.confirmation' , {
298+ confirmationCount : localNumberFormatter ( confirmationCount ) ,
299+ } ) } )`
300+ } else if ( confirmationCount > 1 ) {
301+ confirmations = `(${ t ( 'overview.confirmations' , {
302+ confirmationCount : localNumberFormatter ( confirmationCount ) ,
303+ } ) } )`
304+ }
288305 }
289306 return {
290307 ...item ,
0 commit comments