-
Notifications
You must be signed in to change notification settings - Fork 381
Expand file tree
/
Copy pathInnerScrollContainer.tsx
More file actions
28 lines (25 loc) · 1016 Bytes
/
InnerScrollContainer.tsx
File metadata and controls
28 lines (25 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { forwardRef } from 'react';
import { css } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/components/Table/table-scrollable';
export interface InnerScrollContainerProps extends React.HTMLProps<HTMLDivElement> {
/** Content rendered inside the inner scroll container */
children?: React.ReactNode;
/** Additional classes added to the container */
className?: string;
/** @hide Forwarded ref */
innerRef?: React.Ref<HTMLDivElement>;
}
const InnerScrollContainerBase: React.FunctionComponent<InnerScrollContainerProps> = ({
children,
className,
innerRef,
...props
}: InnerScrollContainerProps) => (
<div ref={innerRef} className={css(className, styles.scrollInnerWrapper)} {...props}>
{children}
</div>
);
export const InnerScrollContainer = forwardRef((props: InnerScrollContainerProps, ref: React.Ref<HTMLDivElement>) => (
<InnerScrollContainerBase innerRef={ref} {...props} />
));
InnerScrollContainer.displayName = 'InnerScrollContainer';