-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
b0cbafd
to
580e7bf
Compare
|
@@ -0,0 +1,21 @@ | |||
import { Trans } from '@lingui/macro' |
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.
this is an example (to be kept) to show how it will work. Next PR #2072 goes hard on this
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.
And here I thought we would have less boilerplate
🤷
export const enum ActionTypes { | ||
// accounts/address | ||
setInputAddress = 'setInputAddress', | ||
setActiveClaimAccount = 'setActiveClaimAccount', | ||
setActiveClaimAccountENS = 'setActiveClaimAccountENS', | ||
// claiming | ||
setClaimConfirmed = 'setClaimConfirmed', | ||
setClaimAttempting = 'setClaimAttempting', | ||
setClaimSubmitted = 'setClaimSubmitted', | ||
setClaimedAmount = 'setClaimedAmount', | ||
// investment | ||
setIsInvestFlowActive = 'setIsInvestFlowActive', | ||
setInvestFlowStep = 'setInvestFlowStep', | ||
// search | ||
setIsSearchUsed = 'setIsSearchUsed', | ||
// selected claim rows (table/UI) | ||
setSelected = 'setSelected', | ||
setSelectedAll = 'setSelectedAll', | ||
} |
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.
😱
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.
in fairness tho, it's TS that adds a lot of bloat, tho it's helpful innit. Maybe i should consider using the createActions here actually 🤔
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.
Can we please go for Recoil in the next project 🥺
hahah yeah i made a comment about this in the morning sync. figured its better here tho rather than cluttering the global object. |
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.
Thanks for making the effort to refactor. I can tell you had to add some thought into it.
However... Are we sure we want to go this path? I'm am very hesitant
I understood you would add Context, which I was also not super sure it would be perfet for this because I was not expecting a deep hierarchy.
You not only added context, but also are using a reducer.
One other concern with this PR, is how we have modeled the state and actions and the state. It seems there's way more stuff than necessary.
These 3 things (context, actions with lots of boilerplate code, not so good modeling) makes this kind of hard to mantains in my eyes.
I thought we were going through the simple route, this is why we didn't add redux as the rest of the app has, but this approach seems even harder.
We discussed internally, and we will move this forwards, we cannot afford to loose too much time in the refactoring. However, given this PR already addes reducers, we also talk we will use redux as all the other parts of the app do |
…en (#2064) * initial off screen indicator * adjust offscreen indicator * add off screen handle indicator * hide reset until we get a better behavior * add svg.tsx
Summary
As discussed, this is the context state implementation for claiming. It creates a similar actions/reducer file structure in the
Claim
folder and allows passing of state without "props drilling"As a working example, I extrapolated "EligibleBanner" into
Claim > EligibleBanner.tsx
and it is used inindex.tsx