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
/* global firebase */ | |
export default () => { // <== here this is the component "App" | |
const googleAuthProviderRef = new firebase.auth.GoogleAuthProvider(); | |
firebase.auth().signInWithPopup(googleAuthProviderRef).then( | |
()=>{ | |
firebase.firestore().settings({timestampsInSnapshots: true}) | |
const docRef = firebase.firestore().collection('test').doc('adminTest'); |
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
autentica() { | |
firebase.auth().signInWithPopup(this.state.googleAuthProviderRef).then((result)=>{ | |
this.state.userReference.where('uid', '==', result.user.uid).get().then(querySnapshot=> { | |
if (querySnapshot.size > 0) { | |
console.log('utente autorizzato ad accedere all\'area protetta'); | |
this.setState(prevState=>{ | |
return { | |
...prevState, |
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
const mapStateToProps = state => { | |
return { | |
droneTemplates: state.droneTemplates.map(el => { | |
return { | |
name: el.name, | |
imageURL: el.photoUrls[0], | |
description: el.description | |
} | |
}) | |
} |
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
function getSequenceLongestAnimation(sequence) { | |
let longestAnimationValue; | |
let longestAnimationIndex; | |
const overrides = sequence.overrides; | |
// all animations have the same duration and delay | |
if (!!overrides) { | |
return undefined; | |
} |
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 axios from 'axios'; | |
import { createStore, applyMiddleware } from 'redux'; | |
import thunk from 'redux-thunk'; | |
const setWord = (word) => { | |
return { | |
type: "SET_WORD", | |
word | |
} | |
} |
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
export default () => ( | |
<BrowserRouter> | |
<Switch> | |
<Route exact path="/" components={Landing} /> | |
<Route path="/login" components={Login} /> | |
<Route path="/register" components={Register} /> | |
<Route render={()=> ( | |
<Switch> | |
<Drawer/> | |
<Route path="/dashboard" components={Dashboard}/> |
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
ERROR in C:/Users/Aquazi/node_modules/react-transition-group/Transition.js | |
Module not found: Error: Can't resolve 'react-dom' in 'C:\Users\Aquazi\node_modules\react-transition-group' | |
@ C:/Users/Aquazi/node_modules/react-transition-group/Transition.js 14:16-36 | |
@ C:/Users/Aquazi/node_modules/@material-ui/core/Collapse/Collapse.js | |
@ C:/Users/Aquazi/node_modules/@material-ui/core/Collapse/index.js | |
@ C:/Users/Aquazi/node_modules/@material-ui/core/index.es.js | |
@ ./src/app.js | |
@ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js |
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 { Toolbar, AppBar, Typography, Button } from '@material-ui/core'; | |
import { NavLink } from 'react-router-dom'; | |
const style = ({ | |
color: 'red' | |
}) | |
export default () => ( | |
<AppBar position="static" color="primary"> |
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
<BrowserRouter> | |
<div> | |
<Header /> | |
<Switch> | |
<Route path="/" component={FrontPage} exact={true} /> | |
<Route path="/blog" component={BlogPage} /> | |
<Route path="/contacts" component={ContactsPage} /> | |
<Route component={NotFoundPage} /> | |
</Switch> | |
<Footer /> |
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 'import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'; | |
import CssBaseline from '@material-ui/core/CssBaseline'; | |
import AppRouter from './routers/AppRouter'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import configureStore from './store/configureStore'; | |
import { Provider } from 'react-redux'; | |
// AppRouter is: <BrowserRoter> // etc </BrowserRouter> // |