[PE-7307, PE-7308] Add coin redeem pages - #13390
Conversation
|
| } catch (error) { | ||
| // Handle 400 errors | ||
| // Tells us if disburements for the coin have ended | ||
| if (error instanceof ResponseError) { |
There was a problem hiding this comment.
could have stricter check here
There was a problem hiding this comment.
Yeah this should probably check the status code and the error message specifically.
|
|
||
| return response | ||
| }, | ||
| onSettled: (_, __, { mint }) => { |
There was a problem hiding this comment.
mighttt need optimistic update, probably doesn't matter super much tho?
There was a problem hiding this comment.
thought of this, but i dont know what i would update. I guess we could optimistically add the reward to the users coin balance, but seems overkill
There was a problem hiding this comment.
yeah would need amount. but watevs
| import { BannerSection } from '../coin-details-screen/components/CoinInfoCard' | ||
|
|
||
| const messages = { | ||
| title: (ticker: string) => `Redeem $${ticker}`, |
There was a problem hiding this comment.
sure the ticker doesn't already have $ on it? try with a prod coin, staging coins might be out of date
There was a problem hiding this comment.
no dollar sign on tickers by default
| > | ||
| <ScreenContent> | ||
| <ScrollView> | ||
| <Flex column gap='m' ph='s' pv='2xl'> |
| <Flex column gap='xs'> | ||
| <Text variant='heading'>{coin?.name}</Text> | ||
| {rewardAmountPending ? ( | ||
| <Box h={16} w={64}> |
| } | ||
|
|
||
| type PageContentProps = { | ||
| coin: Coin | undefined |
dharit-tan
left a comment
There was a problem hiding this comment.
can u remind me the diff between code vs non-code redemptions?
| }) | ||
| queryClient.invalidateQueries({ | ||
| queryKey: [QUERY_KEYS.artistCoinMembers, mint] | ||
| }) |
| feature: Feature.ArtistCoins | ||
| }) | ||
|
|
||
| // TODO: Should 'Please try again' be added to the end of the message? |
There was a problem hiding this comment.
something to figure out now?
| // Normalize ticker to uppercase | ||
| const normalizedTicker = ticker.toUpperCase() | ||
|
|
||
| if (coinRoute === 'redeem') { |
| import { BannerSection } from '../coin-details-screen/components/CoinInfoCard' | ||
|
|
||
| const messages = { | ||
| title: (ticker: string) => `Redeem $${ticker}`, |
There was a problem hiding this comment.
no dollar sign on tickers by default
…ming, and connect claim buttons
| } catch (error) { | ||
| // Handle 400 errors | ||
| // Tells us if disburements for the coin have ended | ||
| if (error instanceof ResponseError) { |
There was a problem hiding this comment.
Yeah this should probably check the status code and the error message specifically.
| } catch (error) { | ||
| // Handle 400 errors | ||
| // Tells us if the code is invalid or already redeemed | ||
| if (error instanceof ResponseError) { |
There was a problem hiding this comment.
This should have the same error shape as the info endpoint (tells you if invalid or already used), so also want to check 400 cases explicitly here.
| mint, | ||
| userId: Id.parse(currentUserId), | ||
| code | ||
| }) |
There was a problem hiding this comment.
This needs 400 error handling similar to the other calls.
There was a problem hiding this comment.
shouldn't be getting here if the code in the first place if the code is used or invalid so no need for special cases
5221da3 to
6e274a7
Compare
### Description * Add redeem page on web * Add redeem screen on mobile * Sets up deep linking on mobile to go to redeem screen * Add hooks for fetching the reward amount with and without code * Add hooks for claiming coin rewards with and without code * Some other stuff ### How Has This Been Tested? Needs more testing when SDK is updated
[16d4c68] [PE-7289] Add artist social links on coin create (#13435) Dylan Jeffers [714814d] [PE-7320] Add copy link coin overflow option (#13440) KJ [108cdc1] [PE-7335] Increase slippage to 2% (#13432) Dylan Jeffers [8a59173] [PE-7025] Fix optimistic fee claiming not working (#13431) JD Francis [5e6438e] [PE-7336] Fix stripe mobile on-ramp visibility (#13439) Dylan Jeffers [c6488b4] Revert "Increase max file size for uploads (#13430)" (#13436) Marcus Pasell [f0d22bf] Drop trading volume launch banner (#13434) Dylan Jeffers [e2d6f9e] Increase max file size for uploads (#13430) Marcus Pasell [e16832d] [PE-7286] Update portfolio balance error text color (#13429) Dylan Jeffers [92ee20d] [PE-7324] Prevent portfolio balance hovering from swiping page (#13426) Dylan Jeffers [d520d7b] [PE-7287] Fix artist-coin description color (#13425) Dylan Jeffers [c1bc62d] [PE-7315] Drop verify flow (#13410) Dylan Jeffers [beb486a] [PE-7148] Update Upload coin gated track button to populate initial form data (#13424) KJ [0bc129c] [PE-7121] Add tooltip for coin price in insights section (#13422) KJ [12cbd20] [PE-7196] Fix coin balance loading state (#13420) KJ [3c24888] [PD-488] Fix spacing in the coin details right section (#13423) KJ [20f30bc] Version Packages (#13416) github-actions[bot] [5c7cc68] [PE-7322] Fix comment reply right padding (#13417) KJ [6fea43f] [PE-7325] Fix tip $AUDIO balance large after swap to $AUDIO (#13415) Reed [74098b3] [PE-7288] Update edit coin description field height (#13413) KJ [1f84141] Timeout image loading in case of hanging connections (#13409) Danny [6fd0a97] Add DOM test output on web-test failures (#13383) JD Francis [0fd54bc] [PE-7316] Update artist coin hover card width (#13412) Dylan Jeffers [950757b] [PE-7315] Fix remix contest winners index (#13397) Dylan Jeffers [09d0bbb] [PE-7204] Associate external wallet after swap (#13411) Dylan Jeffers [6173e94] Format tickers for urls and hooks (#13402) KJ [a0125db] Filter out unsupported challenges from notifs (#13408) Reed [48ccd99] Drop photo requirement text (#13407) Dylan Jeffers [23d315d] Fix takeover cta (#13406) KJ [9a0cc8c] css lint fixes (#13405) KJ [f8e35fc] Artist takeover (#13403) KJ [a705fcd] Add banner (#13404) KJ [cb4c07e] Ensure the token mint is set correctly in meteora dbc swaps (#13401) Marcus Pasell [16da7c3] Fix bundlesize check (#13400) Dylan Jeffers [6395893] Revert "[PE-7239] Fix issues due to stale local storage data (#13311)" (#13396) Dylan Jeffers [2b8e0c9] [PE-7312] Update announcement notifs to link from notif data (#13395) KJ [f96f996] Fix user track filter type (#13394) Dylan Jeffers [83bcf85] [PE-7307, PE-7308] Add coin redeem pages (#13390) KJ
Description
How Has This Been Tested?
Needs more testing when SDK is updated