Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: open address in a new tab #2308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/components/list-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ const Chain = styled.span`
`

export const ListItem = memo(function ListItem({ token }) {
const scanner = lookupScanner(token.chainId);
const tokenAddress = toChecksumAddress(token.address);
const scannerUrl = scanner == "" ? "" : scanner + tokenAddress;
const scanner = lookupScanner(token.chainId)
const tokenAddress = toChecksumAddress(token.address)
const scannerUrl = scanner == '' ? '' : scanner + tokenAddress
return (
<TokenItem>
<TokenInfo>
Expand Down Expand Up @@ -127,7 +127,7 @@ export const ListItem = memo(function ListItem({ token }) {
)}
</TokenTagWrapper>
<TokenAddress>
<a style={{ textAlign: 'right' }} href={scannerUrl}>
<a style={{ textAlign: 'right' }} href={scannerUrl} target="_blank" rel="noopener noreferrer">
{`${tokenAddress?.slice(0, 6)}...${tokenAddress?.slice(38, 42)}`}
</a>
<CopyHelper toCopy={token.address} />
Expand Down Expand Up @@ -182,9 +182,8 @@ const ListHeader = styled.div`

export default function Tokens({ tokens }) {
const [value, setValue] = useState('')
const sortedTokens = tokens.sort((a,b) =>{
return a.symbol > b.symbol ? 1 :
a.symbol < b.symbol ? -1 : 0;
const sortedTokens = tokens.sort((a, b) => {
return a.symbol > b.symbol ? 1 : a.symbol < b.symbol ? -1 : 0
})

function handleChange(e) {
Expand Down