Skip to content

Commit

Permalink
Header Not Showing on no stream fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-gupta-ij committed Sep 13, 2023
1 parent 7937ade commit 53e0f27
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
16 changes: 16 additions & 0 deletions src/components/Header/SubHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,19 @@ export const UsersManagementHeader: FC = () => {
</Box>
);
};


export const AllRouteHeader: FC = () => {
const { classes } = useLogQueryStyles();
const { container, innerContainer } = classes;

return (
<Box className={container}>
<Box>
<Box className={innerContainer}>
<HeaderBreadcrumbs crumbs={[]} />
</Box>
</Box>
</Box>
);
}
12 changes: 10 additions & 2 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@ import type { HeaderProps as MantineHeaderProps } from '@mantine/core';
import { FC } from 'react';
import { Route, Routes } from 'react-router-dom';
import HeaderLayout from './Layout';
import { ConfigHeader, LogsHeader, QueryHeader, StatsHeader, UsersManagementHeader } from './SubHeader';
import { CONFIG_ROUTE, LOGS_ROUTE, QUERY_ROUTE, STATS_ROUTE, USERS_MANAGEMENT_ROUTE } from '@/constants/routes';
import { AllRouteHeader, ConfigHeader, LogsHeader, QueryHeader, StatsHeader, UsersManagementHeader } from './SubHeader';
import {
ALL_ROUTE,
CONFIG_ROUTE,
LOGS_ROUTE,
QUERY_ROUTE,
STATS_ROUTE,
USERS_MANAGEMENT_ROUTE,
} from '@/constants/routes';

type HeaderProps = Omit<MantineHeaderProps, 'children' | 'height' | 'className'>;

Expand All @@ -16,6 +23,7 @@ const Header: FC<HeaderProps> = (props) => {
<Route path={STATS_ROUTE} element={<StatsHeader />} />
<Route path={CONFIG_ROUTE} element={<ConfigHeader />} />
<Route path={USERS_MANAGEMENT_ROUTE} element={<UsersManagementHeader />} />
<Route path={ALL_ROUTE} element={<AllRouteHeader />} />
</Route>
</Routes>
);
Expand Down
2 changes: 1 addition & 1 deletion src/constants/routes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const HOME_ROUTE = '/';
export const LOGS_ROUTE = '/:streamName/logs';
export const LOGIN_ROUTE = '/login';
export const ALL_ROUTE = '*';
export const ALL_ROUTE = '/*';
export const QUERY_ROUTE = '/:streamName/query';
export const STATS_ROUTE = '/:streamName/stats';
export const CONFIG_ROUTE = '/:streamName/config';
Expand Down

0 comments on commit 53e0f27

Please sign in to comment.