Commit 2bcb3755 authored by Max Alekseenko's avatar Max Alekseenko

fix tooltip of security score button

parent 50d50376
...@@ -2,6 +2,7 @@ import { Button, Spinner, Tooltip, useColorModeValue, chakra } from '@chakra-ui/ ...@@ -2,6 +2,7 @@ import { Button, Spinner, Tooltip, useColorModeValue, chakra } from '@chakra-ui/
import React from 'react'; import React from 'react';
import useIsMobile from 'lib/hooks/useIsMobile'; import useIsMobile from 'lib/hooks/useIsMobile';
import usePreventFocusAfterModalClosing from 'lib/hooks/usePreventFocusAfterModalClosing';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
import useScoreLevelAndColor from './useScoreLevelAndColor'; import useScoreLevelAndColor from './useScoreLevelAndColor';
...@@ -23,6 +24,7 @@ const SolidityscanReportButton = ( ...@@ -23,6 +24,7 @@ const SolidityscanReportButton = (
const { scoreColor } = useScoreLevelAndColor(score); const { scoreColor } = useScoreLevelAndColor(score);
const colorLoading = useColorModeValue('gray.300', 'gray.600'); const colorLoading = useColorModeValue('gray.300', 'gray.600');
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const onFocusCapture = usePreventFocusAfterModalClosing();
return ( return (
<Tooltip label={ label } isDisabled={ isMobile } openDelay={ 100 } textAlign="center"> <Tooltip label={ label } isDisabled={ isMobile } openDelay={ 100 } textAlign="center">
...@@ -47,6 +49,7 @@ const SolidityscanReportButton = ( ...@@ -47,6 +49,7 @@ const SolidityscanReportButton = (
color: colorLoading, color: colorLoading,
}, },
}} }}
onFocusCapture={ onFocusCapture }
> >
<IconSvg name={ score < 80 ? 'score/score-not-ok' : 'score/score-ok' } boxSize={ 5 }/> <IconSvg name={ score < 80 ? 'score/score-not-ok' : 'score/score-ok' } boxSize={ 5 }/>
{ isLoading && <Spinner size="sm"/> } { isLoading && <Spinner size="sm"/> }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment