| 687 | } |
| 688 | |
| 689 | protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode { |
| 690 | let rect = new Rect(x, y, this.padding, 0); |
| 691 | let layoutInfo = new LayoutInfo(node.type, node.key, rect); |
| 692 | |
| 693 | // Note that if the user provides isLoading to their sentinel during a case where they only want to render the emptyState, this will reserve |
| 694 | // room for the loader alongside rendering the emptyState |
| 695 | if (this.orientation === 'horizontal') { |
| 696 | rect.height = this.virtualizer!.contentSize.height - this.padding - y; |
| 697 | rect.width = node.props.isLoading |
| 698 | ? (this.loaderSize ?? this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) |
| 699 | : 0; |
| 700 | } else { |
| 701 | rect.width = this.virtualizer!.contentSize.width - this.padding - x; |
| 702 | rect.height = node.props.isLoading |
| 703 | ? (this.loaderSize ?? this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) |
| 704 | : 0; |
| 705 | } |
| 706 | |
| 707 | return { |
| 708 | layoutInfo, |
| 709 | validRect: rect.intersection(this.requestedRect) |
| 710 | }; |
| 711 | } |
| 712 | |
| 713 | protected buildSection(node: Node<T>, x: number, y: number): LayoutNode { |
| 714 | if (this.anchorTo === 'end' && this.orientation === 'vertical') { |