Skip to content

Commit

Permalink
update Tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfantaholic committed Mar 19, 2024
1 parent 9c57f9d commit 4e03090
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@real-wagmi/uikit",
"version": "1.2.25",
"version": "1.2.26",
"description": "",
"main": "dist/index.cjs",
"module": "dist/index.js",
Expand Down
8 changes: 4 additions & 4 deletions src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { useEffect, useRef, useState, memo } from "react";
import { usePopper } from "react-popper";
import * as PopperJS from "@popperjs/core";
import { Options } from '@popperjs/core';
import { Box, Flex } from "../Box";
import { Portal } from "@reach/portal";
import { ITooltipProps } from "./types";
import { Arrow, TooltipContainer } from "./styles";

function Tooltip({ content, children }: ITooltipProps) {
function Tooltip({ content, children, placement = 'auto' }: ITooltipProps) {
const activatorElement = useRef<HTMLDivElement>(null);
const popperElement = useRef<HTMLDivElement>(null);
const arrowElement = useRef<HTMLDivElement>(null);
const [show, setShow] = useState(false);

const options: PopperJS.Options = {
placement: "auto",
const options: Options = {
placement,
strategy: "fixed",
modifiers: [
{ name: "offset", options: { offset: [2, 8] } },
Expand Down
2 changes: 2 additions & 0 deletions src/components/Tooltip/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Placement } from "@popperjs/core";
import { ReactNode } from "react";

export interface ITooltipProps {
content: ReactNode;
children: ReactNode;
placement?: Placement;
}

0 comments on commit 4e03090

Please sign in to comment.