[site/components][f]: tooltip props fix
This commit is contained in:
parent
1a13aed153
commit
9033ca0214
|
|
@ -48,7 +48,7 @@ const tooltipArrowStyle = ({ theme, x, y, side }) => ({
|
||||||
transform: "rotate(45deg)"
|
transform: "rotate(45deg)"
|
||||||
})
|
})
|
||||||
|
|
||||||
export const Tooltip = (props) => {
|
export const Tooltip = ({ absolutePath, render, ...props }) => {
|
||||||
const theme = 'light'; // temporarily hard-coded; light theme tbd in next PR
|
const theme = 'light'; // temporarily hard-coded; light theme tbd in next PR
|
||||||
|
|
||||||
const arrowRef = useRef(null);
|
const arrowRef = useRef(null);
|
||||||
|
|
@ -104,7 +104,7 @@ export const Tooltip = (props) => {
|
||||||
const fetchTooltipContent = async () => {
|
const fetchTooltipContent = async () => {
|
||||||
setTooltipContentLoaded(false);
|
setTooltipContentLoaded(false);
|
||||||
|
|
||||||
const response = await fetch(props.absolutePath);
|
const response = await fetch(absolutePath);
|
||||||
if (response.status !== 200) {
|
if (response.status !== 200) {
|
||||||
console.log(`Looks like there was a problem. Status Code: ${response.status}`)
|
console.log(`Looks like there was a problem. Status Code: ${response.status}`)
|
||||||
return
|
return
|
||||||
|
|
@ -124,7 +124,7 @@ export const Tooltip = (props) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
{ props.render(tooltipTriggerProps) }
|
{ render(tooltipTriggerProps) }
|
||||||
<FloatingPortal>
|
<FloatingPortal>
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
{ showTooltip && tooltipContentLoaded &&
|
{ showTooltip && tooltipContentLoaded &&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue