mirror of
https://github.com/apache/superset.git
synced 2026-04-26 19:44:58 +00:00
fix(theming): Some visual issues (#34676)
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
import { PureComponent } from 'react';
|
||||
import cx from 'classnames';
|
||||
import { css, styled } from '@superset-ui/core';
|
||||
import { Icons } from '@superset-ui/core/components/Icons';
|
||||
import { DragDroppable } from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import { NEW_COMPONENTS_SOURCE_ID } from 'src/dashboard/util/constants';
|
||||
import { NEW_COMPONENT_SOURCE_TYPE } from 'src/dashboard/util/componentTypes';
|
||||
@@ -36,18 +37,33 @@ interface DraggableNewComponentProps {
|
||||
const NewComponent = styled.div`
|
||||
${({ theme }) => css`
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
padding: ${theme.sizeUnit * 4}px;
|
||||
background: ${theme.colors.grayscale.light5};
|
||||
justify-content: space-between;
|
||||
padding: 0 ${theme.sizeUnit}px;
|
||||
margin: ${theme.sizeUnit * 2}px ${theme.sizeUnit * 4}px;
|
||||
|
||||
// hack to make the drag preview image corners rounded
|
||||
transform: translate(0, 0);
|
||||
color: ${theme.colorText};
|
||||
background-color: ${theme.colorBgLayout};
|
||||
border-radius: ${theme.borderRadius}px;
|
||||
cursor: move;
|
||||
&:not(.static):hover {
|
||||
background: ${theme.colors.grayscale.light4};
|
||||
|
||||
&:hover {
|
||||
background-color: ${theme.colorPrimaryBgHover};
|
||||
}
|
||||
`}
|
||||
`;
|
||||
|
||||
const NewComponentContent = styled.div`
|
||||
${({ theme }) => css`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
margin-right: ${theme.sizeUnit * 2}px;
|
||||
`}
|
||||
`;
|
||||
|
||||
const NewComponentPlaceholder = styled.div`
|
||||
${({ theme }) => css`
|
||||
position: relative;
|
||||
@@ -83,12 +99,15 @@ export default class DraggableNewComponent extends PureComponent<DraggableNewCom
|
||||
>
|
||||
{({ dragSourceRef }) => (
|
||||
<NewComponent ref={dragSourceRef} data-test="new-component">
|
||||
<NewComponentPlaceholder
|
||||
className={cx('new-component-placeholder', className)}
|
||||
>
|
||||
{IconComponent && <IconComponent iconSize="xl" />}
|
||||
</NewComponentPlaceholder>
|
||||
{label}
|
||||
<NewComponentContent>
|
||||
<NewComponentPlaceholder
|
||||
className={cx('new-component-placeholder', className)}
|
||||
>
|
||||
{IconComponent && <IconComponent iconSize="xl" />}
|
||||
</NewComponentPlaceholder>
|
||||
{label}
|
||||
</NewComponentContent>
|
||||
<Icons.Drag iconSize="xl" />
|
||||
</NewComponent>
|
||||
)}
|
||||
</DragDroppable>
|
||||
|
||||
@@ -200,9 +200,9 @@ const DatasourcePanelItem = ({
|
||||
<SectionHeaderTextContainer>
|
||||
<SectionHeader ref={labelRef}>{folder.name}</SectionHeader>
|
||||
{collapsedFolderIds.has(folder.id) ? (
|
||||
<Icons.DownOutlined iconSize="s" />
|
||||
<Icons.DownOutlined iconSize="s" iconColor={theme.colorText} />
|
||||
) : (
|
||||
<Icons.UpOutlined iconSize="s" />
|
||||
<Icons.UpOutlined iconSize="s" iconColor={theme.colorText} />
|
||||
)}
|
||||
</SectionHeaderTextContainer>
|
||||
</Tooltip>
|
||||
|
||||
@@ -41,6 +41,9 @@ const CheckBoxControlWrapper = styled.div`
|
||||
span:has(label) {
|
||||
padding-right: ${theme.sizeUnit * 2}px;
|
||||
}
|
||||
.ant-checkbox-wrapper {
|
||||
font-size: ${theme.fontSizeSM}px;
|
||||
}
|
||||
`}
|
||||
`;
|
||||
|
||||
|
||||
@@ -458,7 +458,14 @@ const RightMenu = ({
|
||||
label: isFrontendRoute(child.url) ? (
|
||||
<Link to={child.url || ''}>{menuItemDisplay}</Link>
|
||||
) : (
|
||||
<Typography.Link href={child.url || ''}>
|
||||
<Typography.Link
|
||||
href={child.url || ''}
|
||||
css={css`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: ${theme.sizeUnit * 10}px;
|
||||
`}
|
||||
>
|
||||
{menuItemDisplay}
|
||||
</Typography.Link>
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user