import React from 'react';
import {
  BrowserRouter as Router,
  Route,
  Switch
} from 'react-router-dom';
import firebase from 'firebase';
import { NavigationBar } from '../NavigationBar';
import { PageHome } from '../PageHome';
import { PageLogin } from '../PageLogin';
import { PageAdmin } from '../PageAdmin';
import { NoRouteMatch } from '../NoRouteMatch';
import { SecuredRoute } from './SecuredRoute';
import { UnsecuredRoute } from './UnsecuredRoute';

class PageRouter extends React.Component {
    componentDidMount() {
        firebase.auth().onAuthStateChanged( user => {
            if ( user ) {
                //
            } else {
                //
            }
        });
    }
    render() {
        return (
            <Router>
                <div>
                    <NavigationBar />

                    <Switch>
                        <Route exact path="/" component={PageHome}/>
                        <UnsecuredRoute path="/login" component={PageLogin}/>
                        <SecuredRoute path="/admin" component={PageAdmin}/>
                        <Route component={NoRouteMatch}/>
                    </Switch>
                </div>
            </Router>
        );
    }
}

export { PageRouter };

@@ -237,21 +237,35 @@
 t %7B Page
-Login
+Signin, PageSignout
  %7D from 
@@ -272,20 +272,19 @@
 '../Page
-Logi
+Sig
 n';%0Aimpo
@@ -515,205 +515,8 @@
 t %7B%0A
-    componentDidMount() %7B%0A        firebase.auth().onAuthStateChanged( user =%3E %7B%0A            if ( user ) %7B%0A                //%0A            %7D else %7B%0A                //%0A            %7D%0A        %7D);%0A    %7D%0A
     
@@ -774,11 +774,12 @@
 h=%22/
-log
+sign
 in%22 
@@ -797,13 +797,94 @@
 Page
-Login
+Signin%7D/%3E%0A                        %3CSecuredRoute path=%22/signout%22 component=%7BPageSignout
 %7D/%3E%0A

Move PageRouter component to own file