Added market place

This commit is contained in:
Nalvazhuthi 2025-03-26 17:00:37 +05:30
commit 5ffb952637
3 changed files with 22124 additions and 44152 deletions

66188
app/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -65,7 +65,7 @@ const Panel: React.FC<PanelProps> = ({
return {
width: `calc(100% - ${(leftActive ? panelSize : 0) + (rightActive ? panelSize : 0)
}px)`,
height: `${panelSize - 5}px`,
height: `${panelSize - 2}px`,
left: leftActive ? `${panelSize}px` : "0",
right: rightActive ? `${panelSize}px` : "0",
[side]: "0",
@ -73,7 +73,7 @@ const Panel: React.FC<PanelProps> = ({
case "left":
case "right":
return {
width: `${panelSize - 5}px`,
width: `${panelSize - 2}px`,
height: `calc(100% - ${(topActive ? panelSize : 0) + (bottomActive ? panelSize : 0)
}px)`,
top: topActive ? `${panelSize}px` : "0",

View File

@ -44,56 +44,56 @@ const RealTimeVisulization: React.FC = () => {
const [zonesData, setZonesData] = useState<FormattedZoneData>({});
const { selectedZone, setSelectedZone } = useSelectedZoneStore();
useEffect(() => {
async function GetZoneData() {
try {
const response: { data: Zone[] } | undefined = await getZonesApi(
"hexrfactory"
);
// useEffect(() => {
// async function GetZoneData() {
// try {
// const response: { data: Zone[] } | undefined = await getZonesApi(
// "hexrfactory"
// );
if (!response || !response.data) {
return;
}
const formattedData = response?.data?.reduce<FormattedZoneData>(
(acc, zone) => {
acc[zone.zoneName] = {
activeSides: [],
panelOrder: [],
lockedPanels: [],
zoneCentrePoint: [],
widgets: [],
};
return acc;
},
{}
);
setZonesData(formattedData);
} catch (error) { }
}
GetZoneData();
}, []);
// if (!response || !response.data) {
// return;
// }
// const formattedData = response?.data?.reduce<FormattedZoneData>(
// (acc, zone) => {
// acc[zone.zoneName] = {
// activeSides: [],
// panelOrder: [],
// lockedPanels: [],
// zoneCentrePoint: [],
// widgets: [],
// };
// return acc;
// },
// {}
// );
// setZonesData(formattedData);
// } catch (error) { }
// }
// GetZoneData();
// }, []);
useEffect(() => {
console.log('zonesData: ', zonesData);
}, [zonesData]);
useEffect(() => {
setZonesData((prev) => {
if (!selectedZone) return prev;
// useEffect(() => {
// setZonesData((prev) => {
// if (!selectedZone) return prev;
return {
...prev,
[selectedZone.zoneName]: {
...prev[selectedZone.zoneName], // Keep existing properties
activeSides: selectedZone.activeSides || [],
panelOrder: selectedZone.panelOrder || [],
lockedPanels: selectedZone.lockedPanels || [],
widgets: selectedZone.widgets || [],
},
};
});
}, [selectedZone]);
// return {
// ...prev,
// [selectedZone.zoneName]: {
// ...prev[selectedZone.zoneName], // Keep existing properties
// activeSides: selectedZone.activeSides || [],
// panelOrder: selectedZone.panelOrder || [],
// lockedPanels: selectedZone.lockedPanels || [],
// widgets: selectedZone.widgets || [],
// },
// };
// });
// }, [selectedZone]);
return (
<div