Commit f1e0cd78 by muhsin

conflict1

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