Skip to content

Commit

Permalink
Hide selection/resize border for locked items
Browse files Browse the repository at this point in the history
  • Loading branch information
raimohanska committed Oct 17, 2023
1 parent 5474175 commit 3d2ca08
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions frontend/src/board/SelectionBorder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Board, Container } from "../../../common/src/domain"
import { BoardFocus } from "./board-focus"
import { onBoardItemDrag } from "./item-drag"
import { Dispatch } from "../store/board-store"
import { canMove } from "./board-permissions"

type Horizontal = "left" | "right"
type Vertical = "top" | "bottom"
Expand Down Expand Up @@ -34,14 +35,16 @@ export const SelectionBorder = ({
}
})

return (
<span className="selection-control" style={style}>
<span className="corner-resize-drag top left"></span>
<DragCorner {...{ horizontal: "left", vertical: "top" }} />
<DragCorner {...{ horizontal: "left", vertical: "bottom" }} />
<DragCorner {...{ horizontal: "right", vertical: "top" }} />
<DragCorner {...{ horizontal: "right", vertical: "bottom" }} />
</span>
return L.view(item, canMove, (m) =>
m ? (
<span className="selection-control" style={style}>
<span className="corner-resize-drag top left"></span>
<DragCorner {...{ horizontal: "left", vertical: "top" }} />
<DragCorner {...{ horizontal: "left", vertical: "bottom" }} />
<DragCorner {...{ horizontal: "right", vertical: "top" }} />
<DragCorner {...{ horizontal: "right", vertical: "bottom" }} />
</span>
) : null,
)

function DragCorner({ vertical, horizontal }: { vertical: Vertical; horizontal: Horizontal }) {
Expand Down

0 comments on commit 3d2ca08

Please sign in to comment.