import { SortableContainer } from '@o/react-sortable-hoc' import AutoResponsive from 'autoresponsive-react' import React from 'react' import { useNodeSize } from '../hooks/useNodeSize' import { ViewProps } from '../View/types' import { View } from '../View/View' import { useVisibility } from '../Visibility' export type MasonryLayoutProps = ViewProps & { children?: React.ReactNode } export function MasonryLayout({ children, padding, ...props }: MasonryLayoutProps) { const visible = useVisibility() const size = useNodeSize({ throttle: 500, ignoreFirst: true, disable: !visible, }) return ( {children} ) } const SortableResponsive = SortableContainer(AutoResponsive) as any export type GridLayoutItemProps = { width: number height: number children: React.ReactNode } MasonryLayout.Item = function({ width, height, children }: GridLayoutItemProps) { return
{children}
}