Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ObjectDetailsPage } from "./pages/ObjectDetails";
import { NotFoundPage } from "./pages/NotFound";
import { TableDetailsPage } from "./pages/TableDetails";
import { CrossmatchResultsPage } from "./pages/CrossmatchResults";
import { RecordsPage } from "./pages/Records";
import { RecordCrossmatchDetailsPage } from "./pages/RecordCrossmatchDetails";
import { TablesPage } from "./pages/Tables";
import { Layout } from "./components/ui/Layout";
Expand Down Expand Up @@ -37,6 +38,7 @@ function App() {
<Route path="/table/:tableName" element={<TableDetailsPage />} />
<Route path="/tables" element={<TablesPage />} />
<Route path="/crossmatch" element={<CrossmatchResultsPage />} />
<Route path="/records" element={<RecordsPage />} />
<Route
path="/records/:recordId/crossmatch"
element={
Expand Down
1 change: 1 addition & 0 deletions src/assets/texts.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"crossmatch.status.new": "New",
"crossmatch.status.collided": "Collided",
"crossmatch.status.existing": "Existing",
"crossmatch.triage.unprocessed": "Unprocessed",
"crossmatch.triage.pending": "Pending",
"crossmatch.triage.resolved": "Resolved"
}
Expand Down
31 changes: 28 additions & 3 deletions src/components/core/Hint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,49 @@ import { Tooltip } from "flowbite-react";
import { ReactElement, ReactNode } from "react";
import { MdHelpOutline } from "react-icons/md";

export type HintPosition = "top" | "left" | "right" | "bottom";

interface HintProps {
children: ReactElement;
hintContent: ReactNode;
position?: HintPosition;
className?: string;
trigger?: "icon" | "child";
}

const tooltipClassName = "bg-gray-600 z-10 border-1 max-w-xl";
const tooltipTheme = { hidden: "invisible opacity-0 pointer-events-none" };

export function Hint(props: HintProps): ReactElement {
const placement = props.position ?? "top";
const trigger = props.trigger ?? "icon";

if (trigger === "child") {
return (
<Tooltip
content={props.hintContent}
arrow={false}
placement={placement}
className={tooltipClassName}
theme={tooltipTheme}
>
{props.children}
</Tooltip>
);
}

return (
<div
className={`flex items-center justify-center gap-2 ${props.className}`}
className={`flex items-center justify-center gap-2 ${props.className ?? ""}`}
>
<div>{props.children}</div>
<div>
<Tooltip
content={props.hintContent}
arrow={false}
placement="top"
className="bg-gray-600 z-10 backdrop-blur-sm bg-opacity-99 border-1 max-w-xl"
placement={placement}
className={tooltipClassName}
theme={tooltipTheme}
>
<MdHelpOutline />
</Tooltip>
Expand Down
13 changes: 6 additions & 7 deletions src/components/ui/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState } from "react";
import { NavLink } from "react-router-dom";
import { Tooltip } from "flowbite-react";
import { MdInfo, MdSearch, MdTableChart } from "react-icons/md";
import { Hint } from "../core/Hint";
import { Link } from "../core/Link";

const navItems = [
Expand Down Expand Up @@ -34,12 +34,11 @@ export function Navbar() {
<>
<nav className="fixed left-0 top-0 h-screen w-12 flex flex-col items-center pt-4 pb-4 gap-2 bg-[#1a1a1a] z-20">
{navItems.map((item) => (
<Tooltip
<Hint
key={item.to}
content={item.label}
placement="right"
arrow={false}
className="bg-gray-600 z-10 backdrop-blur-sm bg-opacity-99 border-1"
hintContent={item.label}
position="right"
trigger="child"
>
<NavLink
to={item.to}
Expand All @@ -54,7 +53,7 @@ export function Navbar() {
>
{item.icon}
</NavLink>
</Tooltip>
</Hint>
))}

<div className="mt-auto">
Expand Down
Loading