Skip to content

Commit 69c3f35

Browse files
committed
add tooltip
1 parent cded671 commit 69c3f35

2 files changed

Lines changed: 20 additions & 15 deletions

File tree

src/App.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ function App() {
4444
path="/table/:tableName"
4545
element={
4646
<Layout>
47-
<SearchBar />
4847
<TableDetailsPage />
4948
</Layout>
5049
}
@@ -53,7 +52,6 @@ function App() {
5352
path="/tables"
5453
element={
5554
<Layout>
56-
<SearchBar />
5755
<TablesPage />
5856
</Layout>
5957
}

src/components/ui/Navbar.tsx

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { NavLink } from "react-router-dom";
2+
import { Tooltip } from "flowbite-react";
23
import { MdSearch, MdTableChart } from "react-icons/md";
34

45
const navItems = [
@@ -10,21 +11,27 @@ export function Navbar() {
1011
return (
1112
<nav className="fixed left-0 top-0 h-screen w-12 flex flex-col items-center pt-4 gap-2 bg-[#1a1a1a] z-20">
1213
{navItems.map((item) => (
13-
<NavLink
14+
<Tooltip
1415
key={item.to}
15-
to={item.to}
16-
end
17-
title={item.label}
18-
className={({ isActive }) =>
19-
`w-9 h-9 flex items-center justify-center rounded-md transition-colors duration-200 ${
20-
isActive
21-
? "bg-green-600 text-white"
22-
: "text-neutral-400 hover:bg-neutral-700 hover:text-white"
23-
}`
24-
}
16+
content={item.label}
17+
placement="right"
18+
arrow={false}
19+
className="bg-gray-600 z-10 backdrop-blur-sm bg-opacity-99 border-1"
2520
>
26-
{item.icon}
27-
</NavLink>
21+
<NavLink
22+
to={item.to}
23+
end
24+
className={({ isActive }) =>
25+
`w-9 h-9 flex items-center justify-center rounded-lg transition-colors duration-300 ${
26+
isActive
27+
? "bg-[#646cff] text-white"
28+
: "text-neutral-400 hover:bg-neutral-700 hover:text-white"
29+
}`
30+
}
31+
>
32+
{item.icon}
33+
</NavLink>
34+
</Tooltip>
2835
))}
2936
</nav>
3037
);

0 commit comments

Comments
 (0)