2025-07-23 11:01:25 -07:00
|
|
|
import { Global, css } from "@emotion/react";
|
|
|
|
|
import Header from './Header/Header.jsx';
|
|
|
|
|
import Sidebar from './Sidebar/Sidebar.jsx';
|
|
|
|
|
import Canvas from './Canvas/Canvas.jsx';
|
2025-07-23 11:35:28 -07:00
|
|
|
import { Grid, GridItem, useRecipe } from '@chakra-ui/react';
|
|
|
|
|
import { useState } from 'react';
|
2025-07-23 11:01:25 -07:00
|
|
|
|
|
|
|
|
export default function Dashboard() {
|
|
|
|
|
const recipe = useRecipe({ key: "canvas" });
|
|
|
|
|
const styles = recipe();
|
|
|
|
|
|
2025-07-23 11:35:28 -07:00
|
|
|
// Lifted State - defaults to widget dashboard
|
|
|
|
|
const [view, setView] = useState("widget");
|
|
|
|
|
|
2025-07-23 11:01:25 -07:00
|
|
|
return (
|
2025-07-23 21:31:18 +00:00
|
|
|
<>
|
|
|
|
|
<Global // change the background color of widget shadow when moving
|
|
|
|
|
styles={css`
|
|
|
|
|
.react-grid-placeholder {
|
|
|
|
|
background: #c0d2e3ff !important;
|
|
|
|
|
border-color: #a9b6c2ff !important;
|
|
|
|
|
box-shadow: 0 0 10px #c0d2e3ff !important;
|
|
|
|
|
opacity: 1 !important;
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
}
|
2025-07-23 11:01:25 -07:00
|
|
|
|
2025-07-23 21:31:18 +00:00
|
|
|
.react-resizable-handle-se {
|
|
|
|
|
position: absolute;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
* {
|
|
|
|
|
scrollbar-width: thin; /* Firefox */
|
|
|
|
|
scrollbar-color: #a0aec0 transparent; /* Firefox */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Chrome, Edge, Safari */
|
|
|
|
|
::-webkit-scrollbar {
|
|
|
|
|
width: 8px;
|
|
|
|
|
}
|
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
|
|
|
background-color: rgba(100, 100, 100, 0.4);
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
}
|
|
|
|
|
::-webkit-scrollbar-track {
|
|
|
|
|
background: transparent;
|
|
|
|
|
}
|
|
|
|
|
`}
|
|
|
|
|
/>
|
|
|
|
|
<Grid css={styles}
|
|
|
|
|
templateRows="1fr 11fr"
|
|
|
|
|
templateColumns="1fr 20fr"
|
|
|
|
|
height="100vh"
|
|
|
|
|
width="100vw"
|
|
|
|
|
>
|
|
|
|
|
<GridItem rowSpan={1} colSpan={2}>
|
|
|
|
|
<Header />
|
|
|
|
|
</GridItem>
|
|
|
|
|
<GridItem colSpan={1}>
|
2025-07-23 14:41:52 -07:00
|
|
|
<Sidebar onChangeView={ setView }/>
|
2025-07-23 21:31:18 +00:00
|
|
|
</GridItem>
|
|
|
|
|
<GridItem colSpan={1} width="100%">
|
2025-07-23 14:41:52 -07:00
|
|
|
<Canvas view={ view }/>
|
2025-07-23 21:31:18 +00:00
|
|
|
</GridItem>
|
|
|
|
|
</Grid>
|
2025-07-23 11:01:25 -07:00
|
|
|
</>
|
|
|
|
|
);
|
2025-07-23 21:31:18 +00:00
|
|
|
}
|