CB-4128 review fixes (#2082)

* CB-4128 review fixes

* CB-4128 declare styles once

---------

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
This commit is contained in:
alex
2023-10-25 13:34:59 +03:00
committed by GitHub
co-authored by Daria Marutkina
parent 390f53f36b
commit df9de51bda
2 changed files with 10 additions and 2 deletions
@@ -57,6 +57,10 @@
width: 720px;
}
}
&.freeHeight {
min-height: unset;
}
}
.loader {
@@ -22,13 +22,17 @@ export interface CommonDialogWrapperProps {
'aria-label'?: string;
fixedSize?: boolean;
fixedWidth?: boolean;
freeHeight?: boolean;
className?: string;
children?: React.ReactNode;
style?: ComponentStyle;
}
export const CommonDialogWrapper = observer<CommonDialogWrapperProps, HTMLDivElement>(
forwardRef(function CommonDialogWrapper({ size = 'medium', fixedSize, fixedWidth, 'aria-label': ariaLabel, className, children, style }, ref) {
forwardRef(function CommonDialogWrapper(
{ size = 'medium', fixedSize, fixedWidth, freeHeight, 'aria-label': ariaLabel, className, children, style },
ref,
) {
const computedStyles = useS(styles, style);
const context = useContext(DialogContext);
const dialogState = useDialogState({ visible: true });
@@ -52,7 +56,7 @@ export const CommonDialogWrapper = observer<CommonDialogWrapperProps, HTMLDivEle
<dialog
className={s(
computedStyles,
{ dialog: true, small: size === 'small', medium: size === 'medium', large: size === 'large', fixedSize, fixedWidth },
{ dialog: true, small: size === 'small', medium: size === 'medium', large: size === 'large', fixedSize, fixedWidth, freeHeight },
className,
)}
>