<commit_before>// @flow

import * as React from 'react'
import {Router} from '@reach/router'
import DocumentTitle from 'react-document-title'
import HTML5Backend from 'react-dnd-html5-backend'
import {DragDropContext} from 'react-dnd'
import {createGlobalStyle} from 'styled-components'
import Loadable from 'react-loadable'
import {LoadingComponent} from './components/loading-comp'

let GlobalStyle = createGlobalStyle`
    *, *::before, *::after {
        box-sizing: inherit;
    }

    html {
        font-family: var(--sans-font-stack);
        color: var(--text-color);

        box-sizing: border-box;

        background: var(--background);
        min-height: 100vh;

        line-height: 1.4;

        font-variant-ligatures: common-ligatures;
        hyphens: auto;
    }

    body {
        height: 100%;
    }

    menu {
        padding: 0;
        margin: 0;
    }

    .content {
        padding-top: var(--page-edge-padding);
        padding-bottom: var(--page-edge-padding);
        overflow-y: scroll;
    }
`

let NotFound = () => <h1>404 Not Found</h1>

let AreaEditor = Loadable({
	loader: () => import('@gob/area-editor').then(mod => mod.Editor),
	loading: LoadingComponent,
})

let StudentPicker = Loadable({
	loader: () => import('./screens/picker'),
	loading: LoadingComponent,
})

let Degubber = Loadable({
	loader: () => import('./screens/degub'),
	loading: LoadingComponent,
})

let CreateStudent = Loadable({
	loader: () => import('./screens/create'),
	loading: LoadingComponent,
})

let Student = Loadable({
	loader: () => import('./screens/student'),
	loading: LoadingComponent,
})

// needs to be a stateful component: otherwise DragDropContext can't assign a ref, which it needs
class App extends React.Component<{}> {
	render() {
		return (
			<div>
				<GlobalStyle />
				<DocumentTitle title="Gobbldygook" />
				<Router>
					<NotFound default />

					<StudentPicker path="/" />
					<Degubber path="/degub" />
					<AreaEditor path="/areas" />
					<Student path="/student/:studentId/*" />
					<CreateStudent path="/create/*" />
				</Router>
			</div>
		)
	}
}

export default DragDropContext(HTML5Backend)(App)<commit_msg>fix StudentPicker to allow multi-level paths<commit_after>// @flow

import * as React from 'react'
import {Router} from '@reach/router'
import DocumentTitle from 'react-document-title'
import HTML5Backend from 'react-dnd-html5-backend'
import {DragDropContext} from 'react-dnd'
import {createGlobalStyle} from 'styled-components'
import Loadable from 'react-loadable'
import {LoadingComponent} from './components/loading-comp'

let GlobalStyle = createGlobalStyle`
    *, *::before, *::after {
        box-sizing: inherit;
    }

    html {
        font-family: var(--sans-font-stack);
        color: var(--text-color);

        box-sizing: border-box;

        background: var(--background);
        min-height: 100vh;

        line-height: 1.4;

        font-variant-ligatures: common-ligatures;
        hyphens: auto;
    }

    body {
        height: 100%;
    }

    menu {
        padding: 0;
        margin: 0;
    }

    .content {
        padding-top: var(--page-edge-padding);
        padding-bottom: var(--page-edge-padding);
        overflow-y: scroll;
    }
`

let NotFound = () => <h1>404 Not Found</h1>

let AreaEditor = Loadable({
	loader: () => import('@gob/area-editor').then(mod => mod.Editor),
	loading: LoadingComponent,
})

let StudentPicker = Loadable({
	loader: () => import('./screens/picker'),
	loading: LoadingComponent,
})

let Degubber = Loadable({
	loader: () => import('./screens/degub'),
	loading: LoadingComponent,
})

let CreateStudent = Loadable({
	loader: () => import('./screens/create'),
	loading: LoadingComponent,
})

let Student = Loadable({
	loader: () => import('./screens/student'),
	loading: LoadingComponent,
})

// needs to be a stateful component: otherwise DragDropContext can't assign a ref, which it needs
class App extends React.Component<{}> {
	render() {
		return (
			<div>
				<GlobalStyle />
				<DocumentTitle title="Gobbldygook" />
				<Router>
					<NotFound default />

					<Degubber path="/degub" />
					<AreaEditor path="/areas" />
					<Student path="/student/:studentId/*" />
					<CreateStudent path="/create/*" />
					<StudentPicker path="/*" />
				</Router>
			</div>
		)
	}
}

export default DragDropContext(HTML5Backend)(App)
{'fraction_non_alphanumeric': 0.15620705451213926, 'fraction_numerical': 0.008245533669262483, 'mean_word_length': 3.01010101010101, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 47, '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': '3790513', 'n_tokens_mistral': 1500, 'n_tokens_neox': 1366, 'n_words': 320}