Skip to content
Snippets Groups Projects
Commit 98109a56 authored by Kamil Mielnik's avatar Kamil Mielnik
Browse files

Lift className up

parent 5b5b5592
No related branches found
No related tags found
No related merge requests found
......@@ -69,3 +69,7 @@
font-weight: bold;
color: var(--mb-color-text-secondary);
}
.widgetStatus {
flex: 0 0 auto;
}
......@@ -84,6 +84,7 @@ export const ParameterValueWidget = ({
) {
return (
<WidgetStatus
className={S.widgetStatus}
highlighted={fieldHasValueOrFocus}
status="reset"
onClick={() => setParameterValueToDefault?.(parameter.id)}
......@@ -94,6 +95,7 @@ export const ParameterValueWidget = ({
if (value != null) {
return (
<WidgetStatus
className={S.widgetStatus}
highlighted={fieldHasValueOrFocus}
status="clear"
onClick={() => {
......@@ -105,7 +107,7 @@ export const ParameterValueWidget = ({
}
if (!hasNoPopover(parameter)) {
return <WidgetStatus status="empty" />;
return <WidgetStatus className={S.widgetStatus} status="empty" />;
}
};
......@@ -119,6 +121,7 @@ export const ParameterValueWidget = ({
) {
return (
<WidgetStatus
className={S.widgetStatus}
highlighted={fieldHasValueOrFocus}
status="reset"
onClick={() => setParameterValueToDefault?.(parameter.id)}
......@@ -139,7 +142,7 @@ export const ParameterValueWidget = ({
if (!icon) {
// This is required to keep input width constant
return <WidgetStatus status="none" />;
return <WidgetStatus className={S.widgetStatus} status="none" />;
}
return icon;
......
.root {
flex: 0 0 auto;
}
......@@ -3,10 +3,10 @@ import { t } from "ttag";
import { Button, Flex, Icon, rem, Tooltip } from "metabase/ui";
import S from "./WidgetStatus.module.css";
import type { Status } from "./types";
type Props = {
className?: string;
highlighted?: boolean;
status: Status;
onClick?: () => void;
......@@ -20,7 +20,12 @@ const COMPACT_BUTTON_PADDING = 4;
*/
const BUTTON_MARGIN = -COMPACT_BUTTON_PADDING;
export const WidgetStatus = ({ highlighted, status, onClick }: Props) => {
export const WidgetStatus = ({
className,
highlighted,
status,
onClick,
}: Props) => {
const handleClick = (event: MouseEvent) => {
if (onClick) {
event.stopPropagation();
......@@ -31,7 +36,7 @@ export const WidgetStatus = ({ highlighted, status, onClick }: Props) => {
return (
<Flex
align="center"
className={S.root}
className={className}
h={0} // trick to prevent this element from affecting parent's height
ml="auto"
>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment