diff --git a/.changelog/567.feature.md b/.changelog/567.feature.md new file mode 100644 index 000000000..ae6926cc3 --- /dev/null +++ b/.changelog/567.feature.md @@ -0,0 +1 @@ +Implement scroll restore and scroll to the top of the page on navigate diff --git a/src/app/components/LoadMoreButton/index.tsx b/src/app/components/LoadMoreButton/index.tsx index 444723d55..a4f409388 100644 --- a/src/app/components/LoadMoreButton/index.tsx +++ b/src/app/components/LoadMoreButton/index.tsx @@ -20,7 +20,11 @@ export const LoadMoreButton: FC = ({ isLoading, pagination const { t } = useTranslation() return ( - + {t('common.loadMore')} diff --git a/src/app/components/Table/TablePagination.tsx b/src/app/components/Table/TablePagination.tsx index b74a5731d..ce014c48f 100644 --- a/src/app/components/Table/TablePagination.tsx +++ b/src/app/components/Table/TablePagination.tsx @@ -39,6 +39,7 @@ export const TablePagination: FC = ({ }} component={Link} to={item.page == null ? '' : linkToPage(item.page)} + preventScrollReset={true} {...item} sx={isTotalCountClipped && item.type === 'last' ? { pointerEvents: 'none', cursor: 'default' } : {}} /> diff --git a/src/routes.tsx b/src/routes.tsx index 65875af99..3ed25d45d 100644 --- a/src/routes.tsx +++ b/src/routes.tsx @@ -1,4 +1,4 @@ -import { Outlet, RouteObject } from 'react-router-dom' +import { Outlet, RouteObject, ScrollRestoration } from 'react-router-dom' import { HomePage } from './app/pages/HomePage' import { BlocksPage } from './app/pages/BlocksPage' import { TransactionsPage } from './app/pages/TransactionsPage' @@ -30,6 +30,12 @@ const NetworkSpecificPart = () => ( export const routes: RouteObject[] = [ { errorElement: withDefaultTheme(), + element: ( + <> + + + + ), children: [ { path: '/',