Commit c98233cf authored by Sonia Vidal Gonzalez's avatar Sonia Vidal Gonzalez

ok.

parent 05787e3c
This diff is collapsed.
......@@ -3,14 +3,14 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"firebase": "^5.1.0",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"react-scripts-ts": "2.16.0",
"recompose": "^0.27.1",
"redux": "^4.0.0"
"firebase": "^7.24.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-redux": "^7.1.3",
"react-router-dom": "^5.1.2",
"react-scripts-ts": "3.1.0",
"recompose": "^0.30.0",
"redux": "^4.0.4"
},
"scripts": {
"start": "react-scripts-ts start",
......@@ -21,13 +21,13 @@
"tslint:fix": "tslint --fix --project tsconfig.json"
},
"devDependencies": {
"@types/jest": "^23.1.1",
"@types/node": "^10.3.5",
"@types/react": "^16.4.1",
"@types/react-dom": "^16.0.6",
"@types/react-redux": "^6.0.3",
"@types/react-router-dom": "^4.2.7",
"@types/recompose": "^0.26.1",
"typescript": "^2.9.2"
"@types/jest": "^24.0.23",
"@types/node": "^12.12.17",
"@types/react": "^16.9.16",
"@types/react-dom": "^16.9.4",
"@types/react-redux": "^7.1.5",
"@types/react-router-dom": "^5.1.3",
"@types/recompose": "^0.30.7",
"typescript": "^3.7.3"
}
}
REACT_APP_API_KEY=AIzaSyCkQ9-YKG78_lrdkbIfCAPbTw9M_W3EQLQ
REACT_APP_AUTH_DOMAIN=koaretech-3b93b.firebaseapp.com
REACT_APP_DATABASE_URL=https://koaretech-3b93b.firebaseio.com
REACT_APP_PROJECT_ID=koaretech-3b93b
REACT_APP_STORAGE_BUCKET=koaretech-3b93b.appspot.com
REACT_APP_MESSAGING_SENDER_ID=751918808497
REACT_APP_CONFIRMATION_EMAIL_REDIRECT=http://localhost:3000
\ No newline at end of file
REACT_APP_API_KEY=AIzaSyCkQ9-YKG78_lrdkbIfCAPbTw9M_W3EQLQ
REACT_APP_AUTH_DOMAIN=koaretech-3b93b.firebaseapp.com
REACT_APP_DATABASE_URL=https://koaretech-3b93b.firebaseio.com
REACT_APP_PROJECT_ID=koaretech-3b93b
REACT_APP_STORAGE_BUCKET=koaretech-3b93b.appspot.com
REACT_APP_MESSAGING_SENDER_ID=751918808497
REACT_APP_CONFIRMATION_EMAIL_REDIRECT=http://localhost:3000
\ No newline at end of file
......@@ -20,7 +20,7 @@ class AppComponent extends React.Component {
};
}
public componentDidMount() {
componentDidMount() {
firebase.auth.onAuthStateChanged(authUser => {
authUser
? this.setState(() => ({ authUser }))
......@@ -28,7 +28,7 @@ class AppComponent extends React.Component {
});
}
public render() {
render() {
return (
<BrowserRouter>
<div>
......
......@@ -9,7 +9,7 @@ export class UserList extends React.Component<InterfaceProps, {}> {
super(props);
}
public render() {
render() {
const { users }: any = this.props;
return (
......
......@@ -7,13 +7,13 @@ import { withAuthorization } from "../Session/withAuthorization";
import { UserList } from "./UserList";
class HomeComponent extends React.Component {
public componentDidMount() {
componentDidMount() {
const { onSetUsers }: any = this.props;
db.onceGetUsers().then(snapshot => onSetUsers(snapshot.val()));
}
public render() {
render() {
const { users }: any = this.props;
return (
......
......@@ -33,7 +33,7 @@ export class PasswordChangeForm extends React.Component<
this.state = { ...PasswordChangeForm.INITIAL_STATE };
}
public onSubmit = (event: any) => {
onSubmit = (event: any) => {
const { passwordOne }: any = this.state;
auth
......@@ -48,7 +48,7 @@ export class PasswordChangeForm extends React.Component<
event.preventDefault();
};
public render() {
render() {
const { passwordOne, passwordTwo, error }: any = this.state;
const isInvalid = passwordOne !== passwordTwo || passwordOne === "";
......
......@@ -17,7 +17,7 @@ export class PasswordForgetForm extends React.Component {
this.state = { ...PasswordForgetForm.INITIAL_STATE };
}
public onSubmit = (event: any) => {
onSubmit = (event: any) => {
const { email }: any = this.state;
auth
......@@ -32,7 +32,7 @@ export class PasswordForgetForm extends React.Component {
event.preventDefault();
};
public render() {
render() {
const { email, error }: any = this.state;
const isInvalid = email === "";
......
......@@ -15,7 +15,7 @@ export const withAuthentication = (Component: any) => {
InterfaceProps,
InterfaceState
> {
public componentDidMount() {
componentDidMount() {
const { onSetAuthUser }: any = this.props;
firebase.auth.onAuthStateChanged(authUser => {
......@@ -23,7 +23,7 @@ export const withAuthentication = (Component: any) => {
});
}
public render() {
render() {
return <Component />;
}
}
......
......@@ -12,7 +12,7 @@ interface InterfaceProps {
export const withAuthorization = (condition: any) => (Component: any) => {
class WithAuthorization extends React.Component<InterfaceProps, any> {
public componentDidMount() {
componentDidMount() {
firebase.auth.onAuthStateChanged(authUser => {
if (!condition(authUser)) {
this.props.history.push(routes.SIGN_IN);
......@@ -20,7 +20,7 @@ export const withAuthorization = (condition: any) => (Component: any) => {
});
}
public render() {
render() {
return this.props.authUser ? <Component /> : null;
}
}
......
......@@ -35,7 +35,7 @@ export class SignInForm extends React.Component<
this.state = { ...SignInForm.INITIAL_STATE };
}
public onSubmit = (event: any) => {
onSubmit = (event: any) => {
const { email, password } = this.state;
const { history } = this.props;
......@@ -53,7 +53,7 @@ export class SignInForm extends React.Component<
event.preventDefault();
};
public render() {
render() {
const { email, password, error } = this.state;
const isInvalid = password === "" || email === "";
......
......@@ -40,7 +40,7 @@ export class SignUpForm extends React.Component<
this.state = { ...SignUpForm.INITIAL_STATE };
}
public onSubmit(event: any) {
onSubmit(event: any) {
event.preventDefault();
const { email, passwordOne, username } = this.state;
......@@ -66,7 +66,7 @@ export class SignUpForm extends React.Component<
});
}
public render() {
render() {
const { username, email, passwordOne, passwordTwo, error } = this.state;
const isInvalid =
......
......@@ -2,15 +2,17 @@ import * as firebase from "firebase/app";
import "firebase/auth";
import "firebase/database";
const config = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_AUTH_DOMAIN",
databaseURL: "YOUR_DATABASE_URL",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
projectId: "YOUR PROJECT_ID",
storageBucket: "YOUR_STORAGE_BUCKET"
const config = {
apiKey: "AIzaSyCkKEnwHf_jNlvCa2pW7O_Wo6jBXMS-uhQ",
authDomain: "fir-01-50904.firebaseapp.com",
projectId: "fir-01-50904",
storageBucket: "fir-01-50904.appspot.com",
messagingSenderId: "768893068305",
appId: "1:768893068305:web:0baecb76f39dea20ed3db0",
measurementId: "G-PTQQRK21P9"
};
if (!firebase.apps.length) {
firebase.initializeApp(config);
}
......
......@@ -6,17 +6,26 @@
"target": "es5",
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true
"noUnusedLocals": true,
"moduleResolution": "node",
"allowJs": true,
"skipLibCheck": false,
"esModuleInterop": false,
"strict": false,
"forceConsistentCasingInFileNames": false,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
},
"exclude": [
"node_modules",
......
{
"extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"],
"rules": {
"jsx-no-lambda": false
"jsx-no-lambda": false,
"object-literal-sort-keys": false,
"interface-name": false,
"member-access": [true, "no-public"],
"ordered-imports": false
},
"linterOptions": {
"exclude": ["config/**/*.js", "node_modules/**/*.ts"]
......
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