Update StorageActionProps to make max optional; adjust MaterialAnimator padding for improved layout consistency.

This commit is contained in:
Vishnu 2025-05-10 19:05:06 +05:30
parent 5369a97105
commit d30668e723
4 changed files with 5 additions and 6 deletions

View File

@ -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;

View File

@ -244,7 +244,6 @@ function StorageMechanics() {
value={currentCapacity}
defaultValue="0"
min={0}
max={20}
currentMaterialType={currentMaterialType}
handleCapacityChange={handleCapacityChange}
handleMaterialTypeChange={handleMaterialTypeChange}

View File

@ -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<MaterialAnimatorProps>) {
const sphereRef = useRef<any>(null);
const [isRendered, setIsRendered] = useState<boolean>(false);
@ -58,7 +58,7 @@ export default function MaterialAnimator({ ikSolver, armBot, currentPhase }: Mat
{isRendered && (
<MaterialModel
matRef={sphereRef}
materialType={armBot.currentAction?.materialType || 'Default material'}
materialType={armBot.currentAction?.materialType ?? 'Default material'}
/>
)}
</>

View File

@ -9,7 +9,7 @@ const MaterialAnimator = ({
const meshRef = useRef<any>(null!);
const [hasLoad, setHasLoad] = useState(false);
const { scene } = useThree();
const padding = 0;
const padding = 0.1;
useEffect(() => {
setHasLoad(storage.currentLoad > 0);