<commit_before>import React from 'react';
import Page from "../Page";
import LoginArea from '../../LoginArea'
import ChatArea from '../../ChatArea'

import io from 'socket.io-client'


var socket = io('/chat');

// Add a connect listener
socket.on('connect', function (socket) {
    console.log('Client side : Connected!');
});


export default class Chat extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            isLoggedIn: false,
            username: ''
        };
        this.handleUsername = this.handleUsername.bind(this);
    }

    handleUsername(name) {
        this.setState({
            isLoggedIn: true,
            username: name
        })

    }



    renderLoginArea() {
        return (
            <LoginArea getUsername={this.handleUsername}/>
        )
    }

    renderChatArea() {
        return (
            <ChatArea/>
        )
    }


    render() {
        return (
            <Page>
                {this.state.isLoggedIn ? this.renderChatArea() : this.renderLoginArea()}
            </Page>
        )

    }
}<commit_msg> #Login Area  #enter username then show chat area<commit_after>import React from 'react';
import Page from "../Page";
import LoginArea from '../../LoginArea'
import ChatArea from '../../ChatArea'

import io from 'socket.io-client'


var socket = io('/chat');

// Add a connect listener
socket.on('connect', function (socket) {
    console.log('Client side : Connected!');
});


export default class Chat extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            isLoggedIn: false,
            username: ''
        };
        this.handleUsername = this.handleUsername.bind(this);
    }

    handleUsername(name) {
        this.setState({
            isLoggedIn: true,
            username: name
        })

    }

    renderLoginArea() {
        return (
            <LoginArea getUsername={this.handleUsername}/>
        )
    }

    renderChatArea() {
        return (
            <ChatArea/>
        )
    }

    render() {
        return (
            <Page>
                {this.state.isLoggedIn ? this.renderChatArea() : this.renderLoginArea()}
            </Page>
        )
    }
}
{'fraction_non_alphanumeric': 0.12923351158645277, 'fraction_numerical': 0.0, 'mean_word_length': 1.7853598014888337, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4306124', 'n_tokens_mistral': 633, 'n_tokens_neox': 619, 'n_words': 142}