-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Display different status badge to distinguish different "In Progress" activity. #199 Co-authored-by: Sean Wu <[email protected]>
- Loading branch information
1 parent
040e9a5
commit 088a52a
Showing
12 changed files
with
246 additions
and
15 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
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
16 changes: 16 additions & 0 deletions
16
src/app/pages/home/activity/transaction-details/transaction-details-routing.module.ts
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,16 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
import { TransactionDetailsPage } from './transaction-details.page'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
component: TransactionDetailsPage, | ||
}, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class TransactionDetailsPageRoutingModule {} |
10 changes: 10 additions & 0 deletions
10
src/app/pages/home/activity/transaction-details/transaction-details.module.ts
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,10 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { SharedModule } from '../../../../shared/shared.module'; | ||
import { TransactionDetailsPageRoutingModule } from './transaction-details-routing.module'; | ||
import { TransactionDetailsPage } from './transaction-details.page'; | ||
|
||
@NgModule({ | ||
imports: [SharedModule, TransactionDetailsPageRoutingModule], | ||
declarations: [TransactionDetailsPage], | ||
}) | ||
export class TransactionDetailsPageModule {} |
31 changes: 31 additions & 0 deletions
31
src/app/pages/home/activity/transaction-details/transaction-details.page.html
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,31 @@ | ||
<mat-toolbar color="primary" *transloco="let t"> | ||
<button routerLink=".." routerDirection="back" mat-icon-button> | ||
<mat-icon>arrow_back</mat-icon> | ||
</button> | ||
<span>{{ t('transactionDetails') }}</span> | ||
</mat-toolbar> | ||
<div *transloco="let t" class="page-content"> | ||
<h4 class="top-time">{{ (details$ | async)?.created_at | date: 'short' }}</h4> | ||
<mat-card class="transaction-card"> | ||
<mat-card-content class="row"> | ||
<mat-label> {{ (details$ | async)?.asset.id }}</mat-label> | ||
<button | ||
[class]="(details$ | async)?.status" | ||
mat-stroked-button | ||
disableRipple | ||
> | ||
{{ t((details$ | async)?.status) }} | ||
</button> | ||
</mat-card-content> | ||
<img [src]="(details$ | async)?.asset.asset_file_thumbnail" /> | ||
<mat-card-content class="column"> | ||
<mat-label | ||
>{{ t('sentFrom') }} : {{ (details$ | async)?.sender }}</mat-label | ||
> | ||
<mat-label | ||
>{{ t('receiver') }} : | ||
{{ (details$ | async)?.receiver_email }}</mat-label | ||
> | ||
</mat-card-content> | ||
</mat-card> | ||
</div> |
115 changes: 115 additions & 0 deletions
115
src/app/pages/home/activity/transaction-details/transaction-details.page.scss
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,115 @@ | ||
mat-toolbar { | ||
color: white; | ||
|
||
.mat-icon { | ||
color: white; | ||
} | ||
|
||
span { | ||
color: white; | ||
padding-right: 40px; | ||
} | ||
} | ||
|
||
.page-content { | ||
padding: 0 0 16px; | ||
|
||
.top-time { | ||
width: 90vw; | ||
margin-top: 16px; | ||
margin-left: 5vw; | ||
margin-right: 5vw; | ||
text-align: center; | ||
} | ||
|
||
button.send-button { | ||
width: 90vw; | ||
margin-top: 16px; | ||
margin-left: 5vw; | ||
margin-right: 5vw; | ||
|
||
.send-button-wrapper { | ||
display: flex; | ||
align-items: center; | ||
|
||
.avatar { | ||
height: 32px; | ||
width: 32px; | ||
margin: 8px; | ||
border-radius: 50%; | ||
flex-shrink: 0; | ||
object-fit: cover; | ||
background-image: url('https://gravatar.com/avatar/8db683da3c728970bb776f6cc4048fd2?s=400&d=mp&r=x'); | ||
background-size: cover; | ||
} | ||
} | ||
} | ||
|
||
button { | ||
flex-shrink: 0; | ||
} | ||
|
||
button.accepted { | ||
color: white; | ||
border-color: #4cd964; | ||
background-color: #4cd964; | ||
} | ||
|
||
button.delivered { | ||
color: mediumseagreen; | ||
border-color: mediumseagreen; | ||
} | ||
|
||
button.inProgress { | ||
color: deepskyblue; | ||
border-color: deepskyblue; | ||
} | ||
|
||
button.waitingToBeAccepted { | ||
color: white; | ||
border-color: deepskyblue; | ||
background-color: deepskyblue; | ||
} | ||
|
||
button.returned { | ||
color: white; | ||
border-color: var(--ion-color-danger); | ||
background-color: #e31587; | ||
} | ||
} | ||
|
||
.column { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.row { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
} | ||
|
||
.transaction-card { | ||
width: 90vw; | ||
margin-top: 16px; | ||
margin-left: 5vw; | ||
margin-right: 5vw; | ||
} | ||
|
||
mat-card img { | ||
width: 50%; | ||
margin: 10% 25%; | ||
} | ||
|
||
form mat-form-field { | ||
width: 100%; | ||
height: 100%; | ||
|
||
textarea { | ||
overflow: hidden; | ||
} | ||
} | ||
|
||
.spacer { | ||
flex: 1 1 auto; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/app/pages/home/activity/transaction-details/transaction-details.page.spec.ts
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,23 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { SharedTestingModule } from '../../../../shared/shared-testing.module'; | ||
import { TransactionDetailsPage } from './transaction-details.page'; | ||
|
||
describe('TransactionDetailsPage', () => { | ||
let component: TransactionDetailsPage; | ||
let fixture: ComponentFixture<TransactionDetailsPage>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [TransactionDetailsPage], | ||
imports: [SharedTestingModule], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(TransactionDetailsPage); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
})); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
src/app/pages/home/activity/transaction-details/transaction-details.page.ts
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,15 @@ | ||
import { Component } from '@angular/core'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { UntilDestroy } from '@ngneat/until-destroy'; | ||
import { map } from 'rxjs/operators'; | ||
@UntilDestroy({ checkProperties: true }) | ||
@Component({ | ||
selector: 'app-transaction-details', | ||
templateUrl: './transaction-details.page.html', | ||
styleUrls: ['./transaction-details.page.scss'], | ||
}) | ||
export class TransactionDetailsPage { | ||
details$ = this.route.paramMap.pipe(map(() => history.state)); | ||
|
||
constructor(private readonly route: ActivatedRoute) {} | ||
} |
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