Skip to content

Commit

Permalink
update home page name and add spaces in projects page (#3780)
Browse files Browse the repository at this point in the history
  • Loading branch information
bklimov-web authored and AleksandrGorodetskii committed Dec 9, 2024
1 parent db9377f commit b8d3e38
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { RouteObject } from 'react-router-dom';
import { createHashRouter } from 'react-router-dom';
import { Layout } from '../../../pages/layout/index.tsx';
import { Home } from '../../../pages/home/home.tsx';
import { HomePage } from '../../../pages/home/home.tsx';
import Pipelines from '../../../pages/pipelines/index.tsx';
import { ProjectsPage } from '../../../pages/projects';
import Runs from '../../../pages/runs/index.tsx';
import { AppRoutes, RoutePath } from '../../../shared/constants/routes.ts';

const routerConfig: Record<AppRoutes, RouteObject> = {
[AppRoutes.HOME]: { path: RoutePath[AppRoutes.HOME], element: <Home /> },
[AppRoutes.HOME]: { path: RoutePath[AppRoutes.HOME], element: <HomePage /> },
[AppRoutes.PROJECTS]: {
path: RoutePath[AppRoutes.PROJECTS],
element: <ProjectsPage />,
Expand All @@ -21,7 +21,7 @@ const routerConfig: Record<AppRoutes, RouteObject> = {
// TODO: creat not-found page
[AppRoutes.NOT_FOUND]: {
path: RoutePath[AppRoutes.NOT_FOUND],
element: <Home />,
element: <HomePage />,
},
};

Expand Down
2 changes: 1 addition & 1 deletion portals-ui/sites/ngs-portal/src/pages/home/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { loadPipelines } from '../../state/pipelines/load-pipelines.ts';
import { ProjectsList, PipelinesList, RunsList } from './components';
import './style.css';

export const Home = () => {
export const HomePage = () => {
const { projects } = useProjectsState();
const { pipelines } = usePipelinesState();

Expand Down
2 changes: 1 addition & 1 deletion portals-ui/sites/ngs-portal/src/pages/home/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { Home } from './home';
export { HomePage } from './home';
5 changes: 5 additions & 0 deletions portals-ui/sites/ngs-portal/src/pages/projects/projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,24 @@ export function ProjectsPage() {
.then(() => {})
.catch(() => {});
}, []);

const { projects, error, pending } = useProjectsState();
const { search, onSearchChange, filtered } = useSearch({
items: projects ?? [],
});

if (error) {
return <div>{error}</div>;
}

if (pending) {
return <Spinner />;
}

if (!projects) {
return <div>No data</div>;
}

return (
<div className="flex flex-col overflow-auto">
<ListHeader
Expand Down

0 comments on commit b8d3e38

Please sign in to comment.