<commit_before>import React, { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import tinykeys from 'tinykeys';
import {
  undo,
  redo,
  switchTool,
  changeDimensions
} from '../store/actions/actionCreators';
import {
  MOVE,
  ERASER,
  BUCKET,
  EYEDROPPER,
  COLOR_PICKER
} from '../store/reducers/drawingToolStates';

const KeyBindings = ({ onClick }) => {
  const dispatch = useDispatch();
  useEffect(() => {
    const keyCombinations = {
      '$mod+KeyZ': event => {
        event.preventDefault();
        dispatch(undo());
      },
      '$mod+KeyY': event => {
        event.preventDefault();
        dispatch(redo());
      },
      // prettier-ignore
      'KeyM': event => {
        event.preventDefault();
        dispatch(switchTool(MOVE));
      },
      // prettier-ignore
      'KeyE': event => {
        event.preventDefault();
        dispatch(switchTool(ERASER));
      },
      // prettier-ignore
      'KeyB': event => {
        event.preventDefault();
        dispatch(switchTool(BUCKET));
      },
      // prettier-ignore
      'KeyO': event => {
        event.preventDefault();
        dispatch(switchTool(EYEDROPPER));
      },
      // prettier-ignore
      'KeyP': event => {
        event.preventDefault();
        dispatch(switchTool(COLOR_PICKER));
      },
      '$mod+ArrowRight': event => {
        event.preventDefault();
        dispatch(changeDimensions('columns', 1));
      },
      '$mod+ArrowLeft': event => {
        event.preventDefault();
        dispatch(changeDimensions('columns', -1));
      },
      '$mod+ArrowDown': event => {
        event.preventDefault();
        dispatch(changeDimensions('rows', 1));
      },
      '$mod+ArrowUp': event => {
        event.preventDefault();
        dispatch(changeDimensions('rows', -1));
      }
    };
    const unsubscribe = tinykeys(window, keyCombinations);
    return () => {
      unsubscribe();
    };
  });
  return (
    <button
      type="button"
      className="app__shortcuts-button"
      aria-label="Active modal"
      onClick={onClick}
    />
  );
};

export default KeyBindings;<commit_msg>Update button aria-label<commit_after>import React, { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import tinykeys from 'tinykeys';
import {
  undo,
  redo,
  switchTool,
  changeDimensions
} from '../store/actions/actionCreators';
import {
  MOVE,
  ERASER,
  BUCKET,
  EYEDROPPER,
  COLOR_PICKER
} from '../store/reducers/drawingToolStates';

const KeyBindings = ({ onClick }) => {
  const dispatch = useDispatch();
  useEffect(() => {
    const keyCombinations = {
      '$mod+KeyZ': event => {
        event.preventDefault();
        dispatch(undo());
      },
      '$mod+KeyY': event => {
        event.preventDefault();
        dispatch(redo());
      },
      // prettier-ignore
      'KeyM': event => {
        event.preventDefault();
        dispatch(switchTool(MOVE));
      },
      // prettier-ignore
      'KeyE': event => {
        event.preventDefault();
        dispatch(switchTool(ERASER));
      },
      // prettier-ignore
      'KeyB': event => {
        event.preventDefault();
        dispatch(switchTool(BUCKET));
      },
      // prettier-ignore
      'KeyO': event => {
        event.preventDefault();
        dispatch(switchTool(EYEDROPPER));
      },
      // prettier-ignore
      'KeyP': event => {
        event.preventDefault();
        dispatch(switchTool(COLOR_PICKER));
      },
      '$mod+ArrowRight': event => {
        event.preventDefault();
        dispatch(changeDimensions('columns', 1));
      },
      '$mod+ArrowLeft': event => {
        event.preventDefault();
        dispatch(changeDimensions('columns', -1));
      },
      '$mod+ArrowDown': event => {
        event.preventDefault();
        dispatch(changeDimensions('rows', 1));
      },
      '$mod+ArrowUp': event => {
        event.preventDefault();
        dispatch(changeDimensions('rows', -1));
      }
    };
    const unsubscribe = tinykeys(window, keyCombinations);
    return () => {
      unsubscribe();
    };
  });
  return (
    <button
      type="button"
      className="app__shortcuts-button"
      aria-label="Show keyboard shortcuts"
      onClick={onClick}
    />
  );
};

export default KeyBindings;
{'fraction_non_alphanumeric': 0.1569223573433115, 'fraction_numerical': 0.0018709073900841909, 'mean_word_length': 2.3284046692607006, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '100648', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1289, 'n_words': 214}