mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-14 04:50:05 +02:00
Add and use clsx (classnames alternative) (#2249)
Co-authored-by: David Luzar <luzar.david@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import "./UserList.scss";
|
||||
|
||||
import React from "react";
|
||||
import clsx from "clsx";
|
||||
|
||||
type UserListProps = {
|
||||
children: React.ReactNode;
|
||||
@@ -9,15 +10,9 @@ type UserListProps = {
|
||||
};
|
||||
|
||||
export const UserList = ({ children, className, mobile }: UserListProps) => {
|
||||
let compClassName = "UserList";
|
||||
|
||||
if (className) {
|
||||
compClassName += ` ${className}`;
|
||||
}
|
||||
|
||||
if (mobile) {
|
||||
compClassName += " UserList_mobile";
|
||||
}
|
||||
|
||||
return <div className={compClassName}>{children}</div>;
|
||||
return (
|
||||
<div className={clsx("UserList", className, { UserList_mobile: mobile })}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user