Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
YieldRay committed Dec 23, 2024
1 parent d6cff8f commit 3208ce7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/composition/RecycleScroller/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Meta, StoryObj } from '@storybook/react'
import { RecycleScroller } from './RecycleScroller'
import { VirtualScroller } from './VirtualScroller'

const meta: Meta<typeof RecycleScroller> = {
title: 'composition/RecycleScroller',
component: RecycleScroller,
const meta: Meta<typeof VirtualScroller> = {
title: 'composition/VirtualScroller',
component: VirtualScroller,
tags: ['autodocs'],
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
useState,
} from 'react'

interface RecycleScrollerProps<T> {
interface VirtualScrollerProps<T> {
data: T[]
itemHeight: number
windowHeight: number
Expand All @@ -17,24 +17,24 @@ interface RecycleScrollerProps<T> {
defaultRevealedIndex?: number
}

export interface RecycleScrollerHandle {
export interface VirtualScrollerHandle {
scrollToIndex: (index: number) => void
}

/**
* @experimental
* Highly experimental!
* Working in progress, DO NOT USE
*/
export const RecycleScroller = forwardRef(function RecycleScroller<T>(
export const VirtualScroller = forwardRef(function VirtualScroller<T>(
{
data,
itemHeight,
windowHeight,
children,
bufferSize = 3,
defaultRevealedIndex = 0,
}: RecycleScrollerProps<T>,
ref: React.ForwardedRef<RecycleScrollerHandle>,
}: VirtualScrollerProps<T>,
ref: React.ForwardedRef<VirtualScrollerHandle>,
) {
const containerRef = useRef<HTMLDivElement>(null)
const [isScrolling, setIsScrolling] = useState(false)
Expand Down Expand Up @@ -80,7 +80,7 @@ export const RecycleScroller = forwardRef(function RecycleScroller<T>(

scrollingTimeoutRef.current = setTimeout(() => {
setIsScrolling(false)
}, 150)
}, 33.333)
},
[],
)
Expand Down
1 change: 1 addition & 0 deletions src/composition/VirtualScroller/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './VirtualScroller'
2 changes: 1 addition & 1 deletion src/composition/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export * from './Details'
export * from './IconRippleButton'
export * from './NestedMenu'
export * from './PopoverHolder'
export * from './RecycleScroller'
export * from './Scrim'
export * from './ScrollArea'
export * from './Select'
Expand All @@ -13,3 +12,4 @@ export * from './SodaImage'
export * from './SodaTransition'
export * from './Table'
export * from './TooltipHolder'
export * from './VirtualScroller'

0 comments on commit 3208ce7

Please sign in to comment.