Skip to content

Commit

Permalink
fix: add tooltip to chain buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Sep 26, 2022
1 parent 2c93c17 commit 0fd9626
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 28 deletions.
30 changes: 19 additions & 11 deletions packages/widget/src/components/ChainSelect/ChainSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/no-array-index-key */
import type { EVMChain } from '@lifi/sdk';
import { Avatar, Box, Skeleton, Typography } from '@mui/material';
import { Avatar, Box, Skeleton, Tooltip, Typography } from '@mui/material';
import { useWatch } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
import type { SwapFormTypeProps } from '../../providers';
Expand Down Expand Up @@ -39,19 +39,27 @@ export const ChainSelect = ({ formType }: SwapFormTypeProps) => {
/>
))
: getChains().map((chain: EVMChain) => (
<ChainCard
<Tooltip
key={chain.id}
onClick={() => setCurrentChain(chain.id)}
variant={chainId === chain.id ? 'selected' : 'default'}
title={chain.name}
placement="top"
enterDelay={500}
enterNextDelay={500}
arrow
>
<Avatar
src={chain.logoURI}
alt={chain.key}
sx={{ width: 40, height: 40 }}
<ChainCard
onClick={() => setCurrentChain(chain.id)}
variant={chainId === chain.id ? 'selected' : 'default'}
>
{chain.name[0]}
</Avatar>
</ChainCard>
<Avatar
src={chain.logoURI}
alt={chain.key}
sx={{ width: 40, height: 40 }}
>
{chain.name[0]}
</Avatar>
</ChainCard>
</Tooltip>
))}
{chainsToHide > 0 ? (
<ChainCard onClick={showAllChains}>
Expand Down
17 changes: 0 additions & 17 deletions packages/widget/src/components/SwapButton/ButtonTooltip.tsx

This file was deleted.

0 comments on commit 0fd9626

Please sign in to comment.