Skip to content

Commit

Permalink
feat: add Tooltip component and integrate into moon-react; enhance Et…
Browse files Browse the repository at this point in the history
…hereumNetwork provider logic and add transaction status watcher
  • Loading branch information
ewhal committed Nov 20, 2024
1 parent 70c163f commit 0d90cb3
Show file tree
Hide file tree
Showing 8 changed files with 561 additions and 232 deletions.
3 changes: 3 additions & 0 deletions packages/moon-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-toast": "^1.2.2",
"@radix-ui/react-tooltip": "^1.1.4",
"@rainbow-me/rainbowkit": "^2.1.7",
"@simplewebauthn/browser": "^10.0.0",
"@supabase/auth-js": "^2.65.0",
Expand All @@ -97,6 +98,7 @@
"lucide-react": "^0.452.0",
"mipd": "^0.0.7",
"p-queue": "^8.0.1",
"react-copy-to-clipboard": "^5.1.0",
"react-icons": "^5.3.0",
"react-modal": "^3.16.1",
"react-query": "^3.39.3",
Expand Down Expand Up @@ -131,6 +133,7 @@
"@testing-library/react": "^16.0.1",
"@tsconfig/vite-react": "^3.0.2",
"@types/react": "^18.3.11",
"@types/react-copy-to-clipboard": "^5.0.7",
"@types/react-dom": "^18.3.0",
"@types/react-modal": "^3.16.3",
"@types/uuid": "^10.0.0",
Expand Down
18 changes: 18 additions & 0 deletions packages/moon-react/src/components/Core/ToolTip/ToolTip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// components/Tooltip.tsx
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
import React from "react";

interface TooltipProps {
content: React.ReactNode;
children: React.ReactNode;
}

export const Tooltip: React.FC<TooltipProps> = ({ content, children }) => (
<TooltipPrimitive.Root>
<TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>
<TooltipPrimitive.Content className="data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade px-2 py-1 rounded-md bg-black text-white shadow-md">
<TooltipPrimitive.Arrow className="fill-current text-black" />
{content}
</TooltipPrimitive.Content>
</TooltipPrimitive.Root>
);
1 change: 1 addition & 0 deletions packages/moon-react/src/components/Core/ToolTip/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./ToolTip";
10 changes: 6 additions & 4 deletions packages/moon-react/src/components/Core/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export * from './Button';
export * from './Input';
export * from './Modal';
export * from "./Button";
export * from "./Input";
export * from "./Modal";

export * from './Dropdown';
export * from "./Dropdown";

export * from "./ToolTip";
Loading

0 comments on commit 0d90cb3

Please sign in to comment.