Move divider into overview-file component so that they don't render if file doesn't (#20882)

GitOrigin-RevId: fef584609fa06e6313323c27bc6f9ab9b9a6c815
This commit is contained in:
David 2024-10-10 14:50:50 +02:00 committed by Copybot
parent b1d1432183
commit def2f7f4fd
2 changed files with 42 additions and 44 deletions

View file

@ -59,6 +59,7 @@ export const ReviewPanelOverviewFile: FC<{
} }
return ( return (
<>
<div> <div>
<Button <Button
bsClass="review-panel-overview-file-header" bsClass="review-panel-overview-file-header"
@ -98,5 +99,7 @@ export const ReviewPanelOverviewFile: FC<{
</div> </div>
)} )}
</div> </div>
<div className="review-panel-overfile-divider" />
</>
) )
} }

View file

@ -1,4 +1,4 @@
import { FC, Fragment, useMemo } from 'react' import { FC, useMemo } from 'react'
import { useFileTreeData } from '@/shared/context/file-tree-data-context' import { useFileTreeData } from '@/shared/context/file-tree-data-context'
import { Ranges, useRangesContext } from '../context/ranges-context' import { Ranges, useRangesContext } from '../context/ranges-context'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
@ -58,12 +58,7 @@ export const ReviewPanelOverview: FC = () => {
{docs.map(doc => { {docs.map(doc => {
const ranges = rangesForDocs.get(doc.doc.id) const ranges = rangesForDocs.get(doc.doc.id)
return ( return (
ranges && ( ranges && <ReviewPanelOverviewFile doc={doc} ranges={ranges} />
<Fragment key={doc.doc.id}>
<ReviewPanelOverviewFile doc={doc} ranges={ranges} />
<div className="review-panel-overfile-divider" />
</Fragment>
)
) )
})} })}
</div> </div>