-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Remove most module.css files - Add recursively rendering Settings component - Temporarily emove Sidebar from layout (component remains in codebase) - Reorganize component and page file structure with less subfolders
- Loading branch information
1 parent
d158d03
commit c124f81
Showing
70 changed files
with
636 additions
and
1,428 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from "react"; | ||
import whyDidYouRender from "@welldone-software/why-did-you-render"; | ||
if (process.env.NODE_ENV === "development") { | ||
whyDidYouRender(React, { | ||
trackAllPureComponents: true, | ||
logOnDifferentValues: true, | ||
collapseGroups: false, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { useState } from "react"; | ||
import { WindowButtons } from "./WindowButtons"; | ||
import { AppInfoModal } from "@/components"; | ||
import { Button, Stack, Typography } from "@mui/material"; | ||
import { Link, useLocation } from "react-router-dom"; | ||
import { | ||
Dataset, | ||
Settings, | ||
Dashboard, | ||
BarChart, | ||
Dvr, | ||
} from "@mui/icons-material"; | ||
import { useWebviewStore } from "@/stores"; | ||
|
||
const ToolbarButton = ({ to, label, icon }) => { | ||
const location = useLocation(); | ||
const isSelected = location.pathname.includes(to); | ||
return ( | ||
<Button | ||
component={Link} | ||
to={isSelected ? null : to} | ||
startIcon={icon} | ||
sx={isSelected ? { color: "primary.main" } : { color: "text.primary" }} | ||
> | ||
{label} | ||
</Button> | ||
); | ||
}; | ||
|
||
const Toolbar = () => ( | ||
<Stack direction="row" justifyContent="space-around" p={0.5}> | ||
<ToolbarButton to="/source" icon={<Dataset />} label="Source Selection" /> | ||
<ToolbarButton to="/channels" icon={<Dvr />} label="Channels" /> | ||
<ToolbarButton to="/settings" icon={<Settings />} label="Settings" /> | ||
<ToolbarButton to="/dashboard" icon={<Dashboard />} label="Dashboard" /> | ||
<ToolbarButton to="/decoding" icon={<BarChart />} label="Decoding" /> | ||
</Stack> | ||
); | ||
|
||
export const AppBar = () => { | ||
// In your JSX: | ||
const { isWebView } = useWebviewStore((state) => state.isWebView); | ||
const [showModal, setShowModal] = useState(false); | ||
|
||
return ( | ||
<Stack | ||
className="pywebview-drag-region" | ||
direction="row" | ||
justifyContent="space-between" | ||
borderBottom="2px solid" | ||
borderColor="background.level3" | ||
bgcolor="background.paper" | ||
> | ||
<Typography | ||
onClick={() => setShowModal(true)} | ||
variant="h4" | ||
sx={{ cursor: "pointer", ml: 2, "&:hover": { color: "primary.main" } }} | ||
> | ||
PyNeuromodulation | ||
</Typography> | ||
<Toolbar /> | ||
{isWebView && <WindowButtons />} | ||
<AppInfoModal open={showModal} onClose={() => setShowModal(false)} /> | ||
</Stack> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.