removed extra wrapper components

This commit is contained in:
2025-08-05 12:43:57 -07:00
parent 24f90cd542
commit 03a335710f
3 changed files with 6 additions and 6 deletions
@@ -11,10 +11,10 @@ import { DASHBOARD_VIEWS } from "@/constants/viewKeys";
export default function Canvas({...props}) {
const { view } = props;
return (
<Box height="100%" width="100%">
<>
{/* Check if view is a tab inside the Canvas Header */}
{ DASHBOARD_VIEWS.includes(view) && (
<HomeCanvas {...props}/>
<HomeCanvas width="100%" height="100%" {...props}/>
)}
{view === "global" && <GlobalMapCanvas />}
{view === "regional" && <RegionalMapCanvas />}
@@ -22,6 +22,6 @@ export default function Canvas({...props}) {
{view === "admin" && <AdminCanvas />}
{view === "account" && <AccountCanvas />}
{view === "settings" && <SettingsCanvas />}
</Box>
</>
);
}
@@ -13,7 +13,7 @@ import DeleteAllButton from "../components/DeleteAllButton";
export function HomeCanvas({...props}) {
// deconstructing props
const { view, layout, setLayout, setOriginalLayout, onLayoutChange, onChangeView, onCancel,
const { width, height, view, layout, setLayout, setOriginalLayout, onLayoutChange, onChangeView, onCancel,
isDelete, setIsDelete, isEditable, setIsEditable, widgetArray, setWidgetArray } = props;
const onAddWidget = (ID) => {
@@ -90,6 +90,8 @@ export function HomeCanvas({...props}) {
return (
/* HEADER */
<Tabs.Root
width={width}
height={height}
lazyMount
value={ view }
variant="line"
@@ -51,7 +51,6 @@ export default function Dashboard() {
const headerProps = { onChangeView: handleViewChange };
return (
<>
<Grid css={styles}
templateRows="1fr 11fr"
// templateColumns="1fr 20fr"
@@ -69,6 +68,5 @@ export default function Dashboard() {
<Canvas {...canvasProps}/>
</GridItem>
</Grid>
</>
);
}