<commit_before>import React from 'react';

import { EventEmitter } from '../components/event-emitter';

export default class SignInOverlay extends React.Component {
    constructor (props) {
        super(props);

        this.state = {
            visible: false
        };
    }

    componentDidMount () {
        EventEmitter.subscribe('sign_in:on', () => {
            this.setState({ visible: true });
        });

        EventEmitter.subscribe('sign_in:off', () => {
            this.setState({ visible: false });
        });
    }

    render () {
        const displayStyle = this.state.visible
            ? { display: 'flex' }
            : { display: 'none' };

        return (
            <div className="shield sign-in-overlay" style={displayStyle}>
                <h1>waiting for sign in</h1>
            </div>
        );
    }
}

// Externally called to turn this on.
export function showSignInOverlay () {
    EventEmitter.dispatch('sign_in:on', {});
}

export function hideSignInOverlay () {
    EventEmitter.dispatch('sign_in:off', {});
}<commit_msg>Initial attempt at a sign-in overlay instead of hacking the end-of-sign-in page<commit_after>import React from 'react';

import { EventEmitter } from '../components/event-emitter';

export default class SignInOverlay extends React.Component {
    constructor (props) {
        super(props);

        this.state = {
            visible: false
        };

        this.show = this.show.bind(this);
        this.hide = this.hide.bind(this);
    }

    componentDidMount () {
        EventEmitter.subscribe('sign_in:on', () => {
            this.show();
        });

        EventEmitter.subscribe('sign_in:off', () => {
            this.hide();
        });
    }

    show () {
        this.setState({ visible: true });
    }

    hide () {
        window.setTimeout(() => {
            this.setState({ visible: false });
        }, 1600);
    }

    render () {
        const displayStyle = this.state.visible
            ? { display: 'flex' }
            : { display: 'none' };

        return (
            <div className="shield sign-in-overlay" style={displayStyle}>
                <div className="sign-in-overlay-title">Waiting for you to sign in...</div>
            </div>
        );
    }
}

// Externally called to turn this on.
export function showSignInOverlay () {
    EventEmitter.dispatch('sign_in:on', {});
}

export function hideSignInOverlay () {
    EventEmitter.dispatch('sign_in:off', {});
}
{'fraction_non_alphanumeric': 0.14256947241240436, 'fraction_numerical': 0.0024164317358034634, 'mean_word_length': 2.0366748166259168, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 16, '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': '1866665', 'n_tokens_mistral': 708, 'n_tokens_neox': 702, 'n_words': 146}