Merge branch 'add/persistant-widget-state' into 'main'
Clean garbage comments from refactor See merge request vkuchenik/website-framework!28
This commit is contained in:
@@ -11,11 +11,6 @@ import { useState, useEffect } from "react";
|
||||
export function DashboardCanvas({ layout, setLayout, onLayoutChange }) {
|
||||
const [isEditable, setIsEditable] = useState(false); // editable=true means static=false (vice versa)
|
||||
const [newCounter, setNewCounter] = useState(3);
|
||||
// const [layout, setLayout] = useState([
|
||||
// { i: '0', x: 0, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: !isEditable },
|
||||
// { i: '1', x: 3, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: !isEditable },
|
||||
// { i: '2', x: 6, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: !isEditable }
|
||||
// ]);
|
||||
const [originalLayout, setOriginalLayout] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -68,11 +63,6 @@ export function DashboardCanvas({ layout, setLayout, onLayoutChange }) {
|
||||
setLayout(prev => prev.filter(w => w.i !== id));
|
||||
}
|
||||
|
||||
// const onLayoutChange = (newLayout) => {
|
||||
// setLayout(newLayout);
|
||||
// console.log('Updated layout:', newLayout)
|
||||
// };
|
||||
|
||||
return (
|
||||
/* HEADER */
|
||||
<Tabs.Root lazyMount defaultValue="my dashboard">
|
||||
@@ -105,14 +95,6 @@ export function DashboardCanvas({ layout, setLayout, onLayoutChange }) {
|
||||
</Tabs.Trigger>
|
||||
</Tabs.List>
|
||||
|
||||
{/* <HStack >
|
||||
<SearchBar />
|
||||
<SettingsButton visible={isEditable}
|
||||
onAddWidget={ onAddWidget }
|
||||
onEditWidgets={ onEditWidgets }
|
||||
onDeleteWidgets={ onDeleteWidgets }
|
||||
/>
|
||||
</HStack> */}
|
||||
<HStack >
|
||||
{isEditable ? (
|
||||
<>
|
||||
|
||||
@@ -17,11 +17,6 @@ export default function Dashboard() {
|
||||
{ i: '2', x: 6, y: 0, w: 3, h: 3, minH: 3, minW: 1, static: true }
|
||||
]);
|
||||
|
||||
const onLayoutChange = (newLayout) => {
|
||||
setLayout(newLayout);
|
||||
console.log('Updated layout:', newLayout)
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Global // change the background color of widget shadow when moving
|
||||
|
||||
Reference in New Issue
Block a user