([]);
const email = localStorage.getItem('email')
- const organization = (email!.split("@")[1]).split(".")[0];
+ const organization = (email?.split("@")[1])?.split(".")[0] ?? null;
const updateBackend = (
productName: string,
@@ -214,7 +214,7 @@ function RotateControls({ rotatedObjects, setRotatedObjects, movedObjects, setMo
rotation: [obj.rotation.x, obj.rotation.y, obj.rotation.z],
})
- if (event) {
+ if (event && organization) {
updateBackend(
selectedProduct.productName,
selectedProduct.productId,
diff --git a/app/src/modules/visualization/RealTimeVisulization.tsx b/app/src/modules/visualization/RealTimeVisulization.tsx
index 23f2532..bbc996f 100644
--- a/app/src/modules/visualization/RealTimeVisulization.tsx
+++ b/app/src/modules/visualization/RealTimeVisulization.tsx
@@ -187,6 +187,7 @@ const RealTimeVisulization: React.FC = () => {
void; // Action to update toggleUI
+ toggleUILeft: boolean;
+ toggleUIRight: boolean;
+ setToggleUI: (value1: boolean, value2: boolean) => void;
}
const useToggleStore = create((set) => ({
- toggleUI: true, // Initial state
- setToggleUI: (value: boolean) => set({ toggleUI: value }), // Update the state
+ toggleUILeft: true,
+ toggleUIRight: false,
+ setToggleUI: (value1: boolean, value2: boolean) => {
+ set({ toggleUILeft: value1, toggleUIRight: value2 });
+ },
}));
export default useToggleStore;
diff --git a/app/src/styles/layout/sidebar.scss b/app/src/styles/layout/sidebar.scss
index 02c5c3a..9317bd6 100644
--- a/app/src/styles/layout/sidebar.scss
+++ b/app/src/styles/layout/sidebar.scss
@@ -1,6 +1,55 @@
@use "../abstracts/variables" as *;
@use "../abstracts/mixins" as *;
+.toggle-sidebar-ui-button {
+ @include flex-center;
+ cursor: pointer;
+ height: 32px;
+ width: 32px;
+ min-height: 32px;
+ min-width: 32px;
+ border-radius: #{$border-radius-large};
+ position: relative;
+
+ .tooltip {
+ top: 6px;
+ right: -168px;
+
+ &::after {
+ left: 0px;
+ bottom: 50%;
+ }
+ }
+
+ &:hover {
+ outline: 1px solid var(--border-color);
+ outline-offset: -1px;
+ background: var(--background-color-solid);
+
+ .tooltip {
+ opacity: 1;
+ transform: translateX(2px);
+ }
+ }
+}
+
+.toggle-sidebar-ui-button.active {
+ background: var(--background-color-accent);
+
+ rect {
+ stroke: var(--icon-default-color-active);
+ }
+
+ circle {
+ fill: var(--icon-default-color-active);
+ }
+
+ &:hover {
+ filter: saturate(0.8);
+ background: var(--background-color-accent);
+ }
+}
+
.sidebar-left-wrapper {
width: 270px;
position: fixed;
@@ -34,15 +83,6 @@
}
.toggle-sidebar-ui-button {
- @include flex-center;
- cursor: pointer;
- height: 32px;
- width: 32px;
- min-height: 32px;
- min-width: 32px;
- border-radius: #{$border-radius-large};
- position: relative;
-
.tooltip {
top: 6px;
right: -168px;
@@ -52,34 +92,6 @@
bottom: 50%;
}
}
-
- &:hover {
- outline: 1px solid var(--border-color);
- outline-offset: -1px;
- background: var(--background-color-solid);
-
- .tooltip {
- opacity: 1;
- transform: translateX(2px);
- }
- }
- }
-
- .active {
- background: var(--background-color-accent);
-
- rect {
- stroke: var(--icon-default-color-active);
- }
-
- circle {
- fill: var(--icon-default-color-active);
- }
-
- &:hover {
- filter: saturate(0.8);
- background: var(--background-color-accent);
- }
}
}
@@ -295,7 +307,7 @@
padding: 10px;
padding-left: 16px;
width: 100%;
- gap: 12px;
+ gap: 8px;
height: 52px;
.options-container {
@@ -318,7 +330,7 @@
.split {
height: 20px;
- width: 2px;
+ min-width: 1px;
background: var(--text-disabled);
}
@@ -1166,8 +1178,7 @@
height: 100%;
width: 1px;
position: absolute;
- color: var(--text-color);
- opacity: 0.4;
+ color: var(--accent-color);
font-size: var(--font-size-regular);
outline-offset: -1px;
top: 0;
@@ -1431,6 +1442,18 @@
}
}
}
+ .toggle-sidebar-ui-button {
+ svg {
+ transform: scaleX(-1);
+ }
+ .tooltip {
+ right: 56px;
+ &::after {
+ left: 100%;
+ bottom: 50%;
+ }
+ }
+ }
}
.assets-container-main {
@@ -1598,7 +1621,11 @@
height: 100%;
gap: 6px;
padding: 2px;
-
+ .no-asset {
+ text-align: center;
+ margin: 12px;
+ width: 100%;
+ }
.assets {
width: 122px;
height: 95px;
@@ -1655,20 +1682,6 @@
}
}
-.skeleton-wrapper {
- display: flex;
-
- .asset-name {
- width: 40%;
- height: 10px;
- }
-
- .asset {
- width: 100%;
- height: 100%;
- }
-}
-
.sidebar-left-wrapper,
.sidebar-right-wrapper {
transition: height 0.2s ease-in-out;
diff --git a/app/src/styles/layout/skeleton.scss b/app/src/styles/layout/skeleton.scss
index 9df0331..9dbc069 100644
--- a/app/src/styles/layout/skeleton.scss
+++ b/app/src/styles/layout/skeleton.scss
@@ -1,61 +1,90 @@
.skeleton-wrapper {
- // max-width: 600px;
- margin: 0 auto;
- width: 100%;
+ margin: 0 auto;
+ width: 100%;
- .skeleton {
- background: var(--background-color-gray);
+ .skeleton {
+ background: var(--background-color-gray);
- border-radius: 8px;
- position: relative;
- overflow: hidden;
+ border-radius: 8px;
+ position: relative;
+ overflow: hidden;
- &::after {
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-image: linear-gradient(90deg,
- rgba(255, 255, 255, 0) 0%,
- rgba(255, 255, 255, 0.2) 20%,
- rgba(255, 255, 255, 0.5) 60%,
- rgba(255, 255, 255, 0) 100%);
- transform: translateX(-100%);
- animation: shimmer 1.5s infinite;
- }
+ &::after {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-image: linear-gradient(
+ 90deg,
+ rgba(255, 255, 255, 0) 0%,
+ rgba(255, 255, 255, 0.2) 20%,
+ rgba(255, 255, 255, 0.39) 60%,
+ rgba(255, 255, 255, 0) 100%
+ );
+ transform: translateX(-100%);
+ animation: shimmer 1.5s infinite;
+ }
+ }
+
+ .skeleton-header {
+ margin-bottom: 20px;
+
+ .skeleton-title {
+ width: 100%;
+ height: 25px;
+ margin-bottom: 12px;
}
- .skeleton-header {
- margin-bottom: 20px;
-
- .skeleton-title {
- width: 100%;
- height: 25px;
- margin-bottom: 12px;
- }
-
- .skeleton-subtitle {
- width: 100%;
- height: 4px;
- }
+ .skeleton-subtitle {
+ width: 100%;
+ height: 4px;
}
+ }
- .skeleton-content {
- display: flex;
- flex-direction: column;
- gap: 16px;
+ .skeleton-content {
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
- .skeleton-card {
- width: 100%;
- height: 15px;
- }
+ .skeleton-card {
+ width: 100%;
+ height: 15px;
}
+ }
+}
+
+.asset-category-title{
+ width: 60%;
+ height: 12px;
+ margin-bottom: 12px;
+ margin-top: 4px;
+}
+.skeleton-content-asset{
+ display: flex;
+ height: calc(95px * 2 + 10px);
+ gap: 10px;
+ flex-wrap: wrap;
+ .skeleton-content {
+ gap: 8px;
+ flex-direction: column;
+ min-width: 122px;
+ min-height: 95px;
+ .asset-name {
+ width: 40%;
+ height: 10px;
+ }
+ .asset {
+ flex: 1;
+ width: 100%;
+ height: 100%;
+ }
+ }
}
@keyframes shimmer {
- 100% {
- transform: translateX(100%);
- }
-}
\ No newline at end of file
+ 100% {
+ transform: translateX(100%);
+ }
+}
diff --git a/app/src/types/world/worldConstants.ts b/app/src/types/world/worldConstants.ts
index 0374c8a..aaa8466 100644
--- a/app/src/types/world/worldConstants.ts
+++ b/app/src/types/world/worldConstants.ts
@@ -326,7 +326,7 @@ export const lineConfig: LineConfig = {
};
export const wallConfig: WallConfig = {
- defaultColor: "white", // Default color of the walls
+ defaultColor: "#f2f2f2", // Default color of the walls
height: 7, // Height of the walls
width: 0.05, // Width of the walls
};
@@ -334,7 +334,7 @@ export const wallConfig: WallConfig = {
export const floorConfig: FloorConfig = {
defaultColor: "grey", // Default color of the floors
height: 0.1, // Height of the floors
- textureScale: 0.1, // Scale of the floor texture
+ textureScale: 1, // Scale of the floor texture
};
export const roofConfig: RoofConfig = {
@@ -345,7 +345,7 @@ export const roofConfig: RoofConfig = {
export const aisleConfig: AisleConfig = {
width: 0.1, // Width of the aisles
height: 0.01, // Height of the aisles
- defaultColor: 0xffff00, // Default color of the aisles
+ defaultColor: 0xE2AC09, // Default color of the aisles
};
export const zoneConfig: ZoneConfig = {
diff --git a/app/src/utils/shortcutkeys/handleShortcutKeys.ts b/app/src/utils/shortcutkeys/handleShortcutKeys.ts
index 2ff5f39..c3346b8 100644
--- a/app/src/utils/shortcutkeys/handleShortcutKeys.ts
+++ b/app/src/utils/shortcutkeys/handleShortcutKeys.ts
@@ -17,7 +17,7 @@ import { useSelectedZoneStore } from "../../store/visualization/useZoneStore";
const KeyPressListener: React.FC = () => {
const { activeModule, setActiveModule } = useModuleStore();
const { setActiveSubTool } = useActiveSubTool();
- const { toggleUI, setToggleUI } = useToggleStore();
+ const { toggleUILeft, toggleUIRight, setToggleUI } = useToggleStore();
const { setToggleThreeD } = useThreeDStore();
const { setToolMode } = useToolMode();
const { setIsPlaying } = usePlayButtonStore();
@@ -26,7 +26,7 @@ const KeyPressListener: React.FC = () => {
const { setAddAction } = useAddAction();
const { setSelectedWallItem } = useSelectedWallItem();
const { setActiveTool } = useActiveTool();
- const { clearSelectedZone} = useSelectedZoneStore();
+ const { clearSelectedZone } = useSelectedZoneStore();
const isTextInput = (element: Element | null): boolean =>
element instanceof HTMLInputElement ||
@@ -42,9 +42,10 @@ const KeyPressListener: React.FC = () => {
};
const module = modules[keyCombination];
if (module && !toggleView) {
+ console.log("hi");
setActiveTool("cursor");
setActiveSubTool("cursor");
- if (module === "market") setToggleUI(false);
+ if (module === "market") setToggleUI(false, false);
setActiveModule(module);
}
};
@@ -69,6 +70,7 @@ const KeyPressListener: React.FC = () => {
const toggleTo2D = toggleView;
setToggleView(!toggleTo2D);
setToggleThreeD(toggleTo2D);
+ setToggleUI(toggleTo2D, toggleTo2D);
if (toggleTo2D) {
setSelectedWallItem(null);
setDeleteTool(false);
@@ -105,6 +107,29 @@ const KeyPressListener: React.FC = () => {
};
+ const handleSidebarShortcuts = (key: string) => {
+ if (activeModule !== "market") {
+ if (key === "Ctrl+\\") {
+ if (toggleUILeft === toggleUIRight) {
+ setToggleUI(!toggleUILeft, !toggleUIRight);
+ }
+ else {
+ setToggleUI(true, true);
+ }
+ return;
+ }
+ if (key === "Ctrl+]") {
+ setToggleUI(toggleUILeft, !toggleUIRight);
+ return;
+ }
+ if (key === "Ctrl+[") {
+ setToggleUI(!toggleUILeft, toggleUIRight);
+ return;
+ }
+ }
+ }
+
+
const handleKeyPress = (event: KeyboardEvent) => {
if (isTextInput(document.activeElement)) return;
@@ -113,11 +138,8 @@ const KeyPressListener: React.FC = () => {
event.preventDefault();
- if (keyCombination === "Ctrl+\\") {
- if (activeModule !== "market") setToggleUI(!toggleUI);
- return;
- }
-
+ // Shortcuts specific for sidebar visibility toggle and others specific to sidebar if added
+ handleSidebarShortcuts(keyCombination);
// Active module selection (builder, simulation, etc.)
handleModuleSwitch(keyCombination);
// Common editing tools: cursor | delete | free-hand
@@ -132,6 +154,7 @@ const KeyPressListener: React.FC = () => {
if (keyCombination === "ESCAPE") {
setActiveTool("cursor");
+ setActiveSubTool("cursor");
setIsPlaying(false);
clearSelectedZone();
}
@@ -146,7 +169,7 @@ const KeyPressListener: React.FC = () => {
window.addEventListener("keydown", handleKeyPress);
return () => window.removeEventListener("keydown", handleKeyPress);
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [activeModule, toggleUI, toggleView]);
+ }, [activeModule, toggleUIRight, toggleUILeft, toggleView]);
return null;
};
diff --git a/app/src/utils/theme.ts b/app/src/utils/theme.ts
index 9395129..541f4ba 100644
--- a/app/src/utils/theme.ts
+++ b/app/src/utils/theme.ts
@@ -4,7 +4,7 @@ export { };
function setTheme() {
const savedTheme: string | null = localStorage.getItem('theme');
const systemPrefersDark: boolean = window.matchMedia('(prefers-color-scheme: dark)').matches;
- const defaultTheme: string = savedTheme || (systemPrefersDark ? 'dark' : 'light');
+ const defaultTheme: string = savedTheme ?? (systemPrefersDark ? 'dark' : 'light');
document.documentElement.setAttribute('data-theme', defaultTheme);
localStorage.setItem('theme', defaultTheme);
}