chore: fix index show

This commit is contained in:
Joel 2024-10-31 16:10:48 +08:00
parent ae21d48132
commit 7f2980fbc0
4 changed files with 6 additions and 4 deletions

View File

@ -78,7 +78,7 @@ const IndexBar: FC<IndexBarProps> = ({ letters, itemRefs }) => {
element.scrollIntoView({ behavior: 'smooth' })
}
return (
<div className="index-bar absolute right-4 top-36 flex flex-col items-center w-6 justify-center text-xs font-medium text-text-quaternary ">
<div className="index-bar absolute right-0 top-36 flex flex-col items-center w-6 justify-center text-xs font-medium text-text-quaternary ">
<div className='absolute left-0 top-0 h-full w-px bg-[linear-gradient(270deg,rgba(255,255,255,0)_0%,rgba(16,24,40,0.08)_30%,rgba(16,24,40,0.08)_50%,rgba(16,24,40,0.08)_70.5%,rgba(255,255,255,0)_100%)]'></div>
{letters.map(letter => (
<div className="hover:text-text-secondary cursor-pointer" key={letter} onClick={() => handleIndexClick(letter)}>

View File

@ -9,11 +9,13 @@ import { ViewType } from '../../view-type-select'
type Props = {
payload: ToolWithProvider[]
isShowLetterIndex: boolean
onSelect: (type: BlockEnum, tool?: ToolDefaultValue) => void
}
const ToolViewFlatView: FC<Props> = ({
payload,
isShowLetterIndex,
onSelect,
}) => {
return (
@ -23,7 +25,7 @@ const ToolViewFlatView: FC<Props> = ({
key={tool.id}
payload={tool}
viewType={ViewType.flat}
isShowLetterIndex={false}
isShowLetterIndex={isShowLetterIndex}
onSelect={onSelect}
/>
))}

View File

@ -56,7 +56,7 @@ const Tool: FC<Props> = ({
return (
<div
key={payload.id}
className='mb-1 last-of-type:mb-0'
className={cn('mb-1 last-of-type:mb-0', isShowLetterIndex && 'mr-6')}
>
<div className={cn(className)}>
<div
@ -99,7 +99,6 @@ const Tool: FC<Props> = ({
actions.map(action => (
<ActonItem
key={action.name}
className={cn(isShowLetterIndex && 'mr-6')}
provider={payload}
payload={action}
onSelect={onSelect}

View File

@ -88,6 +88,7 @@ const Blocks = ({
isFlatView ? (
<ToolListFlatView
payload={listViewToolData}
isShowLetterIndex={isShowLetterIndex}
onSelect={onSelect}
/>
) : (