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

ok.

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