fnardin-maystreet commented on code in PR #32995:
URL: https://github.com/apache/superset/pull/32995#discussion_r3558019000


##########
superset-frontend/packages/superset-ui-core/src/components/EditableTitle/index.tsx:
##########
@@ -60,7 +60,7 @@ const StyledEditableTitle = styled.span<{
       font-size: ${({ theme }) => theme.fontSizeLG}px;
       padding: ${({ theme }) => theme.sizeUnit / 2}px;
       min-height: 100px;
-      width: 95%;
+      width: 100%;

Review Comment:
   Reverted to 95%



##########
superset-frontend/src/dashboard/components/IconButton.tsx:
##########
@@ -16,41 +16,65 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { MouseEventHandler } from 'react';
-import { styled } from '@apache-superset/core/theme';
+import { forwardRef, HTMLAttributes, MouseEventHandler } from 'react';
+import { styled, SupersetTheme } from '@apache-superset/core/theme';
 
-interface IconButtonProps {
+interface IconButtonProps extends HTMLAttributes<HTMLDivElement> {
   icon: JSX.Element;
   label?: string;
   onClick: MouseEventHandler<HTMLDivElement>;
+  disabled?: boolean;
+  'data-test'?: string;
 }
 
-const StyledDiv = styled.div`
+const disabledCss = `
+  cursor: not-allowed;
+  opacity: 0.5;
+`;
+
+const activeCss = ({ theme }: { theme: SupersetTheme }) => `
+  &:hover {
+    color: ${theme.colorPrimary};
+    background: ${theme.colorBgTextHover};
+  }
+`;
+
+const StyledDiv = styled.div<{ isDisabled?: boolean }>`
   display: flex;
   align-items: center;
   cursor: pointer;
   color: ${({ theme }) => theme.colorIcon};
-  &:hover {
-    color: ${({ theme }) => theme.colorPrimary};
-  }
+  padding: ${({ theme }) => theme.paddingXXS}px;
+  border-radius: ${({ theme }) => theme.borderRadiusXS}px;
+
+  ${({ isDisabled, theme }) => (isDisabled ? disabledCss : activeCss({ theme 
}))}
 `;
 
 const StyledSpan = styled.span`
   margin-left: ${({ theme }) => theme.sizeUnit * 2}px;
 `;
 
-const IconButton = ({ icon, label, onClick }: IconButtonProps) => (
-  <StyledDiv
-    tabIndex={0}
-    role="button"
-    onClick={e => {
-      e.preventDefault();
-      onClick(e);
-    }}
-  >
-    {icon}
-    {label && <StyledSpan>{label}</StyledSpan>}
-  </StyledDiv>
+const IconButton = forwardRef<HTMLDivElement, IconButtonProps>(
+  ({ icon, label, onClick, disabled, 'data-test': dataTest, ...rest }, ref) => 
(
+    <StyledDiv
+      {...rest}
+      ref={ref}
+      tabIndex={0}
+      role="button"
+      isDisabled={disabled}
+      aria-disabled={disabled}

Review Comment:
   Updated



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to