This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Link } from 'react-router-dom'; | |
import logo from './logo.png'; | |
import './App.css'; | |
const AppComponent = ({authed, login, logout}) => { | |
const authButtons = authed ? | |
<a href="#" onClick={logout}>Logout</a> : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { connect } from 'react-redux'; | |
import { pathToJS, firebaseConnect } from 'react-redux-firebase'; | |
import ProfileComponent from './ProfileComponent'; | |
const ProfileContainer = ({profile}) => ( | |
<ProfileComponent profile={profile}/> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import './User.css'; | |
const ProfileComponent = ({profile}) => ( | |
<div className="profile"> | |
<h2>{profile.name}</h2> | |
<h4>you have {profile.points} points</h4> | |
</div> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import configureStore from './store'; | |
import { Provider } from 'react-redux'; | |
import { | |
BrowserRouter as Router, | |
Redirect, | |
Route | |
} from 'react-router-dom'; | |
import { pathToJS } from 'react-redux-firebase'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* old code */ | |
.nav { | |
padding: 10px; | |
width: 100%; | |
text-align: center; | |
border-top: 1px solid grey; | |
border-bottom: 1px solid grey; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.profile { | |
text-align: center; | |
margin-top: 50px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Inventory Manager</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> | |
<div id="app"></div> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// other parts of the file we wont change | |
"scripts": { | |
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", | |
"start": "npm run dev", | |
"api": "nodemon server/index.js", | |
"build": "node build/build.js" | |
}, | |
"directories": { | |
"lib": "server" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function () { | |
const app = this; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A hook that logs service method before, after and error | |
const logger = require('winston'); | |
module.exports = function () { | |
return function (hook) { | |
let message = `${hook.type}: ${hook.path} - Method: ${hook.method}`; | |
if (hook.type === 'error') { | |
message += `: ${hook.error.message}`; | |
} |