Commit f1e0cd78 by muhsin

conflict1

parent 468e6757
......@@ -6,120 +6,40 @@
}
.side_menu_wrapper {
<<<<<<< HEAD
background: rgba(41, 40, 91, 1);
width: 100%;
height: 100vh;
padding-left: 20px;
padding-top: 20px;
padding-right: 10px;
.top_banner {
.top_image {
width: 60px;
height: 60px;
float: left;
background-color: #fff;
border-radius: 50%;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
border-radius: 50%;
}
.sidemenu_list {
padding-top: 30px;
ul {
margin: 0px;
padding: 0px;
li {
list-style: none;
color: #fff;
font-weight: 200;
font-size: 15px;
padding: 10px;
font-size: 16px;
&:focus {
background-color: rgba(40, 36, 88, 1);
}
}
.top_detail {
width: calc(100% - 60px);
float: left;
padding: 7px;
padding-left: 15px;
h4 {
margin: 0px;
padding: 0px;
color: #fff;
&:hover {
background-color: rgba(40, 36, 88, 1);
}
p {
margin: 0px;
padding: 0px;
color: #fff;
.version {
color: rgba(176, 174, 199, 1);
font-size: 14px;
}
=======
background: rgba(41, 40, 91, 1);
width: 100%;
height: 100vh;
padding-left: 20px;
padding-top: 20px;
padding-right: 10px;
.top_banner {
.top_image {
width: 60px;
height: 60px;
float: left;
border-radius: 50%;
background-color: #fff;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
border-radius: 50%;
}
}
.top_detail {
width: calc(100% - 60px);
float: left;
padding: 7px;
padding-left: 15px;
h4 {
margin: 0px;
padding: 0px;
color: #fff;
}
p {
margin: 0px;
padding: 0px;
color: #fff;
color: rgba(176, 174, 199, 1);
}
}
>>>>>>> a9bd8295df980b5b3661ca885b051970c7f081fc
}
}
.sidemenu_list {
padding-top: 30px;
ul {
margin: 0px;
padding: 0px;
li {
list-style: none;
color: #fff;
font-weight: 200;
font-size: 15px;
padding: 10px;
font-size: 16px;
&:focus {
background-color: rgba(40, 36, 88, 1);
}
&:hover {
background-color: rgba(40, 36, 88, 1);
}
.version {
.sub_menu {
padding-left: 25px;
margin-bottom: 40px;
padding-top: 10px;
ul {
margin: 0px;
padding: 0px;
li {
list-style: none;
color: rgba(176, 174, 199, 1);
font-size: 14px;
}
}
.sub_menu {
padding-left: 25px;
margin-bottom: 40px;
padding-top: 10px;
ul {
margin: 0px;
padding: 0px;
li {
list-style: none;
color: rgba(176, 174, 199, 1);
}
}
}
}
......
import { Injectable } from "@angular/core";
import { User, Signup, Address } from "./services/user";
import { auth } from "firebase/app";
import { Router, ActivatedRoute } from "@angular/router";
import { AngularFireAuth } from "@angular/fire/auth";
import { Injectable } from '@angular/core';
import { User, Signup, Address } from './services/user';
import { auth } from 'firebase/app';
import { Router, ActivatedRoute } from '@angular/router';
import { AngularFireAuth } from '@angular/fire/auth';
import {
AngularFirestore,
AngularFirestoreDocument,
AngularFirestoreCollection
} from "@angular/fire/firestore";
import { ServiceService } from "./../config/service.service";
import { SubjectService } from "./../config/subject.service";
import { GooglePlus } from "@ionic-native/google-plus/ngx";
import { take } from "rxjs/operators";
import { from } from "rxjs";
} from '@angular/fire/firestore';
import { ServiceService } from './../config/service.service';
import { SubjectService } from './../config/subject.service';
import { GooglePlus } from '@ionic-native/google-plus/ngx';
import { take } from 'rxjs/operators';
import { from } from 'rxjs';
@Injectable({
providedIn: "root"
providedIn: 'root'
})
export class AuthService {
constructor(
......@@ -32,24 +32,24 @@ export class AuthService {
this.subjectService.sendLoginData(false);
this.userData = user;
console.log(this.userData);
this.service.set("user", JSON.stringify(this.userData));
this.service.set('user', JSON.stringify(this.userData));
this.SetUserData(user);
if (this.type === 1) {
this.router.navigateByUrl("home");
this.router.navigateByUrl('home');
} else {
this.router.navigateByUrl("verification");
this.router.navigateByUrl('verification');
}
} else {
this.subjectService.sendLoginData(true);
this.service.set("user", null);
JSON.parse(localStorage.getItem("user"));
this.router.navigateByUrl("login");
this.service.set('user', null);
JSON.parse(localStorage.getItem('user'));
this.router.navigateByUrl('login');
}
});
}
get isLoggedIn(): boolean {
const user = JSON.parse(localStorage.getItem("user"));
const user = JSON.parse(localStorage.getItem('user'));
return user !== null && user.emailVerified !== false ? true : false;
}
userData: any;
......@@ -62,7 +62,7 @@ export class AuthService {
return this.afAuth.auth
.signInWithEmailAndPassword(email, password)
.then(result => {
console.log("success");
console.log('success');
document.body.scrollTop = document.documentElement.scrollTop = 0;
this.SetUserData(result.user);
})
......@@ -76,8 +76,8 @@ export class AuthService {
// tslint:disable-next-line:radix
// const otpnew = parseInt(otp);
const custRef: AngularFirestoreCollection<any> = this.afs.collection(
"customers",
ref => ref.where("otp", "==", otp).where("uid", "==", this.userData.uid)
'customers',
ref => ref.where('otp', '==', otp).where('uid', '==', this.userData.uid)
);
custRef
.valueChanges()
......@@ -85,20 +85,20 @@ export class AuthService {
.subscribe((value: User[]) => {
if (value.length > 0) {
this.afs
.collection("customers")
.collection('customers')
.doc(this.userData.uid)
.update({ otp: "", phoneVerified: true });
this.service.set("type", 1);
this.router.navigateByUrl("nearby");
.update({ otp: '', phoneVerified: true });
this.service.set('type', 1);
this.router.navigateByUrl('nearby');
} else {
window.alert("Please input valid OTP");
window.alert('Please input valid OTP');
}
});
}
profilePic(pic) {
this.afs
.collection("customers")
.collection('customers')
.doc(this.userData.uid)
.update({ profilePhoto: pic });
}
......@@ -109,7 +109,7 @@ export class AuthService {
this.afAuth.auth
.signInWithPopup(new auth.GoogleAuthProvider())
.then(result => {
console.log("success");
console.log('success');
console.log(result.additionalUserInfo.isNewUser);
if (
result.additionalUserInfo &&
......@@ -125,7 +125,7 @@ export class AuthService {
this.afAuth.auth
.signInWithPopup(new auth.FacebookAuthProvider())
.then(result => {
console.log("success");
console.log('success');
console.log(result);
});
}
......@@ -149,12 +149,8 @@ export class AuthService {
loginType: value.loginType
};
this.loggedUser = userData;
<<<<<<< HEAD
this.service.set('userData', JSON.stringify(this.loggedUser));
this.subjectService.sendUserData(JSON.stringify(this.loggedUser));
=======
this.service.set("userData", JSON.stringify(this.loggedUser));
>>>>>>> a9bd8295df980b5b3661ca885b051970c7f081fc
console.log(this.loggedUser);
});
}
......@@ -162,8 +158,8 @@ export class AuthService {
public async SignOut() {
return this.afAuth.auth.signOut().then(() => {
this.subjectService.sendLoginData(true);
this.service.remove("user");
console.log("logout");
this.service.remove('user');
console.log('logout');
});
}
......@@ -171,9 +167,9 @@ export class AuthService {
this.type = 2;
console.log(userData.user);
const currencyData = {
currId: "123",
currName: "Australian dollar",
symbol: "A$"
currId: '123',
currName: 'Australian dollar',
symbol: 'A$'
};
const otp = Math.floor(1000 + Math.random() * 9000);
userData = userData.user;
......@@ -193,11 +189,11 @@ export class AuthService {
this.userPostData = postData;
console.log(postData);
this.afs
.collection("customers")
.collection('customers')
.doc(userData.uid)
.set(postData)
.then(() => {
console.log("successs");
console.log('successs');
});
}
......@@ -211,15 +207,15 @@ export class AuthService {
console.log(result.user);
this.afAuth.auth.currentUser.sendEmailVerification();
const currencyData = {
currId: "123",
currName: "Australian dollar",
symbol: "A$"
currId: '123',
currName: 'Australian dollar',
symbol: 'A$'
};
const custData = result.user;
const postData: User = {
uid: custData.uid,
status: true,
profilePhoto: "",
profilePhoto: '',
phoneVerified: false,
phone: userData.phone,
name: userData.name,
......@@ -232,11 +228,11 @@ export class AuthService {
this.userPostData = postData;
console.log(postData);
this.afs
.collection("customers")
.collection('customers')
.doc(custData.uid)
.set(postData)
.then(() => {
console.log("successs");
console.log('successs');
});
})
.catch(error => {
......@@ -249,7 +245,7 @@ export class AuthService {
console.log(this.userData.uid);
this.afs
.collection("address")
.collection('address')
.add({
uid: this.userData.uid
})
......@@ -273,13 +269,13 @@ export class AuthService {
const neworderId = docRef.id;
console.log(addrData);
this.afs
.collection("address")
.collection('address')
.doc(neworderId)
.set(addrData)
.then(() => {
console.log("Address add Successfully");
this.service.set("user", JSON.stringify(this.userData));
this.router.navigateByUrl("home");
console.log('Address add Successfully');
this.service.set('user', JSON.stringify(this.userData));
this.router.navigateByUrl('home');
document.body.scrollTop = document.documentElement.scrollTop = 0;
});
});
......
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