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 fc6ecd7..d78700f 100644 --- a/makefile +++ b/makefile @@ -1,18 +1,17 @@ -GIT_VERSION = `git rev-parse --short HEAD` +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 -run: - yarn dev +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; } -build: - yarn build -check: - yarn run prettier --check src - yarn eslint src +GIT_VERSION = `git rev-parse --short HEAD` -fix: - yarn run prettier --write src - yarn eslint --fix src +run: + yarn dev gen: yarn run openapi-ts -i http://leda.sao.ru/api/openapi.json -o ./src/clients/backend diff --git a/src/App.tsx b/src/App.tsx index af8d624..8d0bf2a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -14,76 +14,48 @@ function App() { return ( - - - - - } - /> - - - - } - /> - - - - - } - /> - - - - - } - /> - - - - - } - /> - - - - } - /> - - - - - } - /> - - - - - } - /> + }> + + + + + } + /> + } /> + + + + + } + /> + } /> + } /> + } /> + + + + + } + /> + + + + + } + /> + ); 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 52% rename from src/components/ui/Link.tsx rename to src/components/core/Link.tsx index a4b37c6..9d4b966 100644 --- a/src/components/ui/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/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/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 ( - <> - - - - - ); -} diff --git a/src/components/ui/Layout.tsx b/src/components/ui/Layout.tsx index 68e6b40..d229496 100644 --- a/src/components/ui/Layout.tsx +++ b/src/components/ui/Layout.tsx @@ -1,10 +1,15 @@ -import { Footer } from "./Footer"; +import { Outlet } from "react-router-dom"; +import { Navbar } from "./Navbar"; -export function Layout({ children }: { children: React.ReactNode }) { +export function Layout() { return ( -
-
{children}
-