Skip to content

Commit

Permalink
removed most log in components
Browse files Browse the repository at this point in the history
  • Loading branch information
mldangelo committed Sep 24, 2018
1 parent 6d35962 commit 48026b5
Show file tree
Hide file tree
Showing 20 changed files with 6 additions and 482 deletions.
53 changes: 0 additions & 53 deletions app/components/Routes/AdminRoute.js

This file was deleted.

52 changes: 0 additions & 52 deletions app/components/Routes/PrivateRoute.js

This file was deleted.

4 changes: 0 additions & 4 deletions app/components/Template/Hamburger.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { Component } from 'react';
import { Link } from 'react-router-dom';

import Menus from 'react-burger-menu';
import cookie from 'js-cookie';

import routes from '../../data/routes';

Expand Down Expand Up @@ -40,7 +39,6 @@ class Hamburger extends Component {
}

render() {
const { id, admin } = cookie.get();
return (
<div className="hamburger-container">
<nav className="main" id="hambuger-nav">
Expand All @@ -57,8 +55,6 @@ class Hamburger extends Component {
</Link>
</li>
))}
{admin ? <li><Link to="/admin"><h3>Admin</h3></Link></li> : null}
{id ? <li><a href="/logout"><h3>Logout</h3></a></li> : null}
</ul>
</Menu>
</div>
Expand Down
5 changes: 0 additions & 5 deletions app/components/Template/Header.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import React from 'react';
import { Link } from 'react-router-dom';
import cookie from 'js-cookie';

import Hamburger from './Hamburger';
import routes from '../../data/routes';

const { id, admin } = cookie.get();

const Header = () => (
<header id="header">
<h1 className="index-link">
Expand All @@ -21,8 +18,6 @@ const Header = () => (
<Link to={l.path}>{l.label}</Link>
</li>
))}
{admin ? <li><a href="/admin">Admin</a></li> : null}
{id ? <li><a href="/logout">Logout</a></li> : null}
</ul>
</nav>
<Hamburger />
Expand Down
15 changes: 1 addition & 14 deletions app/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';

import PrivateRoute from './components/Routes/PrivateRoute';
import AdminRoute from './components/Routes/AdminRoute';

// Featured
import Index from './views/Index';
import About from './views/About';
Expand All @@ -16,18 +13,11 @@ import Contact from './views/Contact';
// Hidden
import Music from './views/Music';

import Login from './views/Login';
import Admin from './views/Admin';

import NotFound from './views/NotFound';

// All of our CSS
require('./static/css/main.scss');

if (window.location.href.endsWith('#')) { // For Google Oauth
window.history.replaceState({}, '', window.location.href.slice(0, -1));
}

ReactDOM.render(
<Router>
<Switch>
Expand All @@ -37,10 +27,7 @@ ReactDOM.render(
<Route path="/stats" component={Stats} />
<Route path="/contact" component={Contact} />
<Route path="/music" component={Music} />
<Route path="/login" component={Login} />

<PrivateRoute path="/resume" component={Resume} />
<AdminRoute path="/admin" component={Admin} />
<Route path="/resume" component={Resume} />

<Route component={NotFound} status={404} />
</Switch>
Expand Down
5 changes: 1 addition & 4 deletions app/layouts/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import PropTypes from 'prop-types';
import Helmet from 'react-helmet';

import ReactGA from 'react-ga';
import cookie from 'js-cookie';

import Header from '../components/Template/Header';
import Nav from '../components/Template/Nav';

if (process.env.NODE_ENV === 'production') {
ReactGA.initialize('UA-68649021-1');
ReactGA.initialize(process.env.GA_ID);
}

class Main extends Component {
Expand All @@ -19,10 +18,8 @@ class Main extends Component {

componentDidMount() {
if (process.env.NODE_ENV === 'production') {
const { id } = cookie.get();
ReactGA.set({
page: window.location.pathname,
userId: id,
});
ReactGA.pageview(window.location.pathname);
}
Expand Down
2 changes: 0 additions & 2 deletions app/static/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@
@import 'layout/footer';
@import 'layout/menu';

@import 'views/admin';
@import 'views/about';
@import 'views/contact';
@import 'views/login';
@import 'views/music';
@import 'views/notFound';
@import 'views/resume';
Expand Down
22 changes: 0 additions & 22 deletions app/static/css/views/_admin.scss

This file was deleted.

39 changes: 0 additions & 39 deletions app/static/css/views/_login.scss

This file was deleted.

71 changes: 0 additions & 71 deletions app/views/Admin.js

This file was deleted.

24 changes: 0 additions & 24 deletions app/views/Login.js

This file was deleted.

3 changes: 3 additions & 0 deletions sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ HOSTNAME=http://localhost:7999

# any random string
SESSION_SECRET=1234567890

# Google analytics ID
GA_ID=UA_123456
Loading

0 comments on commit 48026b5

Please sign in to comment.