mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 22:45:50 -05:00
8bc374c916
[web] BS5 review panel new GitOrigin-RevId: c65d17d0053858bd74984ba746a620b89d900606
49 lines
1.7 KiB
TypeScript
49 lines
1.7 KiB
TypeScript
import { FC, memo, useState } from 'react'
|
|
import { ReviewPanelResolvedThreadsButton } from './review-panel-resolved-threads-button'
|
|
import { ReviewPanelTrackChangesMenu } from './review-panel-track-changes-menu'
|
|
import ReviewPanelTrackChangesMenuButton from './review-panel-track-changes-menu-button'
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
import { useLayoutContext } from '@/shared/context/layout-context'
|
|
import SplitTestBadge from '@/shared/components/split-test-badge'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
const ReviewPanelHeader: FC = () => {
|
|
const [trackChangesMenuExpanded, setTrackChangesMenuExpanded] =
|
|
useState(false)
|
|
const { setReviewPanelOpen } = useLayoutContext()
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<div className="review-panel-header">
|
|
<div className="review-panel-heading">
|
|
<div className="review-panel-label">
|
|
{t('review')}
|
|
<span className="review-panel-split-test-badge">
|
|
<SplitTestBadge
|
|
splitTestName="review-panel-redesign"
|
|
displayOnVariants={['enabled']}
|
|
/>
|
|
</span>
|
|
</div>
|
|
<button
|
|
type="button"
|
|
className="btn review-panel-close-button"
|
|
onClick={() => setReviewPanelOpen(false)}
|
|
>
|
|
<MaterialIcon type="close" />
|
|
</button>
|
|
</div>
|
|
<div className="review-panel-tools">
|
|
<ReviewPanelResolvedThreadsButton />
|
|
<ReviewPanelTrackChangesMenuButton
|
|
menuExpanded={trackChangesMenuExpanded}
|
|
setMenuExpanded={setTrackChangesMenuExpanded}
|
|
/>
|
|
</div>
|
|
|
|
{trackChangesMenuExpanded && <ReviewPanelTrackChangesMenu />}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default memo(ReviewPanelHeader)
|