The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/components/Page/PageScrollableContentWithSh...

22 lines
701 B

import type { FC, ComponentProps } from 'react';
import React, { useContext } from 'react';
import PageContext from './PageContext';
import PageScrollableContent from './PageScrollableContent';
type PageScrollableContentWithShadowProps = ComponentProps<typeof PageScrollableContent>;
const PageScrollableContentWithShadow: FC<PageScrollableContentWithShadowProps> = ({ onScrollContent, ...props }) => {
const [, setBorder] = useContext(PageContext);
return (
<PageScrollableContent
onScrollContent={({ top, ...args }: { top: boolean }): void => {
setBorder(!!top);
onScrollContent?.({ top, ...args });
}}
{...props}
/>
);
};
export default PageScrollableContentWithShadow;