-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix: fixed the zero state expense #3359
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,14 @@ | |
</ng-container> | ||
</app-fy-header> | ||
|
||
<ion-content [ngClass]="{'d-none': isCameraPreviewStarted}" class="my-expenses--content" (click)="onPageClick()"> | ||
<ion-content | ||
[ngClass]="{ | ||
'd-none': isCameraPreviewStarted, | ||
'my-expenses--content-zero-state': ((pendingTransactions.length === 0) && ((count$ | async) === 0) && isConnected$ | async) | ||
}" | ||
class="my-expenses--content" | ||
(click)="onPageClick()" | ||
> | ||
Comment on lines
+94
to
+101
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Listen here, partner! Let's make this template as powerful as a punch dialogue! 🌟 The template condition is getting more complex than my signature sunglasses collection! We should handle this logic in the component. Here's a style that would make even the bad guys jealous: -[ngClass]="{
- 'd-none': isCameraPreviewStarted,
- 'my-expenses--content-zero-state': ((pendingTransactions.length === 0) && ((count$ | async) === 0) && isConnected$ | async)
-}"
+[ngClass]="{
+ 'd-none': isCameraPreviewStarted,
+ 'my-expenses--content-zero-state': shouldShowZeroState$ | async
+}" And in your component: shouldShowZeroState$ = combineLatest([
this.count$,
this.isConnected$
]).pipe(
map(([count, isConnected]) =>
this.pendingTransactions.length === 0 && count === 0 && isConnected
)
); |
||
<div | ||
class="my-expenses--body" | ||
[ngClass]="{'my-expenses--zero-states-body': (((count$ | async) === 0) && isConnected$|async) || (pendingTransactions.length === 0 && !(isConnected$|async))}" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please share before and after screenshots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added