refactor: improve formatting and readability in ShortcutHelper, DisplayZone, and KeyPressListener components
This commit is contained in:
@@ -326,8 +326,7 @@ const ShortcutHelper: React.FC<ShortcutHelperProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={`shortcut-wrapper ${
|
className={`shortcut-wrapper ${activeShortcuts.length === 1 ? "single-item" : ""
|
||||||
activeShortcuts.length === 1 ? "single-item" : ""
|
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{activeShortcuts.map((item) => (
|
{activeShortcuts.map((item) => (
|
||||||
|
|||||||
@@ -241,10 +241,8 @@ const DisplayZone: React.FC<DisplayZoneProps> = ({
|
|||||||
{Object.keys(zonesData).length !== 0 ? (
|
{Object.keys(zonesData).length !== 0 ? (
|
||||||
<>
|
<>
|
||||||
{Object.values(zonesData).map((zone, index) => (
|
{Object.values(zonesData).map((zone, index) => (
|
||||||
<>
|
|
||||||
{ }
|
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={`${index}_${zone.zoneName}`}
|
||||||
className={`zone ${selectedZone.zoneUuid === zone.zoneUuid ? "active" : ""
|
className={`zone ${selectedZone.zoneUuid === zone.zoneUuid ? "active" : ""
|
||||||
}`}
|
}`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -255,7 +253,6 @@ const DisplayZone: React.FC<DisplayZoneProps> = ({
|
|||||||
>
|
>
|
||||||
{zone.zoneName}
|
{zone.zoneName}
|
||||||
</div>
|
</div>
|
||||||
</>
|
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -221,8 +221,12 @@ const KeyPressListener: React.FC = () => {
|
|||||||
|
|
||||||
// Shortcuts specific for sidebar visibility toggle and others specific to sidebar if added
|
// Shortcuts specific for sidebar visibility toggle and others specific to sidebar if added
|
||||||
handleSidebarShortcuts(keyCombination);
|
handleSidebarShortcuts(keyCombination);
|
||||||
|
|
||||||
|
|
||||||
// Active module selection (builder, simulation, etc.)
|
// Active module selection (builder, simulation, etc.)
|
||||||
|
if (event.location === 0) { // Location 0 = standard keyboard (not numpad)
|
||||||
handleModuleSwitch(keyCombination);
|
handleModuleSwitch(keyCombination);
|
||||||
|
}
|
||||||
// Common editing tools: cursor | delete | free-hand
|
// Common editing tools: cursor | delete | free-hand
|
||||||
handlePrimaryTools(keyCombination);
|
handlePrimaryTools(keyCombination);
|
||||||
// Shortcuts specific to the builder module (e.g., drawing and measurement tools)
|
// Shortcuts specific to the builder module (e.g., drawing and measurement tools)
|
||||||
|
|||||||
Reference in New Issue
Block a user