mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
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:
parent
b1d1432183
commit
def2f7f4fd
2 changed files with 42 additions and 44 deletions
|
@ -59,44 +59,47 @@ export const ReviewPanelOverviewFile: FC<{
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<>
|
||||||
<Button
|
<div>
|
||||||
bsClass="review-panel-overview-file-header"
|
<Button
|
||||||
bsStyle={null}
|
bsClass="review-panel-overview-file-header"
|
||||||
onClick={toggleCollapsed}
|
bsStyle={null}
|
||||||
>
|
onClick={toggleCollapsed}
|
||||||
<MaterialIcon
|
>
|
||||||
type={collapsed ? 'keyboard_arrow_right' : 'keyboard_arrow_down'}
|
<MaterialIcon
|
||||||
/>
|
type={collapsed ? 'keyboard_arrow_right' : 'keyboard_arrow_down'}
|
||||||
{doc.doc.name}
|
/>
|
||||||
<div className="review-panel-overview-file-entry-count">
|
{doc.doc.name}
|
||||||
{numEntries}
|
<div className="review-panel-overview-file-entry-count">
|
||||||
</div>
|
{numEntries}
|
||||||
</Button>
|
</div>
|
||||||
|
</Button>
|
||||||
|
|
||||||
{!collapsed && (
|
{!collapsed && (
|
||||||
<div className="review-panel-overview-file-entries">
|
<div className="review-panel-overview-file-entries">
|
||||||
{changes.map(change => (
|
{changes.map(change => (
|
||||||
<ReviewPanelChange
|
<ReviewPanelChange
|
||||||
key={change.id}
|
key={change.id}
|
||||||
change={change}
|
change={change}
|
||||||
aggregate={aggregates.get(change.id)}
|
aggregate={aggregates.get(change.id)}
|
||||||
editable={false}
|
editable={false}
|
||||||
docId={doc.doc.id}
|
docId={doc.doc.id}
|
||||||
hoverRanges={false}
|
hoverRanges={false}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{unresolvedComments.map(comment => (
|
{unresolvedComments.map(comment => (
|
||||||
<ReviewPanelComment
|
<ReviewPanelComment
|
||||||
key={comment.id}
|
key={comment.id}
|
||||||
comment={comment}
|
comment={comment}
|
||||||
docId={doc.doc.id}
|
docId={doc.doc.id}
|
||||||
hoverRanges={false}
|
hoverRanges={false}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
<div className="review-panel-overfile-divider" />
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue