Commit 2a3678ae by OuiAtichat

start project add base

parent c4c566f4
...@@ -3,8 +3,11 @@ ...@@ -3,8 +3,11 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"bootstrap": "^4.3.1",
"firebase": "^6.3.3", "firebase": "^6.3.3",
"node-sass": "^4.12.0",
"react": "^16.8.6", "react": "^16.8.6",
"react-bootstrap": "^1.0.0-beta.10",
"react-dom": "^16.8.6", "react-dom": "^16.8.6",
"react-router-dom": "^5.0.1", "react-router-dom": "^5.0.1",
"react-scripts": "3.0.1" "react-scripts": "3.0.1"
......
...@@ -2,24 +2,22 @@ import React, { Component } from 'react'; ...@@ -2,24 +2,22 @@ import React, { Component } from 'react';
import { BrowserRouter as Router, Route } from 'react-router-dom'; import { BrowserRouter as Router, Route } from 'react-router-dom';
import PrivateRoute from './components/PrivateRoute'; import PrivateRoute from './components/PrivateRoute';
import app from './firebase'; import app from './firebase';
import Home from './Home'; import Home from './Pages/Home';
import LogIn from './LogIn'; import LogIn from './Pages/LogIn';
class App extends Component { class App extends Component {
state = { loading: true, authenticated: false, user: null }; state = { loading: true, authenticated: false };
componentDidMount() { componentDidMount() {
app.auth().onAuthStateChanged(user => { app.auth().onAuthStateChanged(user => {
if (user) { if (user) {
this.setState({ this.setState({
authenticated: true, authenticated: true,
currentUser: user,
loading: false, loading: false,
}); });
} else { } else {
this.setState({ this.setState({
authenticated: false, authenticated: false,
currentUser: null,
loading: false, loading: false,
}); });
} }
......
import React from 'react'; import React from 'react';
import app from './firebase'; import app from '../firebase';
const Home = () => { const Home = () => {
const signOut = async () => { const signOut = async () => {
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import LogInView from './LogInView'; import LogInView from './LogInView';
import { withRouter } from 'react-router'; import { withRouter } from 'react-router';
import app from '../firebase'; import app from '../../firebase';
class LogInContainer extends Component { class LogInContainer extends Component {
handleSignUp = async event => { handleSignUp = async event => {
......
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
...@@ -2,6 +2,7 @@ import React from 'react'; ...@@ -2,6 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import App from './App'; import App from './App';
import * as serviceWorker from './serviceWorker'; import * as serviceWorker from './serviceWorker';
import './styles.scss';
ReactDOM.render(<App />, document.getElementById('root')); ReactDOM.render(<App />, document.getElementById('root'));
......
// Override default variables before the import
// $body-bg: #000;
// Import Bootstrap and its default variables
@import '~bootstrap/scss/bootstrap.scss';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment