From d30668e723590f1b08969ac4c37d7ba1a6e526ca Mon Sep 17 00:00:00 2001 From: Vishnu Date: Sat, 10 May 2025 19:05:06 +0530 Subject: [PATCH] Update StorageActionProps to make max optional; adjust MaterialAnimator padding for improved layout consistency. --- .../properties/eventProperties/actions/StorageAction.tsx | 2 +- .../eventProperties/mechanics/storageMechanics.tsx | 1 - .../roboticArm/instances/animator/materialAnimator.tsx | 6 +++--- .../storageUnit/instances/animator/MaterialAnimator.tsx | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/components/layout/sidebarRight/properties/eventProperties/actions/StorageAction.tsx b/app/src/components/layout/sidebarRight/properties/eventProperties/actions/StorageAction.tsx index b9dee0b..5fd62df 100644 --- a/app/src/components/layout/sidebarRight/properties/eventProperties/actions/StorageAction.tsx +++ b/app/src/components/layout/sidebarRight/properties/eventProperties/actions/StorageAction.tsx @@ -6,7 +6,7 @@ interface StorageActionProps { type: "store" | "spawn" | "default"; value: string; min: number; - max: number; + max?: number; defaultValue: string; currentMaterialType: string; handleCapacityChange: (value: string) => void; diff --git a/app/src/components/layout/sidebarRight/properties/eventProperties/mechanics/storageMechanics.tsx b/app/src/components/layout/sidebarRight/properties/eventProperties/mechanics/storageMechanics.tsx index 3a57cfe..564a53f 100644 --- a/app/src/components/layout/sidebarRight/properties/eventProperties/mechanics/storageMechanics.tsx +++ b/app/src/components/layout/sidebarRight/properties/eventProperties/mechanics/storageMechanics.tsx @@ -244,7 +244,6 @@ function StorageMechanics() { value={currentCapacity} defaultValue="0" min={0} - max={20} currentMaterialType={currentMaterialType} handleCapacityChange={handleCapacityChange} handleMaterialTypeChange={handleMaterialTypeChange} diff --git a/app/src/modules/simulation/roboticArm/instances/animator/materialAnimator.tsx b/app/src/modules/simulation/roboticArm/instances/animator/materialAnimator.tsx index 7ba6148..83745aa 100644 --- a/app/src/modules/simulation/roboticArm/instances/animator/materialAnimator.tsx +++ b/app/src/modules/simulation/roboticArm/instances/animator/materialAnimator.tsx @@ -1,5 +1,5 @@ import { useFrame } from '@react-three/fiber'; -import React, { useEffect, useRef, useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; import * as THREE from 'three'; import { MaterialModel } from '../../../materials/instances/material/materialModel'; @@ -9,7 +9,7 @@ type MaterialAnimatorProps = { currentPhase: string; }; -export default function MaterialAnimator({ ikSolver, armBot, currentPhase }: MaterialAnimatorProps) { +export default function MaterialAnimator({ ikSolver, armBot, currentPhase }: Readonly) { const sphereRef = useRef(null); const [isRendered, setIsRendered] = useState(false); @@ -58,7 +58,7 @@ export default function MaterialAnimator({ ikSolver, armBot, currentPhase }: Mat {isRendered && ( )} diff --git a/app/src/modules/simulation/storageUnit/instances/animator/MaterialAnimator.tsx b/app/src/modules/simulation/storageUnit/instances/animator/MaterialAnimator.tsx index 39b34b3..4ddc374 100644 --- a/app/src/modules/simulation/storageUnit/instances/animator/MaterialAnimator.tsx +++ b/app/src/modules/simulation/storageUnit/instances/animator/MaterialAnimator.tsx @@ -9,7 +9,7 @@ const MaterialAnimator = ({ const meshRef = useRef(null!); const [hasLoad, setHasLoad] = useState(false); const { scene } = useThree(); - const padding = 0; + const padding = 0.1; useEffect(() => { setHasLoad(storage.currentLoad > 0);