From cded671010ecd072d1473691d02860caaeb263fb Mon Sep 17 00:00:00 2001 From: kraysent Date: Sun, 22 Feb 2026 15:32:01 +0000 Subject: [PATCH 1/9] add vertical navbar --- src/components/ui/Layout.tsx | 10 +++++++--- src/components/ui/Navbar.tsx | 31 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 src/components/ui/Navbar.tsx diff --git a/src/components/ui/Layout.tsx b/src/components/ui/Layout.tsx index 68e6b40..b75dad6 100644 --- a/src/components/ui/Layout.tsx +++ b/src/components/ui/Layout.tsx @@ -1,10 +1,14 @@ import { Footer } from "./Footer"; +import { Navbar } from "./Navbar"; export function Layout({ children }: { children: React.ReactNode }) { return ( -
-
{children}
-
+
+ +
+
{children}
+
+
); } diff --git a/src/components/ui/Navbar.tsx b/src/components/ui/Navbar.tsx new file mode 100644 index 0000000..00d5762 --- /dev/null +++ b/src/components/ui/Navbar.tsx @@ -0,0 +1,31 @@ +import { NavLink } from "react-router-dom"; +import { MdSearch, MdTableChart } from "react-icons/md"; + +const navItems = [ + { to: "/", icon: , label: "Object search" }, + { to: "/tables", icon: , label: "Tables" }, +]; + +export function Navbar() { + return ( + + ); +} From 69c3f354ffa060030cb3e615c1c42954bb1265fd Mon Sep 17 00:00:00 2001 From: kraysent Date: Sun, 22 Feb 2026 15:36:25 +0000 Subject: [PATCH 2/9] add tooltip --- src/App.tsx | 2 -- src/components/ui/Navbar.tsx | 33 ++++++++++++++++++++------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index af8d624..4ee27d6 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -44,7 +44,6 @@ function App() { path="/table/:tableName" element={ - } @@ -53,7 +52,6 @@ function App() { path="/tables" element={ - } diff --git a/src/components/ui/Navbar.tsx b/src/components/ui/Navbar.tsx index 00d5762..a45b1d3 100644 --- a/src/components/ui/Navbar.tsx +++ b/src/components/ui/Navbar.tsx @@ -1,4 +1,5 @@ import { NavLink } from "react-router-dom"; +import { Tooltip } from "flowbite-react"; import { MdSearch, MdTableChart } from "react-icons/md"; const navItems = [ @@ -10,21 +11,27 @@ export function Navbar() { return ( ); From 89639d33a0a06b705322f654b63f23c708d32d5b Mon Sep 17 00:00:00 2001 From: kraysent Date: Sun, 22 Feb 2026 15:37:50 +0000 Subject: [PATCH 3/9] move footer to navbar --- src/components/ui/Footer.tsx | 68 ------------------------- src/components/ui/Layout.tsx | 2 - src/components/ui/Navbar.tsx | 97 +++++++++++++++++++++++++++--------- 3 files changed, 73 insertions(+), 94 deletions(-) delete mode 100644 src/components/ui/Footer.tsx diff --git a/src/components/ui/Footer.tsx b/src/components/ui/Footer.tsx deleted file mode 100644 index 7deeabe..0000000 --- a/src/components/ui/Footer.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { useState } from "react"; -import { Link as ReactDomLink } from "react-router-dom"; -import { Button } from "./Button"; -import { Link } from "./Link"; -import { MdKeyboardArrowDown, MdKeyboardArrowUp } from "react-icons/md"; - -const footerContent = ( -
-
- Information:{" "} - - The next generation of the HyperLeda database - -
-
- Original version:{" "} - - OHP Mirror - -
-
-); - -export function Footer() { - const [isCollapsed, setIsCollapsed] = useState(true); - - function toggleCollapse() { - setIsCollapsed(!isCollapsed); - } - - return ( - <> - - -
-
-
-
- - HyperLeda Logo - - {footerContent} -
-
- -
-
- - ); -} diff --git a/src/components/ui/Layout.tsx b/src/components/ui/Layout.tsx index b75dad6..a8d08c8 100644 --- a/src/components/ui/Layout.tsx +++ b/src/components/ui/Layout.tsx @@ -1,4 +1,3 @@ -import { Footer } from "./Footer"; import { Navbar } from "./Navbar"; export function Layout({ children }: { children: React.ReactNode }) { @@ -7,7 +6,6 @@ export function Layout({ children }: { children: React.ReactNode }) {
{children}
-
); diff --git a/src/components/ui/Navbar.tsx b/src/components/ui/Navbar.tsx index a45b1d3..dda5ae3 100644 --- a/src/components/ui/Navbar.tsx +++ b/src/components/ui/Navbar.tsx @@ -1,6 +1,8 @@ +import { useState } from "react"; import { NavLink } from "react-router-dom"; import { Tooltip } from "flowbite-react"; -import { MdSearch, MdTableChart } from "react-icons/md"; +import { MdInfo, MdSearch, MdTableChart } from "react-icons/md"; +import { Link } from "./Link"; const navItems = [ { to: "/", icon: , label: "Object search" }, @@ -8,31 +10,78 @@ const navItems = [ ]; export function Navbar() { + const [footerOpen, setFooterOpen] = useState(false); + return ( - + +
+
+
+ Information:{" "} + + The next generation of the HyperLeda database + +
+
+ Original version:{" "} + + OHP Mirror + +
+
+
+ ); } From faa44219867b32c6ff4fac6b8ffef48587636d1e Mon Sep 17 00:00:00 2001 From: kraysent Date: Sun, 22 Feb 2026 15:41:18 +0000 Subject: [PATCH 4/9] move components without dependencies to core directory --- src/components/{ui => core}/Accordion.tsx | 0 src/components/{ui => core}/Aladin.tsx | 0 src/components/{ui => core}/Astronomy.tsx | 0 src/components/{ui => core}/Button.tsx | 0 src/components/{ui => core}/DropdownFilter.tsx | 0 src/components/{ui => core}/Hint.tsx | 0 src/components/{ui => core}/Link.tsx | 0 src/components/{ui => core}/Loading.tsx | 0 src/components/{ui => core}/TextFilter.tsx | 0 src/components/ui/Badge.tsx | 2 +- src/components/ui/CatalogData.tsx | 2 +- src/components/ui/CommonTable.tsx | 4 ++-- src/components/ui/CopyButton.tsx | 2 +- src/components/ui/ErrorPage.tsx | 2 +- src/components/ui/Navbar.tsx | 2 +- src/components/ui/Pagination.tsx | 2 +- src/components/ui/Searchbar.tsx | 2 +- src/pages/CrossmatchResults.tsx | 10 +++++----- src/pages/Home.tsx | 2 +- src/pages/NotFound.tsx | 2 +- src/pages/ObjectDetails.tsx | 6 +++--- src/pages/RecordCrossmatchDetails.tsx | 8 ++++---- src/pages/SearchResults.tsx | 6 +++--- src/pages/TableDetails.tsx | 6 +++--- src/pages/Tables.tsx | 8 ++++---- 25 files changed, 33 insertions(+), 33 deletions(-) rename src/components/{ui => core}/Accordion.tsx (100%) rename src/components/{ui => core}/Aladin.tsx (100%) rename src/components/{ui => core}/Astronomy.tsx (100%) rename src/components/{ui => core}/Button.tsx (100%) rename src/components/{ui => core}/DropdownFilter.tsx (100%) rename src/components/{ui => core}/Hint.tsx (100%) rename src/components/{ui => core}/Link.tsx (100%) rename src/components/{ui => core}/Loading.tsx (100%) rename src/components/{ui => core}/TextFilter.tsx (100%) diff --git a/src/components/ui/Accordion.tsx b/src/components/core/Accordion.tsx similarity index 100% rename from src/components/ui/Accordion.tsx rename to src/components/core/Accordion.tsx diff --git a/src/components/ui/Aladin.tsx b/src/components/core/Aladin.tsx similarity index 100% rename from src/components/ui/Aladin.tsx rename to src/components/core/Aladin.tsx diff --git a/src/components/ui/Astronomy.tsx b/src/components/core/Astronomy.tsx similarity index 100% rename from src/components/ui/Astronomy.tsx rename to src/components/core/Astronomy.tsx diff --git a/src/components/ui/Button.tsx b/src/components/core/Button.tsx similarity index 100% rename from src/components/ui/Button.tsx rename to src/components/core/Button.tsx diff --git a/src/components/ui/DropdownFilter.tsx b/src/components/core/DropdownFilter.tsx similarity index 100% rename from src/components/ui/DropdownFilter.tsx rename to src/components/core/DropdownFilter.tsx diff --git a/src/components/ui/Hint.tsx b/src/components/core/Hint.tsx similarity index 100% rename from src/components/ui/Hint.tsx rename to src/components/core/Hint.tsx diff --git a/src/components/ui/Link.tsx b/src/components/core/Link.tsx similarity index 100% rename from src/components/ui/Link.tsx rename to src/components/core/Link.tsx diff --git a/src/components/ui/Loading.tsx b/src/components/core/Loading.tsx similarity index 100% rename from src/components/ui/Loading.tsx rename to src/components/core/Loading.tsx diff --git a/src/components/ui/TextFilter.tsx b/src/components/core/TextFilter.tsx similarity index 100% rename from src/components/ui/TextFilter.tsx rename to src/components/core/TextFilter.tsx diff --git a/src/components/ui/Badge.tsx b/src/components/ui/Badge.tsx index 22d7343..7898ad9 100644 --- a/src/components/ui/Badge.tsx +++ b/src/components/ui/Badge.tsx @@ -1,5 +1,5 @@ import { ReactElement } from "react"; -import { Link } from "./Link"; +import { Link } from "../core/Link"; interface BadgeProps { children: React.ReactNode; diff --git a/src/components/ui/CatalogData.tsx b/src/components/ui/CatalogData.tsx index 0772629..a3e0b34 100644 --- a/src/components/ui/CatalogData.tsx +++ b/src/components/ui/CatalogData.tsx @@ -6,7 +6,7 @@ import { RightAscension, Quantity, QuantityWithError, -} from "./Astronomy"; +} from "../core/Astronomy"; interface CatalogDataProps { catalogs: Catalogs; diff --git a/src/components/ui/CommonTable.tsx b/src/components/ui/CommonTable.tsx index fe1ba3c..185194f 100644 --- a/src/components/ui/CommonTable.tsx +++ b/src/components/ui/CommonTable.tsx @@ -1,7 +1,7 @@ import React, { ReactElement, ReactNode } from "react"; import classNames from "classnames"; -import { Hint } from "./Hint"; -import { Loading } from "./Loading"; +import { Hint } from "../core/Hint"; +import { Loading } from "../core/Loading"; export type CellPrimitive = ReactElement | string | number; diff --git a/src/components/ui/CopyButton.tsx b/src/components/ui/CopyButton.tsx index 0f03110..69c9b8b 100644 --- a/src/components/ui/CopyButton.tsx +++ b/src/components/ui/CopyButton.tsx @@ -1,5 +1,5 @@ import { ReactElement, useState } from "react"; -import { Button } from "./Button"; +import { Button } from "../core/Button"; import { MdCheck, MdContentCopy } from "react-icons/md"; interface CopyButtonProps { diff --git a/src/components/ui/ErrorPage.tsx b/src/components/ui/ErrorPage.tsx index 05a091f..ec8b28e 100644 --- a/src/components/ui/ErrorPage.tsx +++ b/src/components/ui/ErrorPage.tsx @@ -1,5 +1,5 @@ import { ReactElement, ReactNode } from "react"; -import { Button } from "./Button"; +import { Button } from "../core/Button"; interface ErrorPageProps { title?: string; diff --git a/src/components/ui/Navbar.tsx b/src/components/ui/Navbar.tsx index dda5ae3..f0a1d64 100644 --- a/src/components/ui/Navbar.tsx +++ b/src/components/ui/Navbar.tsx @@ -2,7 +2,7 @@ import { useState } from "react"; import { NavLink } from "react-router-dom"; import { Tooltip } from "flowbite-react"; import { MdInfo, MdSearch, MdTableChart } from "react-icons/md"; -import { Link } from "./Link"; +import { Link } from "../core/Link"; const navItems = [ { to: "/", icon: , label: "Object search" }, diff --git a/src/components/ui/Pagination.tsx b/src/components/ui/Pagination.tsx index 1d6d886..32b62fb 100644 --- a/src/components/ui/Pagination.tsx +++ b/src/components/ui/Pagination.tsx @@ -1,5 +1,5 @@ import { ReactElement } from "react"; -import { Button } from "./Button"; +import { Button } from "../core/Button"; type PaginationProps = { page: number; diff --git a/src/components/ui/Searchbar.tsx b/src/components/ui/Searchbar.tsx index d7b494f..eaf3537 100644 --- a/src/components/ui/Searchbar.tsx +++ b/src/components/ui/Searchbar.tsx @@ -1,7 +1,7 @@ import { ReactElement, useState } from "react"; import { Link, NavigateFunction, useNavigate } from "react-router-dom"; import classNames from "classnames"; -import { Button } from "./Button"; +import { Button } from "../core/Button"; interface SearchBarProps { initialValue?: string; diff --git a/src/pages/CrossmatchResults.tsx b/src/pages/CrossmatchResults.tsx index 0faea51..de1891f 100644 --- a/src/pages/CrossmatchResults.tsx +++ b/src/pages/CrossmatchResults.tsx @@ -6,8 +6,8 @@ import { CellPrimitive, } from "../components/ui/CommonTable"; import { Badge } from "../components/ui/Badge"; -import { DropdownFilter } from "../components/ui/DropdownFilter"; -import { TextFilter } from "../components/ui/TextFilter"; +import { DropdownFilter } from "../components/core/DropdownFilter"; +import { TextFilter } from "../components/core/TextFilter"; import { getCrossmatchRecords } from "../clients/admin/sdk.gen"; import type { GetRecordsCrossmatchResponse, @@ -16,10 +16,10 @@ import type { ValidationError, } from "../clients/admin/types.gen"; import { getResource } from "../resources/resources"; -import { Button } from "../components/ui/Button"; -import { Loading } from "../components/ui/Loading"; +import { Button } from "../components/core/Button"; +import { Loading } from "../components/core/Loading"; import { ErrorPage } from "../components/ui/ErrorPage"; -import { Link } from "../components/ui/Link"; +import { Link } from "../components/core/Link"; import { useDataFetching } from "../hooks/useDataFetching"; import { Pagination } from "../components/ui/Pagination"; import { adminClient } from "../clients/config"; diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index e7a2224..0214c4f 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -1,5 +1,5 @@ import { ReactElement } from "react"; -import { Link } from "../components/ui/Link"; +import { Link } from "../components/core/Link"; const homePageHint: ReactElement = (
diff --git a/src/pages/NotFound.tsx b/src/pages/NotFound.tsx index d4ac5a9..ad045c3 100644 --- a/src/pages/NotFound.tsx +++ b/src/pages/NotFound.tsx @@ -1,6 +1,6 @@ import { useNavigate } from "react-router-dom"; import { ErrorPage } from "../components/ui/ErrorPage"; -import { Button } from "../components/ui/Button"; +import { Button } from "../components/core/Button"; import { useEffect } from "react"; export function NotFoundPage() { diff --git a/src/pages/ObjectDetails.tsx b/src/pages/ObjectDetails.tsx index b6e2c1e..1c6006d 100644 --- a/src/pages/ObjectDetails.tsx +++ b/src/pages/ObjectDetails.tsx @@ -1,10 +1,10 @@ import { ReactElement, useEffect } from "react"; import { useParams } from "react-router-dom"; -import { AladinViewer } from "../components/ui/Aladin"; -import { Loading } from "../components/ui/Loading"; +import { AladinViewer } from "../components/core/Aladin"; +import { Loading } from "../components/core/Loading"; import { ErrorPage } from "../components/ui/ErrorPage"; import { CatalogData } from "../components/ui/CatalogData"; -import { Link } from "../components/ui/Link"; +import { Link } from "../components/core/Link"; import { querySimple } from "../clients/backend/sdk.gen"; import { PgcObject, Schema } from "../clients/backend/types.gen"; import { useDataFetching } from "../hooks/useDataFetching"; diff --git a/src/pages/RecordCrossmatchDetails.tsx b/src/pages/RecordCrossmatchDetails.tsx index c59c5cc..c1dd4a8 100644 --- a/src/pages/RecordCrossmatchDetails.tsx +++ b/src/pages/RecordCrossmatchDetails.tsx @@ -1,7 +1,7 @@ import { ReactElement, useEffect } from "react"; import { useParams } from "react-router-dom"; -import { AladinViewer } from "../components/ui/Aladin"; -import { Loading } from "../components/ui/Loading"; +import { AladinViewer } from "../components/core/Aladin"; +import { Loading } from "../components/core/Loading"; import { ErrorPage } from "../components/ui/ErrorPage"; import { CatalogData } from "../components/ui/CatalogData"; import { @@ -18,9 +18,9 @@ import { } from "../clients/admin/types.gen"; import { Schema as BackendSchema } from "../clients/backend/types.gen"; import { getResource } from "../resources/resources"; -import { Link } from "../components/ui/Link"; +import { Link } from "../components/core/Link"; import { CopyButton } from "../components/ui/CopyButton"; -import { Accordion } from "../components/ui/Accordion"; +import { Accordion } from "../components/core/Accordion"; import { useDataFetching } from "../hooks/useDataFetching"; import { adminClient } from "../clients/config"; diff --git a/src/pages/SearchResults.tsx b/src/pages/SearchResults.tsx index b5bc6c7..4470fb4 100644 --- a/src/pages/SearchResults.tsx +++ b/src/pages/SearchResults.tsx @@ -6,13 +6,13 @@ import { } from "react-router-dom"; import { SearchBar } from "../components/ui/Searchbar"; import { CommonTable, Column } from "../components/ui/CommonTable"; -import { Loading } from "../components/ui/Loading"; +import { Loading } from "../components/core/Loading"; import { ErrorPage, ErrorPageHomeButton } from "../components/ui/ErrorPage"; import { useDataFetching } from "../hooks/useDataFetching"; import { querySimple } from "../clients/backend/sdk.gen"; import { QuerySimpleResponse } from "../clients/backend/types.gen"; -import { Link } from "../components/ui/Link"; -import { Declination, RightAscension } from "../components/ui/Astronomy"; +import { Link } from "../components/core/Link"; +import { Declination, RightAscension } from "../components/core/Astronomy"; import { Pagination } from "../components/ui/Pagination"; import { backendClient } from "../clients/config"; diff --git a/src/pages/TableDetails.tsx b/src/pages/TableDetails.tsx index ffffe92..5eb2c47 100644 --- a/src/pages/TableDetails.tsx +++ b/src/pages/TableDetails.tsx @@ -11,11 +11,11 @@ import { Column, CommonTable, } from "../components/ui/CommonTable"; -import { Button } from "../components/ui/Button"; +import { Button } from "../components/core/Button"; import { CopyButton } from "../components/ui/CopyButton"; import { Badge } from "../components/ui/Badge"; -import { Link } from "../components/ui/Link"; -import { Loading } from "../components/ui/Loading"; +import { Link } from "../components/core/Link"; +import { Loading } from "../components/core/Loading"; import { ErrorPage } from "../components/ui/ErrorPage"; import { getResource } from "../resources/resources"; import { useDataFetching } from "../hooks/useDataFetching"; diff --git a/src/pages/Tables.tsx b/src/pages/Tables.tsx index 58187f9..cc8048f 100644 --- a/src/pages/Tables.tsx +++ b/src/pages/Tables.tsx @@ -5,17 +5,17 @@ import { Column, CellPrimitive, } from "../components/ui/CommonTable"; -import { DropdownFilter } from "../components/ui/DropdownFilter"; -import { TextFilter } from "../components/ui/TextFilter"; +import { DropdownFilter } from "../components/core/DropdownFilter"; +import { TextFilter } from "../components/core/TextFilter"; import { getTableList } from "../clients/admin/sdk.gen"; import type { GetTableListResponse, TableListItem, ValidationError, } from "../clients/admin/types.gen"; -import { Loading } from "../components/ui/Loading"; +import { Loading } from "../components/core/Loading"; import { ErrorPage } from "../components/ui/ErrorPage"; -import { Link } from "../components/ui/Link"; +import { Link } from "../components/core/Link"; import { useDataFetching } from "../hooks/useDataFetching"; import { Pagination } from "../components/ui/Pagination"; import { adminClient } from "../clients/config"; From d8030f5ad80d67c48782e167173bc2b1083363b8 Mon Sep 17 00:00:00 2001 From: kraysent Date: Sun, 22 Feb 2026 15:45:27 +0000 Subject: [PATCH 5/9] clicking outside for info --- src/components/ui/Navbar.tsx | 47 +++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/src/components/ui/Navbar.tsx b/src/components/ui/Navbar.tsx index f0a1d64..1c451dd 100644 --- a/src/components/ui/Navbar.tsx +++ b/src/components/ui/Navbar.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +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"; @@ -11,6 +11,24 @@ const navItems = [ export function Navbar() { const [footerOpen, setFooterOpen] = useState(false); + const infoPanelRef = useRef(null); + const infoButtonRef = useRef(null); + + useEffect(() => { + function handleClickOutside(e: MouseEvent) { + const clickedInside = + infoPanelRef.current?.contains(e.target as Node) || + infoButtonRef.current?.contains(e.target as Node); + if (!clickedInside) { + setFooterOpen(false); + } + } + + if (footerOpen) { + document.addEventListener("mousedown", handleClickOutside); + } + return () => document.removeEventListener("mousedown", handleClickOutside); + }, [footerOpen]); return ( <> @@ -40,27 +58,22 @@ export function Navbar() { ))}
- setFooterOpen(!footerOpen)} + className={`w-9 h-9 flex items-center justify-center rounded-lg transition-colors duration-300 cursor-pointer ${ + footerOpen + ? "bg-[#646cff] text-white" + : "text-neutral-400 hover:bg-neutral-700 hover:text-white" + }`} > - - + +
Date: Sun, 22 Feb 2026 15:53:58 +0000 Subject: [PATCH 6/9] smoother page transitions --- src/App.tsx | 110 +++++++++++++---------------------- src/components/core/Link.tsx | 30 +++++----- src/components/ui/Layout.tsx | 7 ++- 3 files changed, 64 insertions(+), 83 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 4ee27d6..8d0bf2a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -14,74 +14,48 @@ function App() { return ( - - - - - } - /> - - - - } - /> - - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - - } - /> - - - - - } - /> + }> + + + + + } + /> + } /> + + + + + } + /> + } /> + } /> + } /> + + + + + } + /> + + + + + } + /> + ); diff --git a/src/components/core/Link.tsx b/src/components/core/Link.tsx index a4b37c6..9d4b966 100644 --- a/src/components/core/Link.tsx +++ b/src/components/core/Link.tsx @@ -1,4 +1,5 @@ import { ReactElement, ReactNode } from "react"; +import { Link as RouterLink } from "react-router-dom"; import { MdOpenInNew } from "react-icons/md"; interface LinkProps { @@ -14,22 +15,25 @@ export function Link(props: LinkProps): ReactElement { const className = props.className ? `${baseClass} ${props.className}` : baseClass; + const combinedClassName = `${className} inline-flex items-center gap-1`; - const linkProps = props.external - ? { - target: "_blank", - rel: "noopener noreferrer", - } - : {}; + if (props.external) { + return ( + + {content} + + + ); + } return ( - + {content} - {props.external && } - + ); } diff --git a/src/components/ui/Layout.tsx b/src/components/ui/Layout.tsx index a8d08c8..d229496 100644 --- a/src/components/ui/Layout.tsx +++ b/src/components/ui/Layout.tsx @@ -1,11 +1,14 @@ +import { Outlet } from "react-router-dom"; import { Navbar } from "./Navbar"; -export function Layout({ children }: { children: React.ReactNode }) { +export function Layout() { return (
-
{children}
+
+ +
); From a782cec39319e174694c09cbdca2e2900ae2e49a Mon Sep 17 00:00:00 2001 From: kraysent Date: Sun, 22 Feb 2026 15:59:11 +0000 Subject: [PATCH 7/9] fix error message --- src/pages/ObjectDetails.tsx | 4 +++- src/pages/RecordCrossmatchDetails.tsx | 2 +- src/pages/SearchResults.tsx | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pages/ObjectDetails.tsx b/src/pages/ObjectDetails.tsx index 1c6006d..e2d7ead 100644 --- a/src/pages/ObjectDetails.tsx +++ b/src/pages/ObjectDetails.tsx @@ -63,7 +63,9 @@ async function fetcher( }); if (response.error || !response.data) { - throw new Error(`Error during query: ${response.error}`); + throw new Error( + `Error during query: ${typeof response.error === "object" ? JSON.stringify(response.error) : response.error}`, + ); } const objects = response.data.data.objects; diff --git a/src/pages/RecordCrossmatchDetails.tsx b/src/pages/RecordCrossmatchDetails.tsx index c1dd4a8..75a6f65 100644 --- a/src/pages/RecordCrossmatchDetails.tsx +++ b/src/pages/RecordCrossmatchDetails.tsx @@ -242,7 +242,7 @@ async function fetcher( if (response.error || !response.data?.data) { throw new Error( - `Error fetching crossmatch details: ${response.error || "Unknown error"}`, + `Error fetching crossmatch details: ${typeof response.error === "object" ? JSON.stringify(response.error) : response.error || "Unknown error"}`, ); } diff --git a/src/pages/SearchResults.tsx b/src/pages/SearchResults.tsx index 4470fb4..671bc63 100644 --- a/src/pages/SearchResults.tsx +++ b/src/pages/SearchResults.tsx @@ -139,7 +139,9 @@ async function fetcher( } if (response.error || !response.data) { - throw new Error(`Error during query: ${response.error}`); + throw new Error( + `Error during query: ${typeof response.error === "object" ? JSON.stringify(response.error) : response.error}`, + ); } return response.data.data; From 1227aae5470397766b3bffbdd7ce42807113d4b2 Mon Sep 17 00:00:00 2001 From: kraysent Date: Sun, 22 Feb 2026 16:02:17 +0000 Subject: [PATCH 8/9] make check and fix commands quiet --- makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/makefile b/makefile index fc6ecd7..1153058 100644 --- a/makefile +++ b/makefile @@ -1,3 +1,12 @@ +check: + @output=$$(yarn run --silent prettier --check src 2>&1) || { echo "$$output"; exit 1; } + @output=$$(yarn run --silent eslint src 2>&1) || { echo "$$output"; exit 1; } + +fix: + @output=$$(yarn run --silent prettier --write src 2>&1) || { echo "$$output"; exit 1; } + @output=$$(yarn run --silent eslint --fix src 2>&1) || { echo "$$output"; exit 1; } + + GIT_VERSION = `git rev-parse --short HEAD` run: @@ -6,14 +15,6 @@ run: build: yarn build -check: - yarn run prettier --check src - yarn eslint src - -fix: - yarn run prettier --write src - yarn eslint --fix src - gen: yarn run openapi-ts -i http://leda.sao.ru/api/openapi.json -o ./src/clients/backend yarn run openapi-ts -i http://leda.sao.ru/admin/api/openapi.json -o ./src/clients/admin From 9bed0e4c07d3c2ac4276ed8e69ff42ac14e08fbf Mon Sep 17 00:00:00 2001 From: kraysent Date: Sun, 22 Feb 2026 16:04:59 +0000 Subject: [PATCH 9/9] add yarn build to checks --- .github/workflows/build-app.yml | 26 -------------------------- makefile | 4 +--- src/pages/ObjectDetails.tsx | 3 ++- src/pages/SearchResults.tsx | 3 ++- 4 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/build-app.yml diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml deleted file mode 100644 index 8e9060a..0000000 --- a/.github/workflows/build-app.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Build Application - -on: - - push - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Install dependencies - run: yarn install - - - name: Generate code - run: make gen - - - name: Build application - run: make build diff --git a/makefile b/makefile index 1153058..d78700f 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,7 @@ check: @output=$$(yarn run --silent prettier --check src 2>&1) || { echo "$$output"; exit 1; } @output=$$(yarn run --silent eslint src 2>&1) || { echo "$$output"; exit 1; } + @yarn build fix: @output=$$(yarn run --silent prettier --write src 2>&1) || { echo "$$output"; exit 1; } @@ -12,9 +13,6 @@ GIT_VERSION = `git rev-parse --short HEAD` run: yarn dev -build: - yarn build - gen: yarn run openapi-ts -i http://leda.sao.ru/api/openapi.json -o ./src/clients/backend yarn run openapi-ts -i http://leda.sao.ru/admin/api/openapi.json -o ./src/clients/admin diff --git a/src/pages/ObjectDetails.tsx b/src/pages/ObjectDetails.tsx index e2d7ead..1158b25 100644 --- a/src/pages/ObjectDetails.tsx +++ b/src/pages/ObjectDetails.tsx @@ -63,8 +63,9 @@ async function fetcher( }); if (response.error || !response.data) { + const err = response.error; throw new Error( - `Error during query: ${typeof response.error === "object" ? JSON.stringify(response.error) : response.error}`, + `Error during query: ${typeof err === "object" ? JSON.stringify(err) : err}`, ); } diff --git a/src/pages/SearchResults.tsx b/src/pages/SearchResults.tsx index 671bc63..f234495 100644 --- a/src/pages/SearchResults.tsx +++ b/src/pages/SearchResults.tsx @@ -139,8 +139,9 @@ async function fetcher( } if (response.error || !response.data) { + const err = response.error; throw new Error( - `Error during query: ${typeof response.error === "object" ? JSON.stringify(response.error) : response.error}`, + `Error during query: ${typeof err === "object" ? JSON.stringify(err) : err}`, ); }