mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
add scroll function to jump to the top of screen (#11386)
* add scroll function to jump to the top of screen * moved the scroll function from transaction-list.js to asset.js
This commit is contained in:
parent
4ba565e719
commit
9e86a03afa
@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { Redirect, useParams } from 'react-router-dom';
|
||||
import { getTokens } from '../../ducks/metamask/metamask';
|
||||
@ -14,6 +14,11 @@ const Asset = () => {
|
||||
|
||||
const token = tokens.find(({ address }) => address === asset);
|
||||
|
||||
useEffect(() => {
|
||||
const el = document.querySelector('.app');
|
||||
el.scroll(0, 0);
|
||||
}, []);
|
||||
|
||||
let content;
|
||||
if (token) {
|
||||
content = <TokenAsset token={token} />;
|
||||
|
Loading…
Reference in New Issue
Block a user