Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Moves WarningIconWithTooltip to own folder #14123

Merged
merged 1 commit into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,29 @@
* specific language governing permissions and limitations
* under the License.
*/
@import '../../stylesheets/less/variables.less';
import React from 'react';
import WarningIconWithTooltip, { WarningIconWithTooltipProps } from '.';

.TableSelector .fa-refresh {
padding-left: 9px;
}
export default {
title: 'WarningIconWithTooltip',
component: WarningIconWithTooltip,
};

.TableSelector .section {
padding-bottom: 5px;
display: flex;
flex-direction: row;
}
export const InteractiveWarningIcon = (args: WarningIconWithTooltipProps) => (
<div css={{ margin: 40 }}>
<WarningIconWithTooltip {...args} />
</div>
);

.TableSelector .select {
flex-grow: 1;
}
InteractiveWarningIcon.args = {
warningMarkdown: 'Markdown example',
size: 20,
};

.TableSelector .divider {
border-bottom: 1px solid @gray-bg;
margin: 15px 0;
}

.TableLabel {
white-space: nowrap;
}
InteractiveWarningIcon.story = {
parameters: {
knobs: {
disable: true,
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
* under the License.
*/
import React from 'react';
import { supersetTheme, SafeMarkdown } from '@superset-ui/core';
import { useTheme, SafeMarkdown } from '@superset-ui/core';
import Icon from 'src/components/Icon';
import { Tooltip } from 'src/components/Tooltip';

interface WarningIconWithTooltipProps {
export interface WarningIconWithTooltipProps {
warningMarkdown: string;
size?: number;
}
Expand All @@ -30,13 +30,14 @@ function WarningIconWithTooltip({
warningMarkdown,
size = 24,
}: WarningIconWithTooltipProps) {
const theme = useTheme();
return (
<Tooltip
id="warning-tooltip"
title={<SafeMarkdown source={warningMarkdown} />}
>
<Icon
color={supersetTheme.colors.alert.base}
color={theme.colors.alert.base}
height={size}
width={size}
name="alert-solid"
Expand Down