This is an automated email from the ASF dual-hosted git repository.

suddjian pushed a commit to branch all-charts-category-alone
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 47c482307c48e635afd95ad9e5c8dc3b60c1d52f
Author: David Aaron Suddjian <[email protected]>
AuthorDate: Mon Jul 26 17:04:43 2021 -0700

    allow passing styles to selector component
---
 .../explore/components/controls/VizTypeControl/VizTypeGallery.tsx   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx
 
b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx
index 805f8cb..834e668 100644
--- 
a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx
+++ 
b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx
@@ -25,6 +25,7 @@ import React, {
   useState,
 } from 'react';
 import Fuse from 'fuse.js';
+import cx from 'classnames';
 import {
   t,
   styled,
@@ -400,7 +401,8 @@ const Selector: React.FC<{
   isSelected: boolean;
   onClick: (selector: string) => void;
   onClear: (e: React.MouseEvent) => void;
-}> = ({ selector, icon, isSelected, onClick, onClear }) => {
+  className?: string;
+}> = ({ selector, icon, isSelected, onClick, onClear, className }) => {
   const btnRef = useRef<HTMLButtonElement>(null);
 
   // see Element.scrollIntoViewIfNeeded()
@@ -422,7 +424,7 @@ const Selector: React.FC<{
       ref={btnRef}
       key={selector}
       name={selector}
-      className={isSelected ? 'selected' : ''}
+      className={cx(className, isSelected && 'selected')}
       onClick={() => onClick(selector)}
     >
       {icon}

Reply via email to