-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #305 from yearn/feat/cleaning
Feat/cleaning
- Loading branch information
Showing
234 changed files
with
3,626 additions
and
12,006 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import {useEnsName} from 'wagmi'; | ||
import {cl} from '@yearn-finance/web-lib/utils/cl'; | ||
import {copyToClipboard} from '@yearn-finance/web-lib/utils/helpers'; | ||
|
||
import type {ReactElement} from 'react'; | ||
import type {TAddress} from '@yearn-finance/web-lib/types'; | ||
|
||
export function AddressLike({address}: {address: TAddress}): ReactElement { | ||
const {data: ensHandle, isSuccess} = useEnsName({address, chainId: 1}); | ||
const shouldDisplayTooltip = isSuccess && !!ensHandle; | ||
|
||
return ( | ||
<span | ||
suppressHydrationWarning | ||
className={cl(shouldDisplayTooltip ? 'tooltip underline decoration-neutral-600/30 decoration-dotted underline-offset-4 transition-opacity hover:decoration-neutral-600' : 'font-number')}> | ||
{shouldDisplayTooltip ? ( | ||
<span | ||
suppressHydrationWarning | ||
onClick={(): void => copyToClipboard(address)} | ||
className={'tooltipLight top-full cursor-copy pt-1'}> | ||
<div | ||
className={'font-number w-fit border border-neutral-300 bg-neutral-0 p-1 px-2 text-center text-xs text-neutral-900'}> | ||
{address} | ||
</div> | ||
</span> | ||
) : <span />} | ||
{shouldDisplayTooltip ? ensHandle : address} | ||
</span> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.