From ed64e847fc9a69333708c916e8122249043f21a4 Mon Sep 17 00:00:00 2001 From: hcsoylu Date: Wed, 17 May 2023 16:23:44 +0300 Subject: [PATCH] added tooltip --- public/vite.svg | 1 - src/components/BarChart.tsx | 8 +++++--- src/components/Tooltip.tsx | 18 ++++++++++++++++++ src/routes/Root.tsx | 2 +- 4 files changed, 24 insertions(+), 5 deletions(-) delete mode 100644 public/vite.svg create mode 100644 src/components/Tooltip.tsx diff --git a/public/vite.svg b/public/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/components/BarChart.tsx b/src/components/BarChart.tsx index b6efdd7..01ea8ce 100644 --- a/src/components/BarChart.tsx +++ b/src/components/BarChart.tsx @@ -1,5 +1,6 @@ import ReactEcharts from "echarts-for-react" import { InfoIcon } from "../icons" +import Tooltip from "./Tooltip" const BarChart = () => { const data = [ @@ -58,10 +59,11 @@ const BarChart = () => { return (
-
+

Proposal

- - + + +
diff --git a/src/components/Tooltip.tsx b/src/components/Tooltip.tsx new file mode 100644 index 0000000..9a3ddb8 --- /dev/null +++ b/src/components/Tooltip.tsx @@ -0,0 +1,18 @@ +const Tooltip = ({ + text, + children, +}: { + text: string + children: React.ReactNode +}) => { + return ( +
+ {children} +
+
{text}
+
+
+ ) +} + +export default Tooltip diff --git a/src/routes/Root.tsx b/src/routes/Root.tsx index 0496034..dc79847 100644 --- a/src/routes/Root.tsx +++ b/src/routes/Root.tsx @@ -28,7 +28,7 @@ function Root() { logo