From b50c54f855e04c6d163f8ad5bd1d38c45fa0c6c1 Mon Sep 17 00:00:00 2001 From: Danila Date: Mon, 19 Oct 2020 17:14:28 +0300 Subject: [PATCH] Add and use clsx (classnames alternative) (#2249) Co-authored-by: David Luzar --- package-lock.json | 5 +++ package.json | 1 + src/components/Avatar.tsx | 2 +- src/components/ButtonSelect.tsx | 3 +- src/components/ContextMenu.tsx | 13 ++++--- src/components/Dialog.tsx | 3 +- src/components/FixedSideContainer.tsx | 7 +++- src/components/Island.tsx | 3 +- src/components/LanguageList.tsx | 7 ++-- src/components/LayerUI.tsx | 55 ++++++++++++++++----------- src/components/LibraryUnit.tsx | 13 ++++--- src/components/LockIcon.tsx | 13 ++++--- src/components/Modal.tsx | 3 +- src/components/RoomDialog.tsx | 7 ++-- src/components/Stack.tsx | 5 ++- src/components/ToolButton.tsx | 20 ++++++---- src/components/UserList.tsx | 17 +++------ src/components/icons.tsx | 3 +- 18 files changed, 108 insertions(+), 72 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3146b643c3..e4d4256c3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5399,6 +5399,11 @@ "mimic-response": "^1.0.0" } }, + "clsx": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz", + "integrity": "sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==" + }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", diff --git a/package.json b/package.json index e9640dbba3..2ad1c28992 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "@types/react-dom": "16.9.8", "@types/socket.io-client": "1.4.34", "browser-nativefs": "0.11.0", + "clsx": "1.1.1", "firebase": "7.23.0", "i18next-browser-languagedetector": "6.0.1", "lodash.throttle": "4.1.1", diff --git a/src/components/Avatar.tsx b/src/components/Avatar.tsx index c2970f5026..1bd50ca565 100644 --- a/src/components/Avatar.tsx +++ b/src/components/Avatar.tsx @@ -9,7 +9,7 @@ type AvatarProps = { }; export const Avatar = ({ children, color, onClick }: AvatarProps) => ( -
+
{children}
); diff --git a/src/components/ButtonSelect.tsx b/src/components/ButtonSelect.tsx index 19730069fc..0d58d2febc 100644 --- a/src/components/ButtonSelect.tsx +++ b/src/components/ButtonSelect.tsx @@ -1,4 +1,5 @@ import React from "react"; +import clsx from "clsx"; export const ButtonSelect = ({ options, @@ -15,7 +16,7 @@ export const ButtonSelect = ({ {options.map((option) => (