refactor: rename position handlers to startPoint and endPoint for clarity; update toggle UI logic to use localStorage

This commit is contained in:
2025-03-29 13:57:39 +05:30
parent 1cca51e652
commit c2dc898d53
3 changed files with 18 additions and 26 deletions

View File

@@ -62,11 +62,7 @@ const Tools: React.FC = () => {
// Reset activeTool whenever activeModule changes
useEffect(() => {
const storedNavBar: any = localStorage.getItem("navBarUi");
if (storedNavBar) {
const parsedNavBar = JSON.parse(storedNavBar);
setToggleUI(parsedNavBar);
}
setToggleUI(localStorage.getItem('navBarUi') ? localStorage.getItem('navBarUi') === 'true' : true)
}, []);
useEffect(() => {
@@ -228,9 +224,8 @@ const Tools: React.FC = () => {
)}
{activeSubTool == "delete" && (
<div
className={`tool-button ${
activeTool === "delete" ? "active" : ""
}`}
className={`tool-button ${activeTool === "delete" ? "active" : ""
}`}
onClick={() => {
setActiveTool("delete");
}}
@@ -349,9 +344,8 @@ const Tools: React.FC = () => {
<div className="split"></div>
<div className="draw-tools">
<div
className={`tool-button ${
activeTool === "measure" ? "active" : ""
}`}
className={`tool-button ${activeTool === "measure" ? "active" : ""
}`}
onClick={() => {
setActiveTool("measure");
}}
@@ -410,9 +404,8 @@ const Tools: React.FC = () => {
</div>
{toggleThreeD && (
<div
className={`tool-button ${
activeTool === "play" ? "active" : ""
}`}
className={`tool-button ${activeTool === "play" ? "active" : ""
}`}
onClick={() => {
setIsPlaying(!isPlaying);
}}