mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-20 04:21:06 +08:00

* feat: build overlay scrollbar component for Virtuoso elements * feat: apply overlay scroll to Virtuoso components * feat: build overlay scrollbar component for normal scrollable sections * feat: apply overlay scrollbar to normal scrollable sections * feat: add dark mode UI support to overlay scrollbars * chore: rename OverlayScrollbar to OverlayScrollbarForTypicalChildren * chore: move inline style to scss file * chore: rename VirtuosoOverlayScrollbar to OverlayScrollbarForVirtuosoChildren * chore: move OverlayScrollbarForTypicalChildren to components folder * chore: create a common component for handling Virtuoso and Typical scroll sections * chore: rename Virtuoso and Typical Overlay Scrollbar components * fix: fix the overlay scrollbar initialization flickering * fix: remove calculated height from typical overlay scrollbar + remove the explicit height: 100%
32 lines
734 B
TypeScript
32 lines
734 B
TypeScript
import './typicalOverlayScrollbar.scss';
|
|
|
|
import { PartialOptions } from 'overlayscrollbars';
|
|
import { OverlayScrollbarsComponent } from 'overlayscrollbars-react';
|
|
import { CSSProperties, ReactElement } from 'react';
|
|
|
|
interface Props {
|
|
children: ReactElement;
|
|
style?: CSSProperties;
|
|
options?: PartialOptions;
|
|
}
|
|
|
|
export default function TypicalOverlayScrollbar({
|
|
children,
|
|
style,
|
|
options,
|
|
}: Props): ReturnType<typeof OverlayScrollbarsComponent> {
|
|
return (
|
|
<OverlayScrollbarsComponent
|
|
defer
|
|
options={options}
|
|
style={style}
|
|
className="overlay-scrollbar"
|
|
data-overlayscrollbars-initialize
|
|
>
|
|
{children}
|
|
</OverlayScrollbarsComponent>
|
|
);
|
|
}
|
|
|
|
TypicalOverlayScrollbar.defaultProps = { style: {}, options: {} };
|