fix: layout overflow

This commit is contained in:
AkaraChen 2024-11-22 14:09:41 +08:00
parent 7881fb4d22
commit bba9301788
3 changed files with 14 additions and 8 deletions

View File

@ -121,7 +121,7 @@ const DatasetUpdateForm = ({ datasetId }: DatasetUpdateFormProps) => {
<div className='flex flex-col' style={{ height: 'calc(100vh - 56px)' }}>
<div className="grow bg-white flex flex-col max-h-full h-full">
<Topbar activeStepIndex={step - 1} />
<div className={step === 1 ? 'block h-full' : 'hidden'}>
<div className={step === 1 ? 'block h-full max-h-full overflow-auto' : 'hidden'}>
<StepOne
hasConnection={hasConnection}
onSetting={() => setShowAccountSettingModal({ payload: 'data-source' })}

View File

@ -22,7 +22,7 @@ const StepThree = ({ datasetId, datasetName, indexingType, creationCache }: Step
const isMobile = media === MediaType.mobile
return (
<div className='flex w-full h-full'>
<div className='flex w-full max-h-full h-full overflow-y-auto'>
<div className={'h-full w-full overflow-y-scroll px-6 sm:px-16'}>
<div className='max-w-[636px]'>
{!datasetId && (

View File

@ -1,6 +1,7 @@
import type { FC } from 'react'
import { RiArrowLeftLine } from '@remixicon/react'
import Link from 'next/link'
import { useTranslation } from 'react-i18next'
import { Stepper, type StepperProps } from '../stepper'
import classNames from '@/utils/classnames'
@ -8,24 +9,29 @@ export type TopbarProps = Pick<StepperProps, 'activeStepIndex'> & {
className?: string
}
const STEP_T_MAP: Record<number, string> = {
1: 'datasetCreation.steps.one',
2: 'datasetCreation.steps.two',
3: 'datasetCreation.steps.three',
}
export const Topbar: FC<TopbarProps> = (props) => {
const { className, ...rest } = props
const { t } = useTranslation()
return <div className={classNames('flex items-center justify-between relative', className)}>
<Link href={'/datasets'} className="h-12 pl-2 pr-6 py-2 justify-start items-center gap-1 inline-flex">
<RiArrowLeftLine className='size-4 mr-2' />
<p className="text-[#101827] text-[13px] font-semibold uppercase leading-none">
Create Knowledge
{t('datasetCreation.steps.header.creation')}
</p>
</Link>
<div className={
'top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 absolute'
}>
<Stepper
steps={[
{ name: 'Data Source' },
{ name: 'Document Processing' },
{ name: 'Execute & Finish' },
]}
steps={Array.from({ length: 3 }, (_, i) => ({
name: t(STEP_T_MAP[i + 1]),
}))}
{...rest}
/>
</div>