<commit_before>import React from 'react';
import ReactDOM from 'react-dom';
import {Grid, Row, Col, Clearfix, Button, Panel, Tooltip, ButtonToolbar, OverlayTrigger} from 'react-bootstrap';
import Form from './LandingForm.jsx';

const Landing = (props) => {
  const App = props.App;
  const newBoard = () => {
    console.log('button clicked');
    const requestBoard = new XMLHttpRequest();
    requestBoard.addEventListener('load', (response) => {
      const newBoardId = response.target.response;
      window.location.hash = newBoardId;
      ReactDOM.render(<App />, document.getElementById('root'));
    });
    requestBoard.open('GET', 'http://localhost:3000/board');
    requestBoard.send();
  };

  const tooltip = (
  <Tooltip id="tooltip"><strong>Start a new Drawmie!</strong></Tooltip>
);

  const gridInstance = (
  <Grid>
    <Row className="show-grid">
      <Col xs={6} md={4}></Col>
      <Col xs={6} md={4}>
      <div className='drawmie-title'>
        <center>
          <h1>Drawmie</h1>
          <ButtonToolbar>
          <OverlayTrigger placement="bottom" overlay={tooltip}>
            <Button className="drawmie-button" bsStyle="primary" bsSize="large" onClick={newBoard}>New Drawmie</Button>
          </OverlayTrigger>
          </ButtonToolbar>
        </center>

        <Panel className="drawmie-join" header='Join A Drawmie'>
          <Form />
        </Panel>
        </div>
      </Col>
      <Col xs={6} md={4}></Col>
    </Row>
  </Grid>
);

  return gridInstance;


  // return (
  //   <center>
  //     <h1>Drawmie Landing Page</h1>
  //     <button onClick={newBoard}>New Drawmie</button>
  //   </center>
  // );
};

module.exports = Landing;
<commit_msg>Fix get request to use origin instead of hardcoded value<commit_after>import React from 'react';
import ReactDOM from 'react-dom';
import {Grid, Row, Col, Clearfix, Button, Panel, Tooltip, ButtonToolbar, OverlayTrigger} from 'react-bootstrap';
import Form from './LandingForm.jsx';

const Landing = (props) => {
  const origin = window.location.origin;
  const App = props.App;
  const newBoard = () => {
    console.log('button clicked');
    const requestBoard = new XMLHttpRequest();
    requestBoard.addEventListener('load', (response) => {
      const newBoardId = response.target.response;
      window.location.hash = newBoardId;
      ReactDOM.render(<App />, document.getElementById('root'));
    });
    requestBoard.open('GET', origin + '/board');
    requestBoard.send();
  };

  const tooltip = (
  <Tooltip id="tooltip"><strong>Start a new Drawmie!</strong></Tooltip>
);

  const gridInstance = (
  <Grid>
    <Row className="show-grid">
      <Col xs={6} md={4}></Col>
      <Col xs={6} md={4}>
      <div className='drawmie-title'>
        <center>
          <h1>Drawmie</h1>
          <ButtonToolbar>
          <OverlayTrigger placement="bottom" overlay={tooltip}>
            <Button className="drawmie-button" bsStyle="primary" bsSize="large" onClick={newBoard}>New Drawmie</Button>
          </OverlayTrigger>
          </ButtonToolbar>
        </center>

        <Panel className="drawmie-join" header='Join A Drawmie'>
          <Form />
        </Panel>
        </div>
      </Col>
      <Col xs={6} md={4}></Col>
    </Row>
  </Grid>
);

  return gridInstance;


  // return (
  //   <center>
  //     <h1>Drawmie Landing Page</h1>
  //     <button onClick={newBoard}>New Drawmie</button>
  //   </center>
  // );
};

module.exports = Landing;

{'fraction_non_alphanumeric': 0.16483833718244803, 'fraction_numerical': 0.006928406466512702, 'mean_word_length': 2.841463414634146, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 81, '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': '6928664', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1069, 'n_words': 237}