2024-08-12 05:50:54 -04:00
|
|
|
import { FC, memo, useState } from 'react'
|
2024-08-19 09:16:56 -04:00
|
|
|
import { ReviewPanelResolvedThreadsButton } from './review-panel-resolved-threads-button'
|
2024-08-12 05:50:54 -04:00
|
|
|
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'
|
2024-10-04 05:17:36 -04:00
|
|
|
import SplitTestBadge from '@/shared/components/split-test-badge'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
2024-08-12 05:50:54 -04:00
|
|
|
|
2024-08-22 05:44:22 -04:00
|
|
|
const ReviewPanelHeader: FC = () => {
|
2024-08-12 05:50:54 -04:00
|
|
|
const [trackChangesMenuExpanded, setTrackChangesMenuExpanded] =
|
|
|
|
useState(false)
|
|
|
|
const { setReviewPanelOpen } = useLayoutContext()
|
2024-10-04 05:17:36 -04:00
|
|
|
const { t } = useTranslation()
|
2024-08-12 05:50:54 -04:00
|
|
|
|
|
|
|
return (
|
2024-08-22 05:44:22 -04:00
|
|
|
<div className="review-panel-header">
|
2024-08-12 05:50:54 -04:00
|
|
|
<div className="review-panel-heading">
|
2024-10-04 05:17:36 -04:00
|
|
|
<div className="review-panel-label">
|
|
|
|
{t('review')}
|
|
|
|
<span className="review-panel-split-test-badge">
|
|
|
|
<SplitTestBadge
|
|
|
|
splitTestName="review-panel-redesign"
|
|
|
|
displayOnVariants={['enabled']}
|
|
|
|
/>
|
|
|
|
</span>
|
|
|
|
</div>
|
2024-10-18 06:14:45 -04:00
|
|
|
<button
|
2024-08-12 05:50:54 -04:00
|
|
|
type="button"
|
2024-10-18 06:14:45 -04:00
|
|
|
className="btn review-panel-close-button"
|
2024-08-12 05:50:54 -04:00
|
|
|
onClick={() => setReviewPanelOpen(false)}
|
|
|
|
>
|
|
|
|
<MaterialIcon type="close" />
|
2024-10-18 06:14:45 -04:00
|
|
|
</button>
|
2024-08-12 05:50:54 -04:00
|
|
|
</div>
|
|
|
|
<div className="review-panel-tools">
|
2024-08-19 09:16:56 -04:00
|
|
|
<ReviewPanelResolvedThreadsButton />
|
2024-08-12 05:50:54 -04:00
|
|
|
<ReviewPanelTrackChangesMenuButton
|
|
|
|
menuExpanded={trackChangesMenuExpanded}
|
|
|
|
setMenuExpanded={setTrackChangesMenuExpanded}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{trackChangesMenuExpanded && <ReviewPanelTrackChangesMenu />}
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default memo(ReviewPanelHeader)
|