From 737fc46b87846eb0cc3ecbe49fbdd4f3f15a57ee Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Wed, 10 Jun 2020 16:48:34 +0100 Subject: [PATCH] Inline kind classnames --- src/components/views/elements/AccessibleButton.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/views/elements/AccessibleButton.tsx b/src/components/views/elements/AccessibleButton.tsx index 363a82b9fb..3a542387c5 100644 --- a/src/components/views/elements/AccessibleButton.tsx +++ b/src/components/views/elements/AccessibleButton.tsx @@ -100,15 +100,14 @@ export default function AccessibleButton({ // Pass through the ref - used for keyboard shortcut access to some buttons newProps.ref = inputRef; - let classNameBooleans = { - "mx_AccessibleButton_hasKind": kind, - "mx_AccessibleButton_disabled": disabled, - } - classNameBooleans["mx_AccessibleButton_kind_" + kind] = kind; newProps.className = classnames( "mx_AccessibleButton", className, - classNameBooleans, + { + "mx_AccessibleButton_hasKind": kind, + [`mx_AccessibleButton_kind_${kind}`]: kind, + "mx_AccessibleButton_disabled": disabled, + }, ); // React.createElement expects InputHTMLAttributes