-
Notifications
You must be signed in to change notification settings - Fork 16
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
Create pool redesign - feature branch #2537
base: main
Are you sure you want to change the base?
Conversation
PR deployed in Google Cloud |
PR deployed in Google Cloud |
c962a38
to
4d6c428
Compare
c6811f7
to
45db2a9
Compare
45db2a9
to
19988cc
Compare
* Add pool structure UI changes * Small UI fix * Avoid deletion on entries if less than one * Add logic to single / multi sign * Fix linter errors
* Fix ts error and change logic for onboarding values * Add create pool existing functionality * Cleanup types * cleanup * Add deposit banner * Fix linter errors * Add metadata values * Cleanup types * Add onboarding functionality and UI fixes * Add proxies functionality * Fix ts errors * Add create pool dialog * Add dialogs * Add review feedback * wip * Add waiting before redirecting to avoid error * Remove default empty pool fee
* Bug fixes and add proposal link * Fix ratings creating empty value
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.
Amazing to see this come together so nicely 🔥
There are a few comments from me and a few from the github bot that are probably worth fixing.
- Here, I'm wondering what the wallet address is for this input? Would that be the pool admin?
- If single is selected, I think we should hide the threshold section underneath.
- The address (single and multisig) should be validated like the rest of the address inputs and show a red error message if it doesn't match
Lastly, I tried to create a pool and it failed with this error message:
Error: createType(Call):: Call: failed decoding poolRegistry.register:: Struct: failed on args: {"admin":"AccountId32","pool_id":"u64","tranche_inputs":"Vec<PalletPoolSystemTranchesTrancheInput>","currency":"{\"_enum\":{\"Native\":\"Null\",\"Tranche\":\"(u64,[u8;16])\",\"__Unused2\":\"Null\",\"AUSD\":\"Null\",\"ForeignAsset\":\"u32\",\"Staking\":\"CfgTypesTokensStakingCurrency\",\"LocalAsset\":\"u32\"}}","max_reserve":"u128","metadata":"Option<Bytes>","write_off_policy":"Vec<PalletLoansPolicyWriteOffRule>","pool_fees":"Vec<(CfgTraitsFeePoolFeeBucket,CfgTypesPoolsPoolFeeInfo)>"}:: Struct: failed on pool_fees: Vec<(CfgTraitsFeePoolFeeBucket,CfgTypesPoolsPoolFeeInfo)>:: Tuple: failed on 1:: Struct: failed on feeType: {"_enum":{"Fixed":"{\"limit\":\"CfgTypesPoolsPoolFeeAmount\"}","ChargedUpTo":"{\"limit\":\"CfgTypesPoolsPoolFeeAmount\"}"}}:: Cannot map Enum JSON, unable to find '' in fixed, chargedupto
I think it should be an easy fix but I'm happy to help you debug tomorrow!
fabric/src/theme/tokens/theme.ts
Outdated
@@ -17,7 +17,7 @@ const statusPromoteBg = '#f8107114' | |||
const colors = { | |||
textPrimary: grayScale[800], | |||
textSecondary: grayScale[500], | |||
textDisabled: grayScale[300], | |||
textDisabled: '#6A7280', |
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.
would it make sense to adjust a value in the grayScale
instead of defining a new one?
) | ||
|
||
const ratings = values.poolRatings.map((rating, index) => { |
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 be removed
Co-authored-by: Sophia <[email protected]>
Co-authored-by: Sophia <[email protected]>
Co-authored-by: Sophia <[email protected]>
form.setFieldValue(field.name, event.target.value) | ||
} | ||
return props.isUrl ? ( | ||
<URLInput |
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 seems like the wrong place for this. Also don't think it's needed. You should be able to use the URLInput
as a prop to FieldWithErrorMessage
:
<FieldWithErrorMessage
name="website"
as={URLInput}
label="Website URL"
placeholder="www.example.com"
validate={validate.websiteNotRequired()}
/>
const [, , , , poolId] = args | ||
if (createType === 'immediate') { | ||
setCreatedPoolId(poolId) | ||
navigate(`/pools/${poolId}`) |
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.
I think this should stay in the useEffect like it was before. The data for the newly created pool won't always be immediately loaded, so it should wait for the data of the new pool before navigating to it.
@@ -208,6 +208,7 @@ function AOForm({ | |||
}), | |||
newMetadata ? cent.pools.setMetadata([poolId, newMetadata], { batch: true }) : of(null), | |||
]).pipe( | |||
// THIS IS WHERE PROXIES ARE BEING CREATED |
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 be removed
label, | ||
errorMessage, | ||
extendedClickArea, | ||
variant = 'round', |
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 doesn't make sense, checkboxes should always be square. For single choice inputs, you can use RadioButton
APY should be based on junior token
2f39697
to
17d3fde
Compare
Create pool redesign
https://www.figma.com/design/ng7qdNcSCXSDA6ZUdWIs6u/Pool-Overview%2F-Pool-Detail?node-id=4137-4180&node-type=section&m=dev
#2529
Approvals