-
Notifications
You must be signed in to change notification settings - Fork 104
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
New deposit page #421
base: main
Are you sure you want to change the base?
New deposit page #421
Conversation
@GoSTEAN nothing changes in this PR, also none of the comments were resolved |
@whateverfw Pls which comment are you referring to. |
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 left some initial comments again, I'm not able to test further, because I can't run an app now, it crashes for me, so please merge with main and fix merge conflcits.
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.
you shouldn't have 2 token selector files, delete this one and work/use the one you've 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.
I have deleted this file long ago, I dont know why is still reflecting on the repo. It is not reflecting on my local machine
{ id: 'strkOption', component: <STRK />, label: 'STRK' }, | ||
]; | ||
|
||
const TokenSelectorDeposit = ({ selectedToken, setSelectedToken }) => { |
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.
it should be called TokenSelector
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.
Changed from TokenSelectorDeposit to TokenSelector in the latest pushed
@GoSTEAN Any updates? |
frontend/src/components/TokenSelector.jsx | ||
frontend/src/pages/spotnet/dashboard/add_deposit.jsx |
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.
wyt this added to git ignore? just remove files if they are not used.
setError(null); | ||
}; | ||
|
||
const handleDeposit = async () => { |
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.
it should be done using useMutation
of tanstack-query
library. Should be put into custom hook inside hooks
folder, we already use this across the project for other requests, thanks.
Also use axiosInstance, not fetch
setSelectedToken('STRK'); | ||
|
||
// Success notification | ||
alert('Deposit successful!'); |
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.
do not use browser's alert, we have notify function for that (of react-toastify) library
alert('Deposit successful!'); | ||
|
||
} catch (err) { | ||
setError(err.message); |
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.
we don't need error state, just show error in a toast message in onError
callback of useMutation
const TokenSelector = ({ selectedToken, setSelectedToken, onSelect }) => { | ||
const handleTokenChange = (token) => { | ||
setSelectedToken(token.label); | ||
if (onSelect) { |
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 don't think that onSelect
is necessary as it is not used anywhere
]; | ||
|
||
const TokenSelectorDeposit = ({ selectedToken, setSelectedToken }) => { | ||
const TokenSelector = ({ selectedToken, setSelectedToken, onSelect }) => { |
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.
Please make sure this component used correctly inside Form.jsx
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.
@GoSTEAN please resolve merge conflicts.
@@ -123,7 +123,7 @@ const Form = () => { | |||
</p> | |||
)} | |||
<label className="token-select">Select Token</label> | |||
<TokenSelector selectedToken={selectedToken} setSelectedToken={setSelectedToken} /> | |||
<TokenSelectorDeposit selectedToken={selectedToken} setSelectedToken={setSelectedToken} /> |
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.
TokenSelector should be used here as you renamed yoiur file.
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.
remove this file, seems like you already have another one?
@@ -104,6 +106,7 @@ function App() { | |||
element={walletId ? <Navigate to="/" /> : <Login onConnectWallet={handleConnectWallet} />} | |||
/> | |||
<Route path="/dashboard" element={<Dashboard telegramId={window?.Telegram?.WebApp?.initData?.user?.id} />} /> | |||
<Route path="/addDeposit" element={<AddDeposit />} /> |
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.
it should be /add-deposit
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.
styles do not match figma.
Add new page add_deposit
close #404