Feat/add spinner to button #368
No reviewers
Labels
No Label
1000k
100k
10k
200k
20k
500k
50k
5k
75k
backend
blocked:design
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
P1
P2
P3
question
scope:intl
scope:nip
scope:query_tracing
scope:ux
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Kieran/snort#368
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/add-spinner-to-button"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Some information on the implementation:
I decided to use css style visibility to hide the button text, to keep the width of the button on changing the state to the loading spinner
I am actually used to handling the loading state outside the loading button, in the component where the button is used and the data handling of the button callback is handled. The loading state is then just passed down to the button. This way there is more control over the loading state, because it can be set and unset bevor and after the async request.
As it is right now, I think the loading is reset by a re-render of the button.
So I think in the long run, I think it makes sense to have the loading state handled in the parent component and pass it down to the button. I would need to refactor alls 4 places where the AsyncButton is used. What do you think?
Would it make sense to rename AsyncButton to LoaderButton or SpinnerButton?
Should I also apply AsyncButton to /settings/relays "Save" button?
I added a "disabled" property to the AsyncButton, for future use. Maybe a button should be disalbed, as long as form fields are not valid.
I added a new Spinner for the fast zaps, can you use that one instead? Please rebase and you will see it
The spinner is very opaque thought, because of global css styles for disabled buttons having
opacity: 0.3
- this also affects the spinner. Please have a look, in case it might make sense to re-think buttons styles for the different states and maybe replace usingopacity
with changing color brightness for hover states.Will check styles once its merged, thanks