소스 검색

Override facebook login if opening on desktop, share news bug fixes, share button in details page made opaque

master
kj1352 4 년 전
부모
커밋
cb896b5921
6개의 변경된 파일51개의 추가작업 그리고 26개의 파일을 삭제
  1. +23
    -18
      src/app/components/facebook-login/facebook-login.component.html
  2. +18
    -0
      src/app/components/facebook-login/facebook-login.component.scss
  3. +5
    -1
      src/app/components/facebook-login/facebook-login.component.ts
  4. +2
    -4
      src/app/home-details/home-details.page.scss
  5. +1
    -1
      src/app/home-details/home-details.page.ts
  6. +2
    -2
      src/app/match-details/match-details.page.ts

+ 23
- 18
src/app/components/facebook-login/facebook-login.component.html 파일 보기

@@ -1,20 +1,25 @@
<section class="social-login" [ngClass]="{'active' : !user }">
<section class="login-box">
<button (click)="login()"> Login with <ion-icon name="logo-facebook"></ion-icon> </button>
<ng-container *ngIf="!hideAll">
<section class="social-login" [ngClass]="{'active' : !user }">
<section class="login-box">
<button (click)="login()"> Login with <ion-icon name="logo-facebook"></ion-icon> </button>
</section>
</section> </section>
</section>


<section class="social-login" [ngClass]="{'active' : showLogout && user }">
<section class="login-box">
<button (click)="logout()">
Logout from "{{ user.name }}"?
<ion-icon name="logo-facebook"></ion-icon>
</button>
<section class="social-login" [ngClass]="{'active' : showLogout && user }">
<section class="login-box">
<button (click)="logout()">
Logout from "{{ user.name }}"?
<ion-icon name="logo-facebook"></ion-icon>
</button>
<button (click)="showLogout = false">
<ion-icon name="close-circle-outline"></ion-icon>
</button>
</section>
</section> </section>
</section>

<section class="profile" *ngIf="user" (click)="showLogout = true">
<img [src]="user.picture.data.url" alt="profile-image">
<p> {{ user.name }} </p>
</section>
<section class="profile" *ngIf="user" (click)="showLogout = true">
<img [src]="user.picture.data.url" alt="profile-image">
<p> {{ user.name }} </p>
</section>
</ng-container>

+ 18
- 0
src/app/components/facebook-login/facebook-login.component.scss 파일 보기

@@ -27,6 +27,9 @@
border-top-right-radius: 40px; border-top-right-radius: 40px;
background-color: darken($brand-blue, 10%); background-color: darken($brand-blue, 10%);
padding: 20px; padding: 20px;
display: flex;
align-items: center;
justify-content: space-around;


button { button {
display: flex; display: flex;
@@ -39,6 +42,7 @@
background-color: lighten($light-grey, 45%); background-color: lighten($light-grey, 45%);
width: 100%; width: 100%;
border-radius: 30px; border-radius: 30px;
flex-grow: 1;


ion-icon { ion-icon {
color: darken($brand-blue, 10%); color: darken($brand-blue, 10%);
@@ -46,6 +50,20 @@
width: 30px; width: 30px;
height: 30px; height: 30px;
} }

&:nth-child(2) {
margin-left: 20px;
background-color: transparent;
width: 60px;
height: 60px;

ion-icon {
color: white;
margin: 0;
width: 60px;
height: 60px;
}
}
} }
} }
} }


+ 5
- 1
src/app/components/facebook-login/facebook-login.component.ts 파일 보기

@@ -19,6 +19,8 @@ export class FacebookLoginComponent implements OnInit {
user = null; user = null;
token = null; token = null;


hideAll: boolean = false;

showLogout: boolean = false; showLogout: boolean = false;


constructor( constructor(
@@ -32,7 +34,7 @@ export class FacebookLoginComponent implements OnInit {
this.token = localStorage.getItem('FBToken'); this.token = localStorage.getItem('FBToken');
} else { } else {
this.setupFbLogin(); this.setupFbLogin();
}
}
} }


async setupFbLogin() { async setupFbLogin() {
@@ -40,6 +42,8 @@ export class FacebookLoginComponent implements OnInit {
// Use the native implementation inside a real app! // Use the native implementation inside a real app!
const { FacebookLogin } = Plugins; const { FacebookLogin } = Plugins;
this.fbLogin = FacebookLogin; this.fbLogin = FacebookLogin;
} else {
this.hideAll = true;
} }
} }




+ 2
- 4
src/app/home-details/home-details.page.scss 파일 보기

@@ -183,9 +183,7 @@
.share-button { .share-button {
--background: transparent; --background: transparent;
border-radius: 50%; border-radius: 50%;
background-color: rgba($green, 0.1);
--color: none;
color: $green;
border: 1px solid $green;
background-color: $green;
--color: white;
transform: translate(10px, -10px); transform: translate(10px, -10px);
} }

+ 1
- 1
src/app/home-details/home-details.page.ts 파일 보기

@@ -36,7 +36,7 @@ export class HomeDetailsPage implements OnInit {
} }


share() { share() {
this.socialSharing.share(this.newsDetails.title, '', IMAGE_BASE_URL + this.newsDetails.image_path + this.newsDetails.image_file_name, this.newsDetails.hls_url ? this.newsDetails.hls_url : '');
this.socialSharing.share(this.newsDetails.title, '', this.newsDetails.images ? IMAGE_BASE_URL + this.newsDetails.images[0].data.imagePath + this.newsDetails.images[0].data.imageName : IMAGE_BASE_URL + this.newsDetails.image_path + this.newsDetails.image_file_name, this.newsDetails.hls_url ? this.newsDetails.hls_url : '');
} }


ngOnInit() { ngOnInit() {


+ 2
- 2
src/app/match-details/match-details.page.ts 파일 보기

@@ -75,11 +75,11 @@ export class MatchDetailsPage implements OnInit {


shareMatchDetails() { shareMatchDetails() {
console.log("Sharing match details..."); console.log("Sharing match details...");
let message: string;
let message: string = '';


if (this.currentMatch.Innings) { if (this.currentMatch.Innings) {
this.currentMatch.Innings.forEach(inning => { this.currentMatch.Innings.forEach(inning => {
message = this.currentMatch.Teams[inning.Battingteam].Name_Short + ' ' + inning.Total + '/' + inning.Wickets + '(' + inning.Overs + ')' + '\n';
message += this.currentMatch.Teams[inning.Battingteam].Name_Short + ' ' + inning.Total + '/' + inning.Wickets + '(' + inning.Overs + ')' + '\n';
}); });
} else { } else {
message = 'Match to start on, ' + this.currentMatch.Matchdetail.Match.Date + ' @' + this.currentMatch.Matchdetail.Match.Time + '\n' + this.currentMatch.Teams[this.currentMatch.Matchdetail.Team_Home].Name_Short + ' v/s ' + this.currentMatch.Teams[this.currentMatch.Matchdetail.Team_Away].Name_Short; message = 'Match to start on, ' + this.currentMatch.Matchdetail.Match.Date + ' @' + this.currentMatch.Matchdetail.Match.Time + '\n' + this.currentMatch.Teams[this.currentMatch.Matchdetail.Team_Home].Name_Short + ' v/s ' + this.currentMatch.Teams[this.currentMatch.Matchdetail.Team_Away].Name_Short;


불러오는 중...
취소
저장