@@ -5,26 +5,28 @@ import { SplashScreen } from '@ionic-native/splash-screen/ngx'; | |||||
import { StatusBar } from '@ionic-native/status-bar/ngx'; | import { StatusBar } from '@ionic-native/status-bar/ngx'; | ||||
@Component({ | @Component({ | ||||
selector: 'app-root', | |||||
templateUrl: 'app.component.html', | |||||
styleUrls: ['app.component.scss'] | |||||
selector: 'app-root', | |||||
templateUrl: 'app.component.html', | |||||
styleUrls: ['app.component.scss'] | |||||
}) | }) | ||||
export class AppComponent { | export class AppComponent { | ||||
constructor( | |||||
private platform: Platform, | |||||
private splashScreen: SplashScreen, | |||||
private statusBar: StatusBar | |||||
) { | |||||
this.initializeApp(); | |||||
} | |||||
showAddParty: boolean = false; | |||||
initializeApp() { | |||||
this.platform.ready().then(() => { | |||||
this.statusBar.styleDefault(); | |||||
this.splashScreen.hide(); | |||||
constructor( | |||||
private platform: Platform, | |||||
private splashScreen: SplashScreen, | |||||
private statusBar: StatusBar | |||||
) { | |||||
this.initializeApp(); | |||||
} | |||||
localStorage.isPartyChatOn = 'no'; | |||||
initializeApp() { | |||||
this.platform.ready().then(() => { | |||||
this.statusBar.styleDefault(); | |||||
this.splashScreen.hide(); | |||||
}); | |||||
} | |||||
localStorage.isPartyChatOn = 'no'; | |||||
}); | |||||
} | |||||
} | } |
@@ -45,4 +45,12 @@ | |||||
</ion-slides> | </ion-slides> | ||||
</div> | </div> | ||||
<ion-fab vertical="bottom" horizontal="end" slot="fixed" *ngIf="showChat"> | |||||
<ion-fab-button class="chat-button" (click)="presentChatModal()"> | |||||
<ion-icon name="chatbubble-ellipses-outline"></ion-icon> | |||||
<ion-badge color="dark"> 10 </ion-badge> | |||||
</ion-fab-button> | |||||
</ion-fab> | |||||
</ion-content> | </ion-content> |
@@ -1,8 +1,9 @@ | |||||
import { Component, OnInit, ViewChild } from '@angular/core'; | import { Component, OnInit, ViewChild } from '@angular/core'; | ||||
import { IonSlides } from '@ionic/angular'; | |||||
import { IonSlides, ModalController } from '@ionic/angular'; | |||||
import * as faker from 'faker'; | import * as faker from 'faker'; | ||||
import * as moment from 'moment'; | import * as moment from 'moment'; | ||||
import { Router } from '@angular/router'; | import { Router } from '@angular/router'; | ||||
import { ChatPage } from '../chat/chat.page'; | |||||
@Component({ | @Component({ | ||||
selector: 'app-booking', | selector: 'app-booking', | ||||
@@ -44,8 +45,8 @@ export class BookingPage implements OnInit { | |||||
spaceBetween: 15, | spaceBetween: 15, | ||||
initialSlide: 0, | initialSlide: 0, | ||||
centeredSlides: true, | centeredSlides: true, | ||||
simulateTouch: false, | |||||
followFinger: false, | |||||
// simulateTouch: false, | |||||
// followFinger: false, | |||||
}; | }; | ||||
bookingSeatsData: Array<{ | bookingSeatsData: Array<{ | ||||
@@ -74,9 +75,11 @@ export class BookingPage implements OnInit { | |||||
}> | }> | ||||
}> | }> | ||||
}> = []; | }> = []; | ||||
showChat: boolean; | |||||
constructor( | constructor( | ||||
private router: Router | |||||
private router: Router, | |||||
private modalController: ModalController | |||||
) { } | ) { } | ||||
getFormattedDateTime(dateTime: Date) { | getFormattedDateTime(dateTime: Date) { | ||||
@@ -147,4 +150,17 @@ export class BookingPage implements OnInit { | |||||
this.router.navigate(['/booking-details' , { matchData: JSON.stringify(matchData) }]); | this.router.navigate(['/booking-details' , { matchData: JSON.stringify(matchData) }]); | ||||
} | } | ||||
async presentChatModal() { | |||||
const modal = await this.modalController.create({ | |||||
component: ChatPage, | |||||
}); | |||||
return await modal.present(); | |||||
} | |||||
ionViewDidEnter() { | |||||
if (localStorage.isPartyChatOn === 'yes') { | |||||
this.showChat = true; | |||||
} | |||||
} | |||||
} | } |
@@ -55,7 +55,7 @@ export class ChatPage implements OnInit { | |||||
async copyLink() { | async copyLink() { | ||||
const toast = await this.toastController.create({ | const toast = await this.toastController.create({ | ||||
message: 'Copied invitation link!', | message: 'Copied invitation link!', | ||||
color: 'medium', | |||||
color: 'success', | |||||
mode: 'md', | mode: 'md', | ||||
duration: 100000, | duration: 100000, | ||||
position: 'top', | position: 'top', | ||||
@@ -46,11 +46,12 @@ ion-slides { | |||||
position: absolute; | position: absolute; | ||||
left: 25vw; | left: 25vw; | ||||
width: 50vw; | width: 50vw; | ||||
background-color: rgba(white, 0.1); | |||||
background-color: rgba(white, 0.3); | |||||
border-radius: 7px; | border-radius: 7px; | ||||
overflow: hidden; | overflow: hidden; | ||||
padding: 15px; | padding: 15px; | ||||
top: 58vh; | |||||
top: 60vh; | |||||
box-shadow: 0px 0px 5px inset dimgray; | |||||
h5 { | h5 { | ||||
margin: 0; | margin: 0; | ||||
@@ -105,4 +105,11 @@ | |||||
</ion-slides> | </ion-slides> | ||||
</div> | </div> | ||||
<ion-fab vertical="bottom" horizontal="end" slot="fixed" *ngIf="showChat"> | |||||
<ion-fab-button class="chat-button" (click)="presentChatModal()"> | |||||
<ion-icon name="chatbubble-ellipses-outline"></ion-icon> | |||||
<ion-badge color="dark"> 10 </ion-badge> | |||||
</ion-fab-button> | |||||
</ion-fab> | |||||
</ion-content> | </ion-content> |
@@ -1,6 +1,7 @@ | |||||
import { Component, OnInit, ViewChild } from '@angular/core'; | import { Component, OnInit, ViewChild } from '@angular/core'; | ||||
import { IonSlides } from '@ionic/angular'; | |||||
import { IonSlides, ModalController } from '@ionic/angular'; | |||||
import { Router } from '@angular/router'; | import { Router } from '@angular/router'; | ||||
import { ChatPage } from '../chat/chat.page'; | |||||
export type INews = { | export type INews = { | ||||
id: string | number, | id: string | number, | ||||
@@ -42,9 +43,11 @@ export class HomePage implements OnInit { | |||||
newsData: Array<INews> = []; | newsData: Array<INews> = []; | ||||
popularData: Array<INews> = []; | popularData: Array<INews> = []; | ||||
showChat: boolean = false; | |||||
constructor( | constructor( | ||||
private router: Router | |||||
private router: Router, | |||||
private modalController: ModalController | |||||
) { } | ) { } | ||||
ngOnInit() { | ngOnInit() { | ||||
@@ -116,6 +119,19 @@ export class HomePage implements OnInit { | |||||
}]; | }]; | ||||
} | } | ||||
ionViewDidEnter() { | |||||
if (localStorage.isPartyChatOn === 'yes') { | |||||
this.showChat = true; | |||||
} | |||||
} | |||||
async presentChatModal() { | |||||
const modal = await this.modalController.create({ | |||||
component: ChatPage, | |||||
}); | |||||
return await modal.present(); | |||||
} | |||||
getIndex(e: any) { | getIndex(e: any) { | ||||
console.log(this.slides); | console.log(this.slides); | ||||
} | } | ||||
@@ -134,6 +134,7 @@ | |||||
<ion-fab vertical="bottom" horizontal="end" slot="fixed" *ngIf="!showAddParty"> | <ion-fab vertical="bottom" horizontal="end" slot="fixed" *ngIf="!showAddParty"> | ||||
<ion-fab-button class="chat-button" (click)="presentChatModal()"> | <ion-fab-button class="chat-button" (click)="presentChatModal()"> | ||||
<ion-icon name="chatbubble-ellipses-outline"></ion-icon> | <ion-icon name="chatbubble-ellipses-outline"></ion-icon> | ||||
<ion-badge color="dark"> 10 </ion-badge> | |||||
</ion-fab-button> | </ion-fab-button> | ||||
</ion-fab> | </ion-fab> | ||||
@@ -237,11 +237,6 @@ ion-content { | |||||
} | } | ||||
} | } | ||||
.chat-button { | |||||
--background: #d73e53; | |||||
} | |||||
ion-slides { | ion-slides { | ||||
padding: 30px 0 20px 0; | padding: 30px 0 20px 0; | ||||
position: relative; | position: relative; | ||||
@@ -49,8 +49,8 @@ export class LivePage implements OnInit { | |||||
spaceBetween: 15, | spaceBetween: 15, | ||||
initialSlide: 0, | initialSlide: 0, | ||||
centeredSlides: true, | centeredSlides: true, | ||||
simulateTouch: false, | |||||
followFinger: false, | |||||
// simulateTouch: false, | |||||
// followFinger: false, | |||||
}; | }; | ||||
matchStats: { | matchStats: { | ||||
@@ -275,12 +275,12 @@ export class LivePage implements OnInit { | |||||
totalWickets: 1, | totalWickets: 1, | ||||
} | } | ||||
} | } | ||||
} | |||||
if (localStorage.isPartyChatOn = 'no') { | |||||
ionViewDidEnter() { | |||||
if (localStorage.isPartyChatOn === 'no') { | |||||
this.showAddParty = true; | this.showAddParty = true; | ||||
} | } | ||||
} | } | ||||
async presentChatModal() { | async presentChatModal() { | ||||
@@ -298,6 +298,7 @@ export class LivePage implements OnInit { | |||||
modal.onDidDismiss().then((data) => { | modal.onDidDismiss().then((data) => { | ||||
if(data.data.createParty) { | if(data.data.createParty) { | ||||
this.showAddParty = false; | this.showAddParty = false; | ||||
localStorage.isPartyChatOn = 'yes'; | |||||
} | } | ||||
}); | }); | ||||
@@ -52,4 +52,23 @@ figure { | |||||
transform: translateY(0vh); | transform: translateY(0vh); | ||||
} | } | ||||
} | } | ||||
} | |||||
.chat-button { | |||||
--background: #d73e53; | |||||
position: relative; | |||||
overflow: visible; | |||||
width: 60px; | |||||
height: 60px; | |||||
ion-icon { | |||||
font-size: 25px; | |||||
} | |||||
ion-badge { | |||||
position: absolute; | |||||
right: 10px; | |||||
top: 10px; | |||||
font-size: 10px; | |||||
} | |||||
} | } |