Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature profile tab grid rebrand #2022

Merged
merged 3 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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="3" 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="3" 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
7 changes: 3 additions & 4 deletions src/app/features/home/capture-tab/capture-tab.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,14 @@ app-avatar {
}

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

app-capture-item {
width: 100%;
height: 100%;
overflow: hidden;
border-radius: 4px;
border-radius: 16px;
}

.post-captures {
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