Wallet redesign #6917
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#6917
Loading…
Reference in a new issue
No description provided.
Delete branch "squashed-and-merged"
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?
Almost there
This is looking really good.
This component is very complex and it's my fault. I'm completely open to refactoring this to work differently, but I'd rather not have half of it working one way and half of it working another way.
The idea behind delta was to only send what changed, and in one button click, really only one thing would change. Delta was originally "here's the queryparam that changed; react accordingly". - so it took a single key (dkey since key was reserved) and what the new value was.
You can put these strings as consts
Q_CURRENCY = 'currency'
Q_TAB = 'tab'
Q_FIAT_TYPE = 'fiatType'
etc
If we change the search param name, we only want to do it one place. IDE will complain if you misspell the constant, but not if you misspell the string.
let's urlParams.get() the tab param too.
tab param
Should be able to respond to every delta in the switch statement to keep the urlbar sane.
case Q_TAB: ? moving to balance? clear meaningless values; to txes? restore previous currency and params.
case Q_CURRENCY: ? restore previous params or load default params;
in the switch statement, if
dkey === 'currency'
,newUrlParams.set('currency', delta.value)
then unset everything that doesn't make sense on the alternate currency page
(or load the whole params from the corresponding currency's useState as described below)
@ -172,2 +276,4 @@
newUrlParams.set(TXO.PAGE, String(1));
newUrlParams.set(TXO.PAGE_SIZE, currentUrlParams.pageSize);
newUrlParams.set(QUERY_NAME_TAB, currentUrlParams.tab);
newUrlParams.set(QUERY_NAME_CURRENCY, currentUrlParams.currency);
I recommend, after gathering the currentParams object, store it in one of two useState()s based on the current currency. Trigger setFiatParams({...}) or setCreditsParams({...}) in a useEffect that takes the queryString and currency strings in the param array.
inside the useEffect might look like:
Then in the switch statement, if, as an example, dkey === 'currency' and and value === 'credits' and you're currently on fiat, make the newURLparams out of the creditsParams from the useState. It will "history.replace()" with the new route.
Here's a good style for the "No Transactions" empty state:
<div className="empty main--empty">{__('No Transactions')}</div>
This is good, pending testing.