Rename TrackChangesToggleButton prop to match onMouseDown attribute (#12862)

GitOrigin-RevId: bf2a83c58298ee809f181d95beddec695d223922
This commit is contained in:
Alf Eaton 2023-05-03 09:27:13 +01:00 committed by Copybot
parent 09c5bf72d2
commit 2796f750ee
2 changed files with 8 additions and 4 deletions

View file

@ -68,7 +68,7 @@ const ToolbarHeader = React.memo(function ToolbarHeader({
{shouldDisplayTrackChangesButton && (
<TrackChangesToggleButton
onClick={toggleReviewPanelOpen}
onMouseDown={toggleReviewPanelOpen}
disabled={historyIsOpen}
trackChangesIsOpen={reviewPanelOpen}
/>

View file

@ -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