Skip to content

Commit

Permalink
clean up conditional for HashRouter for private website
Browse files Browse the repository at this point in the history
  • Loading branch information
manuwaik committed Jan 29, 2024
1 parent 5f2e319 commit b770d2d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 68 deletions.
62 changes: 0 additions & 62 deletions lib/user-interface/react-app/src/app-private.tsx

This file was deleted.

8 changes: 5 additions & 3 deletions lib/user-interface/react-app/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BrowserRouter, Routes, Route, Outlet } from "react-router-dom";
import { HashRouter, BrowserRouter, Routes, Route, Outlet } from "react-router-dom";
import GlobalHeader from "./components/global-header";
import Dashboard from "./pages/rag/dashboard/dashboard";
import NotFound from "./pages/not-found";
Expand All @@ -16,12 +16,14 @@ import AddData from "./pages/rag/add-data/add-data";
import "./styles/app.scss";
import MultiChatPlayground from "./pages/chatbot/playground/multi-chat-playground";
import RssFeed from "./pages/rag/workspace/rss-feed";
import * as InfraConfig from '../../../../bin/config.json';

function App() {
const Router = InfraConfig.privateWebsite ? HashRouter : BrowserRouter;

return (
<div style={{ height: "100%" }}>
<BrowserRouter>
<Router>
<GlobalHeader />
<div style={{ height: "56px", backgroundColor: "#000716" }}>&nbsp;</div>
<div>
Expand Down Expand Up @@ -54,7 +56,7 @@ function App() {
<Route path="*" element={<NotFound />} />
</Routes>
</div>
</BrowserRouter>
</Router>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
useTheme,
} from "@aws-amplify/ui-react";
import App from "../app";
import AppPrivate from "../app-private";
import { Amplify, Auth } from "aws-amplify";
import { AppConfig } from "../common/types";
import { AppContext } from "../common/app-context";
Expand All @@ -16,7 +15,6 @@ import { StorageHelper } from "../common/helpers/storage-helper";
import { Mode } from "@cloudscape-design/global-styles";
import "@aws-amplify/ui-react/styles.css";
import { CHATBOT_NAME } from "../common/constants";
import * as InfraConfig from '../../../../../bin/config.json';

export default function AppConfigured() {
const { tokens } = useTheme();
Expand Down Expand Up @@ -158,7 +156,7 @@ export default function AppConfigured() {
},
}}
>
{InfraConfig.privateWebsite ? <AppPrivate/> : <App /> }
<App />
</Authenticator>
</ThemeProvider>
</AppContext.Provider>
Expand Down

0 comments on commit b770d2d

Please sign in to comment.