Skip to content

Commit 1c2dfa0

Browse files
committed
chore: sonarqube issues fix
1 parent 7ee77b9 commit 1c2dfa0

File tree

6 files changed

+26
-73
lines changed

6 files changed

+26
-73
lines changed

code/components/room-components/overlay/hooks/use-images-tools.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export const useImagesTools = () => {
4040
}
4141
if (instance && actualAction === toolName) {
4242
instance.cancelAction(toolName);
43-
return;
4443
}
4544
},
4645
[instance, actualAction]

code/components/room-components/overlay/hooks/use-shapes-tools.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export const useShapesTools = () => {
2020
}
2121
if (instance && actualAction === toolName) {
2222
instance.cancelAction(toolName);
23-
return;
2423
}
2524
},
2625
[instance, actualAction]

code/components/room-components/overlay/hooks/use-strokes-tools.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export const useStrokesTools = () => {
2020
}
2121
if (instance && actualAction === toolName) {
2222
instance.cancelAction(toolName);
23-
return;
2423
}
2524
},
2625
[instance, actualAction]

code/components/room-components/overlay/tools-overlay.mouse.tsx

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ export function ToolsOverlayMouse() {
130130
}
131131
if (instance && actualAction === toolName) {
132132
instance.cancelAction(toolName);
133-
return;
134133
}
135134
},
136135
[instance, actualAction]
@@ -351,9 +350,7 @@ export function ToolsOverlayMouse() {
351350
}}
352351
>
353352
<Square size={20} strokeWidth={1} /> Rectangle tool
354-
<DropdownMenuShortcut>
355-
{SYSTEM_OS.MAC ? "R" : "R"}
356-
</DropdownMenuShortcut>
353+
<DropdownMenuShortcut>R</DropdownMenuShortcut>
357354
</DropdownMenuItem>
358355
<DropdownMenuItem
359356
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -363,9 +360,7 @@ export function ToolsOverlayMouse() {
363360
}}
364361
>
365362
<Circle size={20} strokeWidth={1} /> Ellipse tool
366-
<DropdownMenuShortcut>
367-
{SYSTEM_OS.MAC ? "E" : "E"}
368-
</DropdownMenuShortcut>
363+
<DropdownMenuShortcut>E</DropdownMenuShortcut>
369364
</DropdownMenuItem>
370365
<DropdownMenuItem
371366
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -375,9 +370,7 @@ export function ToolsOverlayMouse() {
375370
}}
376371
>
377372
<Hexagon size={20} strokeWidth={1} /> Regular Polygon tool
378-
<DropdownMenuShortcut>
379-
{SYSTEM_OS.MAC ? "P" : "P"}
380-
</DropdownMenuShortcut>
373+
<DropdownMenuShortcut>P</DropdownMenuShortcut>
381374
</DropdownMenuItem>
382375
<DropdownMenuItem
383376
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -387,9 +380,7 @@ export function ToolsOverlayMouse() {
387380
}}
388381
>
389382
<Star size={20} strokeWidth={1} /> Star tool
390-
<DropdownMenuShortcut>
391-
{SYSTEM_OS.MAC ? "J" : "J"}
392-
</DropdownMenuShortcut>
383+
<DropdownMenuShortcut>J</DropdownMenuShortcut>
393384
</DropdownMenuItem>
394385
<DropdownMenuItem
395386
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -399,9 +390,7 @@ export function ToolsOverlayMouse() {
399390
}}
400391
>
401392
<Tags size={20} strokeWidth={1} /> Color Token Reference tool
402-
<DropdownMenuShortcut>
403-
{SYSTEM_OS.MAC ? "K" : "K"}
404-
</DropdownMenuShortcut>
393+
<DropdownMenuShortcut>K</DropdownMenuShortcut>
405394
</DropdownMenuItem>
406395
</DropdownMenuContent>
407396
</DropdownMenu>
@@ -490,9 +479,7 @@ export function ToolsOverlayMouse() {
490479
}}
491480
>
492481
<PenTool size={20} strokeWidth={1} /> Pen tool
493-
<DropdownMenuShortcut>
494-
{SYSTEM_OS.MAC ? "L" : "L"}
495-
</DropdownMenuShortcut>
482+
<DropdownMenuShortcut>L</DropdownMenuShortcut>
496483
</DropdownMenuItem>
497484
<DropdownMenuItem
498485
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -502,9 +489,7 @@ export function ToolsOverlayMouse() {
502489
}}
503490
>
504491
<Brush size={20} strokeWidth={1} /> Brush tool
505-
<DropdownMenuShortcut>
506-
{SYSTEM_OS.MAC ? "B" : "B"}
507-
</DropdownMenuShortcut>
492+
<DropdownMenuShortcut>B</DropdownMenuShortcut>
508493
</DropdownMenuItem>
509494
<DropdownMenuItem
510495
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -514,9 +499,7 @@ export function ToolsOverlayMouse() {
514499
}}
515500
>
516501
<ArrowUpRight size={20} strokeWidth={1} /> Arrow tool
517-
<DropdownMenuShortcut>
518-
{SYSTEM_OS.MAC ? "A" : "A"}
519-
</DropdownMenuShortcut>
502+
<DropdownMenuShortcut>A</DropdownMenuShortcut>
520503
</DropdownMenuItem>
521504
</DropdownMenuContent>
522505
</DropdownMenu>
@@ -607,9 +590,7 @@ export function ToolsOverlayMouse() {
607590
>
608591
{/* eslint-disable-next-line jsx-a11y/alt-text */}
609592
<Image size={20} strokeWidth={1} /> Image tool
610-
<DropdownMenuShortcut>
611-
{SYSTEM_OS.MAC ? "I" : "I"}
612-
</DropdownMenuShortcut>
593+
<DropdownMenuShortcut>I</DropdownMenuShortcut>
613594
</DropdownMenuItem>
614595
<DropdownMenuItem
615596
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -620,9 +601,7 @@ export function ToolsOverlayMouse() {
620601
}}
621602
>
622603
<Images size={20} strokeWidth={1} /> Images tool
623-
<DropdownMenuShortcut>
624-
{SYSTEM_OS.MAC ? "O" : "O"}
625-
</DropdownMenuShortcut>
604+
<DropdownMenuShortcut>O</DropdownMenuShortcut>
626605
</DropdownMenuItem>
627606
<DropdownMenuItem
628607
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -638,9 +617,7 @@ export function ToolsOverlayMouse() {
638617
}}
639618
>
640619
<ImagePlus size={20} strokeWidth={1} /> Generate Image tool
641-
<DropdownMenuShortcut>
642-
{SYSTEM_OS.MAC ? "G" : "G"}
643-
</DropdownMenuShortcut>
620+
<DropdownMenuShortcut>G</DropdownMenuShortcut>
644621
</DropdownMenuItem>
645622
</DropdownMenuContent>
646623
</DropdownMenu>

code/components/room-components/overlay/tools-overlay.touch.tsx

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ export function ToolsOverlayTouch() {
130130
}
131131
if (instance && actualAction === toolName) {
132132
instance.cancelAction(toolName);
133-
return;
134133
}
135134
},
136135
[instance, actualAction]
@@ -562,22 +561,17 @@ export function ToolsOverlayTouch() {
562561
>
563562
{/* eslint-disable-next-line jsx-a11y/alt-text */}
564563
<Image size={20} strokeWidth={1} /> Image tool
565-
<DropdownMenuShortcut>
566-
{SYSTEM_OS.MAC ? "I" : "I"}
567-
</DropdownMenuShortcut>
564+
<DropdownMenuShortcut>I</DropdownMenuShortcut>
568565
</DropdownMenuItem>
569566
<DropdownMenuItem
570567
className="text-foreground cursor-pointer hover:rounded-none w-full"
571568
onClick={() => {
572569
setActualImagesTool("imagesTool");
573570
setShowSelectFilesImages(true);
574-
// triggerTool("imagesTool");
575571
}}
576572
>
577573
<Images size={20} strokeWidth={1} /> Images tool
578-
<DropdownMenuShortcut>
579-
{SYSTEM_OS.MAC ? "O" : "O"}
580-
</DropdownMenuShortcut>
574+
<DropdownMenuShortcut>O</DropdownMenuShortcut>
581575
</DropdownMenuItem>
582576
<DropdownMenuItem
583577
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -593,9 +587,7 @@ export function ToolsOverlayTouch() {
593587
}}
594588
>
595589
<ImagePlus size={20} strokeWidth={1} /> Generate Image tool
596-
<DropdownMenuShortcut>
597-
{SYSTEM_OS.MAC ? "G" : "G"}
598-
</DropdownMenuShortcut>
590+
<DropdownMenuShortcut>G</DropdownMenuShortcut>
599591
</DropdownMenuItem>
600592
</DropdownMenuContent>
601593
</DropdownMenu>
@@ -687,9 +679,7 @@ export function ToolsOverlayTouch() {
687679
}}
688680
>
689681
<PenTool size={20} strokeWidth={1} /> Pen tool
690-
<DropdownMenuShortcut>
691-
{SYSTEM_OS.MAC ? "L" : "L"}
692-
</DropdownMenuShortcut>
682+
<DropdownMenuShortcut>L</DropdownMenuShortcut>
693683
</DropdownMenuItem>
694684
<DropdownMenuItem
695685
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -703,9 +693,7 @@ export function ToolsOverlayTouch() {
703693
}}
704694
>
705695
<Brush size={20} strokeWidth={1} /> Brush tool
706-
<DropdownMenuShortcut>
707-
{SYSTEM_OS.MAC ? "B" : "B"}
708-
</DropdownMenuShortcut>
696+
<DropdownMenuShortcut>B</DropdownMenuShortcut>
709697
</DropdownMenuItem>
710698
<DropdownMenuItem
711699
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -719,9 +707,7 @@ export function ToolsOverlayTouch() {
719707
}}
720708
>
721709
<ArrowUpRight size={20} strokeWidth={1} /> Arrow tool
722-
<DropdownMenuShortcut>
723-
{SYSTEM_OS.MAC ? "A" : "A"}
724-
</DropdownMenuShortcut>
710+
<DropdownMenuShortcut>A</DropdownMenuShortcut>
725711
</DropdownMenuItem>
726712
</DropdownMenuContent>
727713
</DropdownMenu>
@@ -813,9 +799,7 @@ export function ToolsOverlayTouch() {
813799
}}
814800
>
815801
<Square size={20} strokeWidth={1} /> Rectangle tool
816-
<DropdownMenuShortcut>
817-
{SYSTEM_OS.MAC ? "R" : "R"}
818-
</DropdownMenuShortcut>
802+
<DropdownMenuShortcut>R</DropdownMenuShortcut>
819803
</DropdownMenuItem>
820804
<DropdownMenuItem
821805
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -829,9 +813,7 @@ export function ToolsOverlayTouch() {
829813
}}
830814
>
831815
<Circle size={20} strokeWidth={1} /> Ellipse tool
832-
<DropdownMenuShortcut>
833-
{SYSTEM_OS.MAC ? "E" : "E"}
834-
</DropdownMenuShortcut>
816+
<DropdownMenuShortcut>E</DropdownMenuShortcut>
835817
</DropdownMenuItem>
836818
<DropdownMenuItem
837819
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -845,9 +827,7 @@ export function ToolsOverlayTouch() {
845827
}}
846828
>
847829
<Hexagon size={20} strokeWidth={1} /> Regular Polygon tool
848-
<DropdownMenuShortcut>
849-
{SYSTEM_OS.MAC ? "P" : "P"}
850-
</DropdownMenuShortcut>
830+
<DropdownMenuShortcut>P</DropdownMenuShortcut>
851831
</DropdownMenuItem>
852832
<DropdownMenuItem
853833
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -861,9 +841,7 @@ export function ToolsOverlayTouch() {
861841
}}
862842
>
863843
<Star size={20} strokeWidth={1} /> Star tool
864-
<DropdownMenuShortcut>
865-
{SYSTEM_OS.MAC ? "J" : "J"}
866-
</DropdownMenuShortcut>
844+
<DropdownMenuShortcut>J</DropdownMenuShortcut>
867845
</DropdownMenuItem>
868846
<DropdownMenuItem
869847
className="text-foreground cursor-pointer hover:rounded-none w-full"
@@ -877,9 +855,7 @@ export function ToolsOverlayTouch() {
877855
}}
878856
>
879857
<Tags size={20} strokeWidth={1} /> Color Token Reference tool
880-
<DropdownMenuShortcut>
881-
{SYSTEM_OS.MAC ? "K" : "K"}
882-
</DropdownMenuShortcut>
858+
<DropdownMenuShortcut>K</DropdownMenuShortcut>
883859
</DropdownMenuItem>
884860
</DropdownMenuContent>
885861
</DropdownMenu>

code/components/room-components/overlay/tools-triggers/move-tool.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// SPDX-FileCopyrightText: 2025 2025 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.)
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
15
import React from "react";
26
import { useWeave } from "@inditextech/weave-react";
37
import { useIACapabilities } from "@/store/ia";
@@ -32,7 +36,6 @@ export const MoveToolTrigger = ({
3236
}
3337
if (instance && actualAction === toolName) {
3438
instance.cancelAction(toolName);
35-
return;
3639
}
3740
},
3841
[instance, actualAction]

0 commit comments

Comments
 (0)