Skip to content
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

Buy sell panel slider #568

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open

Buy sell panel slider #568

wants to merge 30 commits into from

Conversation

saidam90
Copy link
Contributor

Implemented Buy/Sell panel percentage slider.

@saidam90 saidam90 requested a review from a team as a code owner August 25, 2024 21:36
Copy link

cloudflare-pages bot commented Aug 25, 2024

Deploying dexter with  Cloudflare Pages  Cloudflare Pages

Latest commit: 37b6816
Status: ✅  Deploy successful!
Preview URL: https://6c4dad38.dexter-1we.pages.dev
Branch Preview URL: https://buy-sell-panel-slider.dexter-1we.pages.dev

View logs

package.json Outdated Show resolved Hide resolved
@dcts
Copy link
Contributor

dcts commented Sep 8, 2024

Some feedback:

  • I tested the following user journeys:
    • MARKET BUY✅
    • MARKET SELL🔴 (see next bulletpoint)
    • LIMIT BUY✅
    • LIMIT SELL✅
  • I cannot use MARKET SELL order anymore, the SELL button seems to be always disabled
Bildschirmfoto 2024-09-08 um 23 28 49
  • When using a LIMIT SELL order, I set the slider to 100%, but the tooltip shows 100.00003% (so more than 100%), and the balance then is marked as "insufficient".
Bildschirmfoto 2024-09-08 um 23 32 31

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to make those classes inline tailwind CSS classes instead of using global classes?
If you run into the issue that they are not applied or overwritten, you can always try adding ! before the class, so it becomes !important.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saidam90 did you try this?

src/app/components/OrderInput.tsx Outdated Show resolved Hide resolved
Comment on lines +879 to +880
isBuyOrder: boolean;
isSellOrder: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be
isMarketBuyOrder
isMarketSellOrder
?

Or are we using those booleans also for LIMIT orders?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saidam90 can you comment on this?

src/app/components/OrderInput.tsx Outdated Show resolved Hide resolved
src/app/components/OrderInput.tsx Outdated Show resolved Hide resolved
src/app/components/OrderInput.tsx Outdated Show resolved Hide resolved
src/app/components/OrderInput.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@dcts dcts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Using the calculator seems to have removed the issues with rounding I ran into.

Also the reported bugs seem fixed for me too.

Some minor changes. I'd say let's test this on stokenet with 3-4 testers. I will organize a community test.

} else if (isLimitOrder) {
sliderCallback(0, "LIMIT");
}
}, [isBuyOrder, isSellOrder, isMarketOrder, isLimitOrder]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React Hook useEffect has a missing dependency: 'sliderCallback'. Either include it or remove the dependency array

}, [isBuyOrder, isSellOrder, isMarketOrder, isLimitOrder]);

const sliderCallback = (newPercentage: number, type: string) => {
console.log(`Type is: ${type}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove console log.

@@ -479,7 +541,15 @@ function UserInputContainer() {
<>
<CurrencyInputGroup userAction={UserAction.UPDATE_PRICE} />
<CurrencyInputGroup userAction={UserAction.SET_TOKEN_1} />
<PercentageSlider />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The percentage slider in market orders should be below the input field, not above.
Bildschirmfoto 2024-09-19 um 04 35 02


return (
<>
<div className="slider-container rounded-md w-full relative mt-5">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make the full slider opacity of 0.7, currently there is too much emphasis on it.

Suggested change
<div className="slider-container rounded-md w-full relative mt-5">
<div className="slider-container rounded-md w-full relative mt-5 opacity-70">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

2 participants