<commit_before>import React from 'react';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import utils from '../utils';

import Login from './Login';
import Dashboard from './Dashboard';


class App extends React.Component {
	constructor(){
		super();
	}

	render(){
		return(
			<BrowserRouter>
				<Switch>
					{ !utils.isLoggedIn() &&
						<Route path='/' component={ Login }/>
					}
					<Route exact path='/' component={ Dashboard } />
				</Switch>
			</BrowserRouter>
		)
	}
}

export default App;<commit_msg>routing based on login status<commit_after>import React from 'react';
import { BrowserRouter, Route, Switch } from 'react-router-dom';

import utils from '../utils';
import Login from './Login';
import Dashboard from './Dashboard';


function loggedIn() {
	return false;
}

function requireAuth(component) {
	return (
		loggedIn() ? component : <Login />
	);
}

class App extends React.Component {
	constructor(){
		super();
	}

	render(){
		return (
			<BrowserRouter>
				<Switch>
					<Route exact path='/' render={ () => (requireAuth(<Dashboard/>)) } />
				</Switch>
			</BrowserRouter>
		);
	}
}

export default App;
{'fraction_non_alphanumeric': 0.15975820379965458, 'fraction_numerical': 0.0, 'mean_word_length': 3.457692307692308, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 17, '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': '7292976', 'n_tokens_mistral': 407, 'n_tokens_neox': 356, 'n_words': 102}