-
Notifications
You must be signed in to change notification settings - Fork 481
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 #1805 from blockscout/fe-1784
Add tips to score, explorers, domains
- Loading branch information
Showing
4 changed files
with
93 additions
and
44 deletions.
There are no files selected for viewing
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,30 @@ | ||
import { Skeleton, Tooltip, chakra } from '@chakra-ui/react'; | ||
import React from 'react'; | ||
|
||
import useIsMobile from 'lib/hooks/useIsMobile'; | ||
|
||
type Props = { | ||
label: string; | ||
isLoading?: boolean; | ||
className?: string; | ||
children: React.ReactNode; | ||
} | ||
|
||
const PopoverTriggerTooltip = ({ label, isLoading, className, children }: Props, ref: React.ForwardedRef<HTMLDivElement>) => { | ||
const isMobile = useIsMobile(); | ||
return ( | ||
// tooltip need to be wrapped in div for proper popover positioning | ||
<Skeleton isLoaded={ !isLoading } borderRadius="base" ref={ ref } className={ className }> | ||
<Tooltip | ||
label={ label } | ||
isDisabled={ isMobile } | ||
// need a delay to avoid flickering when closing the popover | ||
openDelay={ 100 } | ||
> | ||
{ children } | ||
</Tooltip> | ||
</Skeleton> | ||
); | ||
}; | ||
|
||
export default chakra(React.forwardRef(PopoverTriggerTooltip)); |
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