Skip to content

Commit

Permalink
fixed browser router problems
Browse files Browse the repository at this point in the history
  • Loading branch information
mmills6060 committed Apr 7, 2024
1 parent ad8b662 commit 8d8ff8d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
6 changes: 3 additions & 3 deletions NeuraNet/frontend/src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function createWindow(): void {
mainWindow = new BrowserWindow({
width: 1366,
height: 768,
// frame: false,
frame: false,
backgroundColor: "#23272a",
titleBarStyle: 'hidden' || 'customButtonsOnHover',
trafficLightPosition: { x: 15, y: 15 },
Expand Down Expand Up @@ -89,13 +89,13 @@ function createWindow(): void {
function runPythonScript() {
const env = process.env.NODE_ENV || 'development';
let baseDir = '';
let devbaseDir = 'python';
let devbaseDir = '';
let filename = '';
let command = '';
let prodbaseDir = path.join(process.resourcesPath, 'python');
if (env === 'development') {
baseDir = devbaseDir;
filename = 'prod-receiver5.py';
filename = 'python/prod-receiver5.py';
command = process.platform === 'win32' ? 'venv/bin/python' : 'venv/bin/python3';
} else if (env === 'production') {
baseDir = prodbaseDir;
Expand Down
23 changes: 12 additions & 11 deletions NeuraNet/frontend/src/renderer/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,18 @@ export default function App(): JSX.Element {
backgroundColor: (theme) => theme.palette.background.default,
}}
>
<main style={{ paddingTop: '42px' }}> {/* Adjust the padding-top value to match the height of the title bar */}
<Signin />
<Routes>
<Route path="/" element={<Signin />} />
<Route path="/main" element={<Main />} />
<Route path="/register" element={<Signup />} />
<Route path="/login" element={<Signin />} />
<Route path="/settings" element={<Settings />} />
<Route path="/profile" element={<Profile />} />
</Routes>
</main>
{/* <main> */}
{/* <Signin /> */}
{/* <Routes> */}
{/* <Route path="/" element={<Signin />} /> */}
{/* <Route path="/main" element={<Main />} /> */}
{/* <Route path="/register" element={<Signup />} /> */}
{/* <Route path="/login" element={<Signin />} /> */}
{/* <Route path="/settings" element={<Settings />} /> */}
{/* <Route path="/profile" element={<Profile />} /> */}
{/* </Routes> */}
{/* </main> */}
<Signin />
</Box>
</AuthProvider>
</BrowserRouter>
Expand Down
4 changes: 2 additions & 2 deletions NeuraNet/frontend/src/renderer/components/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ export default function SignIn() {
let baseDir = '';
let filename = '';
let command = '';
let devbaseDir = 'python';
let devbaseDir = '';
let prodbaseDir = path.join(process.resourcesPath, 'python');
if (env === 'development') {
baseDir = devbaseDir;
filename = 'prod-signin2.py';
filename = 'python/prod-signin2.py';
command = process.platform === 'win32' ? 'venv/bin/python' : 'venv/bin/python3';
} else if (env === 'production') {
baseDir = prodbaseDir;
Expand Down
2 changes: 1 addition & 1 deletion NeuraNet/frontend/src/renderer/components/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const { ipcRenderer } = window.require('electron');

export default function PermanentDrawerLeft() {
const location = useLocation();
const initialActiveTab = location.state?.activeTab || 'Files'; // Set default value to 'Files' if not provided
const initialActiveTab = location.state?.activeTab || 'Files';
const [activeTab, setActiveTab] = React.useState(initialActiveTab);

return (
Expand Down

0 comments on commit 8d8ff8d

Please sign in to comment.