mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Add and use clsx (classnames alternative) (#2249)
Co-authored-by: David Luzar <luzar.david@gmail.com>
This commit is contained in:
parent
1484c5a63b
commit
b50c54f855
18 changed files with 108 additions and 72 deletions
|
@ -1,4 +1,5 @@
|
|||
import React, { useRef, useEffect, useState } from "react";
|
||||
import clsx from "clsx";
|
||||
import { exportToSvg } from "../scene/export";
|
||||
import { close } from "../components/icons";
|
||||
|
||||
|
@ -63,16 +64,16 @@ export const LibraryUnit = ({
|
|||
|
||||
return (
|
||||
<div
|
||||
className={`library-unit ${
|
||||
elements || pendingElements ? "library-unit__active" : ""
|
||||
}`}
|
||||
className={clsx("library-unit", {
|
||||
"library-unit__active": elements || pendingElements,
|
||||
})}
|
||||
onMouseEnter={() => setIsHovered(true)}
|
||||
onMouseLeave={() => setIsHovered(false)}
|
||||
>
|
||||
<div
|
||||
className={`library-unit__dragger ${
|
||||
!!pendingElements ? "library-unit__pulse" : ""
|
||||
}`}
|
||||
className={clsx("library-unit__dragger", {
|
||||
"library-unit__pulse": !!pendingElements,
|
||||
})}
|
||||
ref={ref}
|
||||
draggable={!!elements}
|
||||
onClick={!!elements || !!pendingElements ? onClick : undefined}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue