rebenitez1802 commented on code in PR #37681:
URL: https://github.com/apache/superset/pull/37681#discussion_r2874610446
##########
superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.tsx:
##########
@@ -17,81 +17,86 @@
* under the License.
*/
import type { FC } from 'react';
-import { css, styled, useTheme } from '@apache-superset/core/ui';
-
-// eslint-disable-next-line no-restricted-imports
+import { css, styled } from '@apache-superset/core/ui';
import { Tabs as AntdTabs, TabsProps as AntdTabsProps } from 'antd';
import { Icons } from '@superset-ui/core/components/Icons';
import type { SerializedStyles } from '@emotion/react';
export interface TabsProps extends AntdTabsProps {
allowOverflow?: boolean;
+ contentHeight?: string | number;
fullHeight?: boolean;
contentStyle?: SerializedStyles;
+ contentPadding?: SerializedStyles;
}
const StyledTabs = ({
animated = false,
allowOverflow = true,
+ contentHeight = '100%',
fullHeight = false,
tabBarStyle,
contentStyle,
+ contentPadding,
...props
-}: TabsProps) => {
- const theme = useTheme();
- const defaultTabBarStyle = { paddingLeft: theme.sizeUnit * 4 };
- const mergedStyle = { ...defaultTabBarStyle, ...tabBarStyle };
-
- return (
- <AntdTabs
- animated={animated}
- {...props}
- tabBarStyle={mergedStyle}
- css={theme => css`
- overflow: ${allowOverflow ? 'visible' : 'hidden'};
+}: TabsProps) => (
+ <AntdTabs
+ animated={animated}
+ {...props}
+ tabBarStyle={tabBarStyle}
Review Comment:
this is a shared component. Make sure this change is not braking other tabs.
There is some files that using the previously merged styles:
-
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx
-
superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx
- superset-frontend/src/SqlLab/components/TablePreview/index.tsx
Also make sure test on
https://github.com/apache/superset/blob/master/superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.test.tsx#L76
still passes because is expecting the default left padding to be present
--
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]