Conversation
Deploying x with
|
| Latest commit: |
877f624
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://abad6806.x-e62.pages.dev |
| Branch Preview URL: | https://feat-pro-2446-the-exchange-a.x-e62.pages.dev |
There was a problem hiding this comment.
Great work! Looking forward to the next stage of this app! Just to summarise:
- I've left the bulk of the review till the end after the feature is complete
- Some issues are repeating and I didn't add anymore comments for them
- Could we rename the directory / ID from
the-exchange-appto justthe-exchangeplease?
Thanks and great work!
| const renderCards = () => ( | ||
| <div className='flex w-full gap-4 desktop:gap-8 justify-center'> | ||
| <SwapReceiveCard | ||
| onClick={() => handleClick(isInitialOrder ? cardPosition.left : cardPosition.right)} |
There was a problem hiding this comment.
Handle click is a little bit generic, could we make it more specific please?
There was a problem hiding this comment.
Yes agreed, I changed it to: handleOpenTokenList
| } | ||
|
|
||
| useEffect(() => { | ||
| getOffer().then((offer) => setBestOffer(offer)); |
There was a problem hiding this comment.
we'll handle catching in the next task
There was a problem hiding this comment.
100% agreed, not all calls are being handled properly
| } | ||
| }, [type, amountSwap, amountReceive]); | ||
|
|
||
| const handleChange = async (e: React.ChangeEvent<HTMLInputElement>) => { |
There was a problem hiding this comment.
Handle change is too generic, could we be more descriptive here?
There was a problem hiding this comment.
Absolutely, I changed it to: handleTokenAmountChange
| if (bestOffer) { | ||
| addToBatch({ | ||
| title: 'Swap assets', | ||
| chainId: swapToken?.chainId || 0, |
There was a problem hiding this comment.
Wondering what happens if chain is 0?!
There was a problem hiding this comment.
This needs to be better handled in the cleanup, that was a quick win
| @@ -0,0 +1,147 @@ | |||
| import React, { createContext, useContext, useState, useEffect, useMemo } from 'react'; | |||
| import { ExchangeOffer, Token } from '@etherspot/prime-sdk/dist/sdk/data'; | |||
There was a problem hiding this comment.
Just wondering why we're important from the dist directory directly here, I'm assuming these are types? If so they should be exported (if not then they should be, that's missing from the SDK)
There was a problem hiding this comment.
Mmm... I noticed that all types from the SDK are coming from this folder
| const assets = await getPillarSwapAssets(chainId || undefined); | ||
| setSwapTokenData(assets); | ||
| } catch (error) { | ||
| console.error('Error fetching supported assets:', error); |
There was a problem hiding this comment.
Just a note for later, we need to handle this
There was a problem hiding this comment.
just note we'll replace this with Boring Avatars in future
| @@ -0,0 +1,9 @@ | |||
| { | |||
| "title": "The Echange", | |||
There was a problem hiding this comment.
| "title": "The Echange", | |
| "title": "The Exchange", |
2e900f2 to
877f624
Compare
Description
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes