mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 14:23:43 -05:00
438192fc11
* Remove need for custom set-review-panel-open event * Open current file view when clicking add comment tooltip --------- Co-authored-by: Domagoj Kriskovic <dom.kriskovic@overleaf.com> GitOrigin-RevId: 2b21061193f4270030d73174014aabbd017fd38e
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { FC, memo } from 'react'
|
|
import classnames from 'classnames'
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
import { useTranslation } from 'react-i18next'
|
|
import {
|
|
useReviewPanelViewActionsContext,
|
|
useReviewPanelViewContext,
|
|
} from '../context/review-panel-view-context'
|
|
|
|
const ReviewPanelTabs: FC = () => {
|
|
const subView = useReviewPanelViewContext()
|
|
const { setView: setSubView } = useReviewPanelViewActionsContext()
|
|
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<>
|
|
<button
|
|
className={classnames('review-panel-tab', {
|
|
'review-panel-tab-active': subView === 'cur_file',
|
|
})}
|
|
onClick={() => setSubView('cur_file')}
|
|
>
|
|
<MaterialIcon type="description" />
|
|
{t('current_file')}
|
|
</button>
|
|
<button
|
|
className={classnames('review-panel-tab', {
|
|
'review-panel-tab-active': subView === 'overview',
|
|
})}
|
|
onClick={() => setSubView('overview')}
|
|
>
|
|
<MaterialIcon type="list" />
|
|
{t('overview')}
|
|
</button>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default memo(ReviewPanelTabs)
|