-
Notifications
You must be signed in to change notification settings - Fork 136
[POS Orders] Empty and Error states #14695
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
Changes from 12 commits
53f267d
5698bc9
a1fc60b
c88d5cd
51b2c06
e3281f7
f4b1c8b
0207015
70e150e
3c3b5f4
2aec62a
483857a
189e0a4
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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package com.woocommerce.android.ui.woopos.common.composeui.component | ||
|
|
||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.unit.dp | ||
|
|
||
| val WooPosButtonModifier = Modifier | ||
| .fillMaxWidth(0.3f) | ||
| .height(80.dp) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,6 +97,15 @@ class WooPosOrdersViewModel @Inject constructor( | |
| loadMoreIfPossible() | ||
| } | ||
|
|
||
| fun onOrdersEmptyActionClicked() { | ||
| // Action to be defined | ||
|
Contributor
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. Just sharing my perspective - I think the only CTA needed on an empty state is "create a new something" one, and here it doesn’t apply. I think only what we need is to have pull to refresh enabled on this state, and that's it. There is nothing to "learn more" here.
Contributor
Author
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. 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. My first move was to show "Refresh" as well, but the design change was to go from "Refresh" to "Learn More". pdfdoF-7Av-p2#comment-9460 |
||
| } | ||
|
|
||
| fun onOrdersLoadingErrorRetryButtonClicked() { | ||
| _state.value = WooPosOrdersState.Loading(searchInputState = WooPosSearchInputState.Closed) | ||
| loadOrders() | ||
| } | ||
|
|
||
| @Suppress("ReturnCount") | ||
| fun loadMoreIfPossible() { | ||
| if (loadingJob?.isActive == true || loadingMoreOrdersJob?.isActive == true) return | ||
|
|
||
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.
@kidinov In this case (and in the empty state), the button has a narrower width in the design. Let me know if you have a better idea for how to adapt it.
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.
That changes the state on all 11 places where this component is used. If this is what Wagner's idea was, then it's fine. Overall, I think it looks ok
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.
We might want to extract that constant so that changing the width will only require one change. This is because both buttons must have the same width
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.
Good idea, I created a shared modifier here 3c3b5f4
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.
Note, make it more specific by not calling it just Button