You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2021/05/14 07:07:24 UTC

[superset] 01/01: fix: Removing specific column widths, letting things flex naturally.

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

rusackas pushed a commit to branch fixing-submenu-header-layout
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 1bac90713d4495768990b5881418f6eadd6f0ce6
Author: Evan Rusackas <ev...@preset.io>
AuthorDate: Fri May 14 00:05:11 2021 -0700

    fix: Removing specific column widths, letting things flex naturally.
---
 superset-frontend/src/components/Menu/SubMenu.tsx | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/superset-frontend/src/components/Menu/SubMenu.tsx b/superset-frontend/src/components/Menu/SubMenu.tsx
index 27f4b86..ec03222 100644
--- a/superset-frontend/src/components/Menu/SubMenu.tsx
+++ b/superset-frontend/src/components/Menu/SubMenu.tsx
@@ -158,7 +158,6 @@ const SubMenuComponent: React.FunctionComponent<SubMenuProps> = props => {
   const [navRightStyle, setNavRightStyle] = useState('nav-right');
   const [navRightCol, setNavRightCol] = useState(8);
 
-  const { headerSize = 2 } = props;
   let hasHistory = true;
   // If no parent <Router> component exists, useHistory throws an error
   try {
@@ -195,17 +194,15 @@ const SubMenuComponent: React.FunctionComponent<SubMenuProps> = props => {
     return () => window.removeEventListener('resize', resize);
   }, [props.buttons]);
 
-  const offset = props.name ? headerSize : 0;
-
   return (
     <StyledHeader>
       <Row className="menu" role="navigation">
         {props.name && (
-          <Col md={offset} xs={24}>
+          <Col flex="none">
             <div className="header">{props.name}</div>
           </Col>
         )}
-        <Col md={16 - offset} sm={24} xs={24}>
+        <Col flex="auto" xs={24}>
           <Menu mode={showMenu} style={{ backgroundColor: 'transparent' }}>
             {props.tabs &&
               props.tabs.map(tab => {