Skip to content

Commit

Permalink
Merge pull request #134 from kaleido-io/ui-routing
Browse files Browse the repository at this point in the history
[ui-routing] adding basename to routing
  • Loading branch information
nguyer authored Mar 22, 2022
2 parents 70d68cc + 9e7692e commit 3fc40f7
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from '@mui/material';
import { useEffect, useMemo, useRef, useState } from 'react';
import ReconnectingWebSocket from 'reconnecting-websocket';
import { NAV_BASENAME } from './components/Navigation/Navigation';
import { Router } from './components/Router';
import {
MessageSnackbar,
Expand Down Expand Up @@ -101,7 +102,7 @@ const App: React.FC = () => {
} else {
setSelectedNamespace(status.defaults.namespace);
window.location.replace(
`/${NAMESPACES_PATH}/${status.defaults.namespace}/home`
`${NAV_BASENAME}/${NAMESPACES_PATH}/${status.defaults.namespace}/home`
);
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const Header: React.FC<Props> = ({
subtitle,
onRefresh,
numNewEvents = 0,
showNumNewEvents = true,
showNumNewEvents = false,
noDateFilter = false,
noNsFilter = false,
}) => {
Expand Down
1 change: 1 addition & 0 deletions src/components/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { NetworkNav } from './NetworkNav';
import { OffChainNav } from './OffChainNav';
import { TokensNav } from './TokensNav';

export const NAV_BASENAME = '/ui';
export const NAV_WIDTH = 225;

export const Navigation: React.FC = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { NetworkRoutes } from '../pages/Network/Routes';
import { OffChainRoutes } from '../pages/Off-Chain/Routes';
import { TokensRoutes } from '../pages/Tokens/Routes';
import { AppWrapper } from './AppWrapper';
import { NAV_BASENAME } from './Navigation/Navigation';

const queryClient = new QueryClient({
defaultOptions: {
Expand All @@ -39,7 +40,7 @@ export const Router: () => JSX.Element = () => {
return (
<QueryClientProvider client={queryClient}>
<QueryParamProvider>
<BrowserRouter>
<BrowserRouter basename={NAV_BASENAME}>
<Routes />
</BrowserRouter>
</QueryParamProvider>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Timeline/FFTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const FFTimeline: React.FC<Props> = ({
onClick={fetchNewData}
>
<ArrowCircleUpIcon sx={{ mr: 1 }} />
{`${t('see')} ${numNewEvents} ${t('newEvents')}`}
{`${t('seeNewEvents')}`}
</Fab>
</Grid>
)}
Expand Down
1 change: 0 additions & 1 deletion src/pages/Activity/views/Operations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ export const ActivityOperations: () => JSX.Element = () => {
subtitle={t('activity')}
onRefresh={refreshData}
numNewEvents={numNewEvents}
showNumNewEvents={false}
></Header>
<Grid container px={DEFAULT_PADDING}>
<Grid container item wrap="nowrap" direction="column">
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
"save": "Save",
"schema": "Schema",
"see": "See",
"seeNewEvents": "See New Events",
"selectedFilters": "Selected Filters",
"sequence": "Sequence",
"sharedStorageBatchBroadcast": "Shared Storage Batch Broadcast",
Expand Down

0 comments on commit 3fc40f7

Please sign in to comment.