<commit_before>import React from 'react';
import colors from '../colors';
import { wpm, accuracy } from '../helpers/wpm';

const summaryStyle = {
  clear: "both",
  display: "block",
  margin: "30px 0 0 0",
  padding: "8px",
  backgroundColor: colors.primary2,
  borderRadius: "2px",
}

const headerStyle = {
  padding: "10px",
  background: "linear-gradient(" + colors.primary1 + ", " + colors.primary3 + ")",
  borderRadius: "4px",
};

const TypingTestSummary = props => {
  if (!props.typingTest.finished)
    return null;

  const { correctChars, wrongChars }  = props.typingTest;
  const { startTime, endTime } = props.typingTest;
  const wpmMeasure = wpm(correctChars, wrongChars, endTime - startTime);

  return (
  <div style={summaryStyle}>
    <h2 style={headerStyle}>Summary</h2>
    <div>WPM: {wpmMeasure.toFixed(1)}</div>
    <div>Accuracy: {accuracy(correctChars, wrongChars).toFixed(1)}%</div>
    <div>
      <button type="button" onClick={() => props.onResetClick()}>Try again!</button>
    </div>
  </div>);
}

export default TypingTestSummary;<commit_msg>Display WPM bigger in summary<commit_after>import React from 'react';
import colors from '../colors';
import { wpm, accuracy } from '../helpers/wpm';

const summaryStyle = {
  clear: "both",
  display: "block",
  margin: "30px 0 0 0",
  padding: "8px",
  backgroundColor: colors.primary2,
  borderRadius: "2px",
  textAlign: "center",
}

const headerStyle = {
  padding: "10px",
  background: "linear-gradient(" + colors.primary1 + ", " + colors.primary3 + ")",
  borderRadius: "4px",
};

const TypingTestSummary = props => {
  if (!props.typingTest.finished)
    return null;

  const { correctChars, wrongChars }  = props.typingTest;
  const { startTime, endTime } = props.typingTest;
  const wpmMeasure = wpm(correctChars, wrongChars, endTime - startTime);

  return (
  <div style={summaryStyle}>
    <h2 style={headerStyle}>Summary</h2>
    <div style={{fontSize: "5em"}}>{wpmMeasure.toFixed(1)}</div>
    <div style={{fontSize: "1.3em"}}>WPM</div>
    <div style={{marginTop: "2em"}}>Accuracy: {accuracy(correctChars, wrongChars).toFixed(1)}%</div>
    <div>
      <button type="button" onClick={() => props.onResetClick()}>Try again!</button>
    </div>
  </div>);
}

export default TypingTestSummary;
{'fraction_non_alphanumeric': 0.17046450482033304, 'fraction_numerical': 0.016652059596844872, 'mean_word_length': 4.321678321678322, 'pattern_counts': {'":': 0, '<': 29, '<?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': '5613222', 'n_tokens_mistral': 804, 'n_tokens_neox': 779, 'n_words': 175}