Skip to content

Commit

Permalink
Merge branch 'development' into mgclWrhrs
Browse files Browse the repository at this point in the history
  • Loading branch information
maheedhar1998 committed Mar 2, 2020
2 parents c8f9edc + 8e8db32 commit 47e5afa
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
13 changes: 10 additions & 3 deletions src/app/contacts/contacts.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
<ion-icon color="dark" name="add-circle-outline"></ion-icon>
</ion-button>
<ion-list *ngIf="!none">
<ion-item *ngFor="let account of socialAccounts" href="{{account.url}}">
<ion-label>{{account.user}}</ion-label>
</ion-item>
<ion-item-sliding *ngFor="let account of socialAccounts">
<ion-item>
<ion-label>{{account.user}}</ion-label>
</ion-item>
<ion-item-options side="end">
<ion-item-option color="danger" (click)="deleteAccount(account)">
<ion-icon color="dark" name="trash"></ion-icon>
</ion-item-option>
</ion-item-options>
</ion-item-sliding>
</ion-list>
</ion-card>
<ion-card *ngIf="adding">
Expand Down
4 changes: 4 additions & 0 deletions src/app/contacts/contacts.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export class ContactsPage implements OnInit {
this.adding = true;
}

deleteAccount(account: backend.socialAccount) {
this.firebase.deleteSocialAccount(this.type, account);
}

addSMAccount() {
this.firebase.addSocialAccount(this.type, new backend.socialAccount(this.id,this.username,this.url));
this.adding = false;
Expand Down
13 changes: 10 additions & 3 deletions src/app/home/home.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,16 @@
</ion-avatar>
</ion-col>
<ion-col id ="user-info">
<ion-item lines="none">
<ion-title>{{contact.name}}</ion-title>
</ion-item>
<ion-item-sliding>
<ion-item lines="none">
<ion-title>{{contact.name}}</ion-title>
</ion-item>
<ion-item-options side="end">
<ion-item-option color="danger" (click)="deleteContact(contact)">
<ion-icon color="dark" name="trash"></ion-icon>
</ion-item-option>
</ion-item-options>
</ion-item-sliding>
</ion-col>
</ion-row>
</ion-grid>
Expand Down
4 changes: 4 additions & 0 deletions src/app/home/home.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export class HomePage {
});
}

deleteContact(cont: backend.contact) {
this.firebase.deleteFromUserContacts(cont);
}

goToUserContact( cont: backend.contact ) {
this.router.navigate(['user-contact', {contact: JSON.stringify(cont)}]);
}
Expand Down

0 comments on commit 47e5afa

Please sign in to comment.