-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1dc7645
commit 7f90a51
Showing
8 changed files
with
194 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
|
||
import { IonicModule } from '@ionic/angular'; | ||
|
||
import { ContactsPage } from './contacts.page'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
FormsModule, | ||
IonicModule, | ||
RouterModule.forChild(routes) | ||
], | ||
declarations: [] | ||
}) | ||
export class Contacts2PageModule {} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,53 @@ | ||
<!-- <script src="https://hammerjs.github.io/dist/hammer.js"></script> --> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>userContact</ion-title> | ||
<ion-button fill="clear" (click)="goToHome()"> | ||
<ion-icon name="arrow-back" color="dark"></ion-icon> | ||
</ion-button> | ||
<ion-title class="ion-text-center">{{profile.name}}</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content> | ||
|
||
<ion-content fullscreen id="pContent" (swipe)="swipeEvent($event)"> | ||
<ion-card lines="none"> | ||
<ion-card-content lines="none"> | ||
<ion-grid> | ||
<ion-row> | ||
<ion-col> | ||
<ion-avatar> | ||
<ion-img src="{{profile.photo}}"></ion-img> | ||
</ion-avatar> | ||
</ion-col> | ||
<ion-col> | ||
<ion-list> | ||
<ion-item lines="none"> | ||
<ion-label class="ion-text-center" style="font-size: 175%;"> | ||
{{profile.name}} | ||
</ion-label> | ||
</ion-item> | ||
<ion-item lines="none"> | ||
<ion-button fill="clear" (click)="mail()"> | ||
<ion-icon name="mail" color="dark" size="large"></ion-icon> | ||
</ion-button> | ||
<ion-button fill="clear" (click)="call()"> | ||
<ion-icon name="call" color="dark" size="large"></ion-icon> | ||
</ion-button> | ||
<ion-button fill="clear" (click)="facebook()"> | ||
<ion-icon name="logo-facebook" color="dark" size="large"></ion-icon> | ||
</ion-button> | ||
</ion-item> | ||
</ion-list> | ||
</ion-col> | ||
</ion-row> | ||
</ion-grid> | ||
</ion-card-content> | ||
</ion-card> | ||
<ion-grid> | ||
<ion-row *ngFor="let line of grid" class="ion-align-items-center ion-justify-content-center"> | ||
<ion-col *ngFor="let item of line" class="ion-align-items-center ion-justify-content-center"> | ||
<ion-avatar (click)="openPopover($event, item.name)"> | ||
<ion-img src="{{item.logo}}"></ion-img> | ||
</ion-avatar> | ||
</ion-col> | ||
</ion-row> | ||
</ion-grid> | ||
</ion-content> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
ion-grid { | ||
ion-avatar { | ||
ion-img { | ||
width: 70%; | ||
height: 70%; | ||
} | ||
} | ||
} | ||
ion-card { | ||
ion-grid { | ||
ion-avatar { | ||
ion-img { | ||
width: 100%; | ||
height: 100%; | ||
overflow: hidden; | ||
position: absolute; | ||
} | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,103 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { FirebaseBackendService } from '../firebase-backend.service'; | ||
import * as firebase from 'firebase'; | ||
import { Router, ActivatedRoute } from '@angular/router'; | ||
import * as backend from '../backendClasses'; | ||
import { PopoverController } from '@ionic/angular'; | ||
import { ContactsPage } from '../contacts/contacts.page'; | ||
|
||
@Component({ | ||
selector: 'app-user-contact', | ||
templateUrl: './user-contact.page.html', | ||
styleUrls: ['./user-contact.page.scss'], | ||
}) | ||
export class UserContactPage implements OnInit { | ||
private profile: backend.contact; | ||
private firebase: FirebaseBackendService; | ||
private grid: {name: string, logo: string} [][] = []; | ||
|
||
constructor() { } | ||
constructor(private router: Router, private route: ActivatedRoute, private popOver: PopoverController) { | ||
firebase.auth().onAuthStateChanged(firebaseUser => { | ||
if(!firebaseUser){ | ||
this.router.navigate(['login']); | ||
}else{ | ||
this.firebase = new FirebaseBackendService(firebase.auth().currentUser.uid); | ||
this.route.params.subscribe(dat => { | ||
this.profile = dat['contact']; | ||
this.initGrid(); | ||
}); | ||
} | ||
}); | ||
} | ||
|
||
goToContacts() { | ||
this.router.navigate(['contacts']); | ||
} | ||
|
||
goToHome() { | ||
this.router.navigate(['home']); | ||
} | ||
|
||
ngOnInit() { | ||
} | ||
|
||
async openPopover(ev: any, typ: string) { | ||
const pop = await this.popOver.create({ | ||
component: ContactsPage, | ||
componentProps: {'type': typ}, | ||
translucent: true, | ||
backdropDismiss: true, | ||
cssClass: 'popover', | ||
event: ev | ||
}); | ||
return await pop.present(); | ||
} | ||
initGrid() { | ||
let names: string[] = this.getNames(); | ||
let logos: string[] = this.getLogos(); | ||
if(names.length == logos.length) { | ||
for(let i: number=0; i<Math.ceil(names.length/4); i++) { | ||
this.grid[i] = []; | ||
for(let j: number=0; j<4 && (i*4+j)<names.length; j++) { | ||
this.grid[i][j] = {name: names[i*4+j],logo: logos[i*4+j]}; | ||
} | ||
} | ||
} | ||
} | ||
getNames(): string[] { | ||
return ['instagram', | ||
'facebook', | ||
'snapchat', | ||
'tiktok', | ||
'github', | ||
'twitter', | ||
'linkedin', | ||
'whatsapp', | ||
'tinder', | ||
'steam', | ||
'gmail', | ||
'outlook', | ||
'venmo', | ||
'paypal', | ||
'discord', | ||
'katalk']; | ||
} | ||
getLogos(): string[] { | ||
return ['../assets/instagram-2-1.svg', | ||
'../assets/facebook-icon.svg', | ||
'../assets/snapchat.svg', | ||
'../assets/tiktok-logo.svg', | ||
'../assets/github.svg', | ||
'../assets/twitter.svg', | ||
'../assets/linkedin-icon-2.svg', | ||
'../assets/whatsapp-symbol.svg', | ||
'../assets/tinder-icon.svg', | ||
'../assets/steam-icon-logo.svg', | ||
'../assets/gmail-icon.svg', | ||
'../assets/outlook-1.svg', | ||
'../assets/venmo.svg', | ||
'../assets/paypal-icon.svg', | ||
'../assets/discord.svg', | ||
'../assets/kakaotalk.svg']; | ||
} | ||
} |