mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Rename TrackChangesToggleButton prop to match onMouseDown attribute (#12862)
GitOrigin-RevId: bf2a83c58298ee809f181d95beddec695d223922
This commit is contained in:
parent
09c5bf72d2
commit
2796f750ee
2 changed files with 8 additions and 4 deletions
|
@ -68,7 +68,7 @@ const ToolbarHeader = React.memo(function ToolbarHeader({
|
|||
|
||||
{shouldDisplayTrackChangesButton && (
|
||||
<TrackChangesToggleButton
|
||||
onClick={toggleReviewPanelOpen}
|
||||
onMouseDown={toggleReviewPanelOpen}
|
||||
disabled={historyIsOpen}
|
||||
trackChangesIsOpen={reviewPanelOpen}
|
||||
/>
|
||||
|
|
|
@ -2,7 +2,11 @@ import PropTypes from 'prop-types'
|
|||
import classNames from 'classnames'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
function TrackChangesToggleButton({ trackChangesIsOpen, disabled, onClick }) {
|
||||
function TrackChangesToggleButton({
|
||||
trackChangesIsOpen,
|
||||
disabled,
|
||||
onMouseDown,
|
||||
}) {
|
||||
const { t } = useTranslation()
|
||||
const classes = classNames('btn', 'btn-full-height', {
|
||||
active: trackChangesIsOpen && !disabled,
|
||||
|
@ -11,7 +15,7 @@ function TrackChangesToggleButton({ trackChangesIsOpen, disabled, onClick }) {
|
|||
|
||||
return (
|
||||
<div className="toolbar-item">
|
||||
<button disabled={disabled} className={classes} onMouseDown={onClick}>
|
||||
<button disabled={disabled} className={classes} onMouseDown={onMouseDown}>
|
||||
<i className="review-icon" />
|
||||
<p className="toolbar-label">{t('review')}</p>
|
||||
</button>
|
||||
|
@ -22,7 +26,7 @@ function TrackChangesToggleButton({ trackChangesIsOpen, disabled, onClick }) {
|
|||
TrackChangesToggleButton.propTypes = {
|
||||
trackChangesIsOpen: PropTypes.bool,
|
||||
disabled: PropTypes.bool,
|
||||
onClick: PropTypes.func.isRequired,
|
||||
onMouseDown: PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
export default TrackChangesToggleButton
|
||||
|
|
Loading…
Reference in a new issue