|
|
|
|
@ -5,6 +5,7 @@ import useStickyScroll, { ScrollPosition } from '../use-sticky-scroll'
|
|
|
|
|
import Item from './item'
|
|
|
|
|
import type { Plugin } from '@/app/components/plugins/types.ts'
|
|
|
|
|
import cn from '@/utils/classnames'
|
|
|
|
|
// import { RiArrowRightUpLine } from '@remixicon/react'
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
wrapElemRef: React.RefObject<HTMLElement>
|
|
|
|
|
@ -26,11 +27,11 @@ const List = ({
|
|
|
|
|
const stickyClassName = useMemo(() => {
|
|
|
|
|
switch (scrollPosition) {
|
|
|
|
|
case ScrollPosition.aboveTheWrap:
|
|
|
|
|
return 'top-0 shadow-md bg-white'
|
|
|
|
|
return 'top-0 h-9 pt-3 pb-2 shadow-xs bg-components-panel-bg-blur'
|
|
|
|
|
case ScrollPosition.showing:
|
|
|
|
|
return 'bottom-0'
|
|
|
|
|
return 'bottom-0 pt-3 pb-1'
|
|
|
|
|
case ScrollPosition.belowTheWrap:
|
|
|
|
|
return 'bottom-0 border-t border-gray-500 bg-white text-blue-500'
|
|
|
|
|
return 'bottom-0 items-center rounded-b-xl border-t border-[0.5px] border-components-panel-border bg-components-panel-bg-blur text-blue-500 shadow-lg text-text-accent-light-mode-only cursor-pointer'
|
|
|
|
|
}
|
|
|
|
|
}, [scrollPosition])
|
|
|
|
|
|
|
|
|
|
@ -41,8 +42,12 @@ const List = ({
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<div
|
|
|
|
|
className={cn('sticky z-10 pt-3 px-4 py-1 text-text-primary system-sm-medium', stickyClassName)}>
|
|
|
|
|
{t('plugin.fromMarketplace')}
|
|
|
|
|
className={cn('sticky z-10 flex h-8 px-4 py-1 text-text-primary system-sm-medium', stickyClassName)}
|
|
|
|
|
>
|
|
|
|
|
<span>{t('plugin.fromMarketplace')}</span>
|
|
|
|
|
{/* {scrollPosition === ScrollPosition.belowTheWrap && (
|
|
|
|
|
<RiArrowRightUpLine className='ml-0.5 w-3 h-3' />
|
|
|
|
|
)} */}
|
|
|
|
|
</div>
|
|
|
|
|
<div className='p-1 pb-[500px]' ref={nextToStickyELemRef}>
|
|
|
|
|
{list.map((item, index) => (
|
|
|
|
|
|