mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
08ccdb79d3
* Use a block widget for top padding * Update review panel positions when the editor geometry changes * Remove editorPaddingTop from position calculations * Recalculate review panel on start adding comment * Assert on line content rather than index * Use broadcastChange * Keep focus in the editor when opening the review panel * debounce broadcastChange * Set CULL_AFTER to Infinity GitOrigin-RevId: a8d7b8967736a9164b5264eeaadf334c15ec95ce
28 lines
789 B
JavaScript
28 lines
789 B
JavaScript
import PropTypes from 'prop-types'
|
|
import classNames from 'classnames'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
function TrackChangesToggleButton({ trackChangesIsOpen, disabled, onClick }) {
|
|
const { t } = useTranslation()
|
|
const classes = classNames('btn', 'btn-full-height', {
|
|
active: trackChangesIsOpen && !disabled,
|
|
disabled,
|
|
})
|
|
|
|
return (
|
|
<div className="toolbar-item">
|
|
<button disabled={disabled} className={classes} onMouseDown={onClick}>
|
|
<i className="review-icon" />
|
|
<p className="toolbar-label">{t('review')}</p>
|
|
</button>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
TrackChangesToggleButton.propTypes = {
|
|
trackChangesIsOpen: PropTypes.bool,
|
|
disabled: PropTypes.bool,
|
|
onClick: PropTypes.func.isRequired,
|
|
}
|
|
|
|
export default TrackChangesToggleButton
|