Skip to content

Commit

Permalink
refactor: display the add button when there are no assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed May 2, 2024
1 parent 8ca43e0 commit cdc0586
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/component/2d/zones/Zone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ interface ZoneProps {
}

function Zone({ zoneData }: ZoneProps) {
const { x, y, id, signals } = zoneData;
const { x, y, id, signals, assignment } = zoneData;
const { setData } = useShareData<{ id: string }>();
const assignmentZone = useAssignment(id);
const { showZones } = useActiveSpectrumZonesViewState();
Expand Down Expand Up @@ -106,13 +106,15 @@ function Zone({ zoneData }: ZoneProps) {
transform="translate(-16 -16)"
className="target"
>
<SVGButton
icon="plus"
backgroundColor="green"
title="Add assignment label"
style={{ cursor: 'hand' }}
onClick={() => setData({ id })}
/>
{!assignment && (
<SVGButton
icon="plus"
backgroundColor="green"
title="Add assignment label"
style={{ cursor: 'hand' }}
onClick={() => setData({ id })}
/>
)}
</g>
<rect
x="0"
Expand Down

0 comments on commit cdc0586

Please sign in to comment.