forked from nervosnetwork/ckb-explorer-frontend
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/magickbase/ckb-explorer-…
…frontend into develop
- Loading branch information
Showing
25 changed files
with
373 additions
and
74 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,11 @@ | ||
.tooltip { | ||
a { | ||
color: var(--primary-color); | ||
} | ||
} | ||
|
||
.icon { | ||
width: 15px; | ||
height: 15px; | ||
margin: 0 5px; | ||
} |
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,29 @@ | ||
import { ComponentProps, FC, RefObject } from 'react' | ||
import { Tooltip, TooltipProps } from 'antd' | ||
import classNames from 'classnames' | ||
import HelpIcon from '../../assets/qa_help.png' | ||
import styles from './index.module.scss' | ||
import { useIsMobile } from '../../utils/hook' | ||
|
||
export const HelpTip: FC< | ||
TooltipProps & { | ||
iconProps?: ComponentProps<'img'> | ||
// Setting a container ref can avoid scrolling together with deeper scrolling containers. | ||
containerRef?: RefObject<HTMLDivElement> | ||
} | ||
> = ({ iconProps, containerRef, ...props }) => { | ||
const isMobile = useIsMobile() | ||
|
||
const finalProps: TooltipProps = { | ||
placement: isMobile ? 'topLeft' : 'top', | ||
getPopupContainer: () => containerRef?.current ?? document.body, | ||
arrowPointAtCenter: true, | ||
...props, | ||
} | ||
|
||
return ( | ||
<Tooltip {...finalProps} overlayClassName={classNames(styles.tooltip, finalProps.className)}> | ||
<img src={HelpIcon} alt="help icon" {...iconProps} className={classNames(styles.icon, iconProps?.className)} /> | ||
</Tooltip> | ||
) | ||
} |
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
4 changes: 4 additions & 0 deletions
4
src/components/Tooltip/ComparedToMaxTooltip/styles.module.scss
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
Oops, something went wrong.