Skip to content

Commit

Permalink
CB-4128 review fixes (#2082)
Browse files Browse the repository at this point in the history
* CB-4128 review fixes

* CB-4128 declare styles once

---------

Co-authored-by: Daria Marutkina <[email protected]>
  • Loading branch information
devnaumov and dariamarutkina authored Oct 25, 2023
1 parent 390f53f commit df9de51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
width: 720px;
}
}

&.freeHeight {
min-height: unset;
}
}

.loader {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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,
)}
>
Expand Down

0 comments on commit df9de51

Please sign in to comment.