Skip to content

Commit

Permalink
show captures without dates
Browse files Browse the repository at this point in the history
  • Loading branch information
sultanmyrza committed Sep 5, 2022
1 parent 33ed41b commit 2bca65b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 34 deletions.
48 changes: 17 additions & 31 deletions src/app/features/home/capture-tab/capture-tab.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,28 @@

<div *ngSwitchCase="'captured'">
<div class="capture-container" *transloco="let t">
<ng-container
*ngFor="
let group of capturesByDate$
| ngrxPush
| keyvalue: keyDescendingOrder;
first as isFirstGroup;
trackBy: trackCaptureGroupByDate
"
>
<div class="mat-title">{{ group.key | date: 'longDate' }}</div>
<mat-grid-list cols="2" gutterSize="8px">
<mat-grid-tile
*ngFor="
let proof of group.value;
first as isFirstProof;
trackBy: trackCaptureItem
"
class="capture-item"
[joyrideStep]="
isFirstGroup && isFirstProof
? 'highlightFirstCapture'
: 'notFirst'
"
[title]="t('userGuide.capturedItem')"
[text]="t('userGuide.openToSeeDetailsAndMoreActionItems')"
>
<app-capture-item [proof]="proof"></app-capture-item>
</mat-grid-tile>
</mat-grid-list>
</ng-container>
<mat-grid-list cols="2" gutterSize="16px">
<mat-grid-tile
*ngFor="
let proof of captures$ | ngrxPush;
first as isFirstProof;
trackBy: trackCaptureItem
"
class="capture-item"
[joyrideStep]="isFirstProof ? 'highlightFirstCapture' : 'notFirst'"
[title]="t('userGuide.capturedItem')"
[text]="t('userGuide.openToSeeDetailsAndMoreActionItems')"
>
<app-capture-item [proof]="proof"></app-capture-item>
</mat-grid-tile>
</mat-grid-list>
</div>
</div>

<div class="post-captures" *ngSwitchCase="'collected'">
<mat-grid-list cols="2" gutterSize="8px">
<mat-grid-list cols="2" gutterSize="16px">
<mat-grid-tile
class="capture-item"
*ngFor="
let postCapture of postCaptures$ | ngrxPush;
trackBy: trackPostCapture
Expand Down
5 changes: 2 additions & 3 deletions src/app/features/home/capture-tab/capture-tab.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ app-avatar {
}

.capture-container {
padding-left: 16px;
padding-right: 16px;
padding: 16px;
}

app-capture-item {
Expand All @@ -84,7 +83,7 @@ app-capture-item {
object-fit: cover;
object-position: center;
overflow: hidden;
border-radius: 4px;
border-radius: 16px;
}

ion-icon {
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/home/capture-tab/capture-tab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export class CaptureTabComponent {
)
);

readonly captures$ = this.proofs$.pipe(
map(proofs => proofs.sort((a, b) => b.timestamp - a.timestamp))
);

readonly networkConnected$ = this.networkService.connected$;

readonly postCaptures$ = this.networkConnected$.pipe(
Expand Down

0 comments on commit 2bca65b

Please sign in to comment.