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

MOB-428 : add custom amount to price triggers screen #140

Merged

Conversation

mike-dydx
Copy link
Contributor

@mike-dydx mike-dydx commented Apr 12, 2024

Links (dYdX Internal Use Only)

Linear Ticket: MOB-428 : add custom amount to price triggers screen

Figma Design: https://www.figma.com/file/mKevZOfE9nj6MZpiolKYW1/dYdX-%E2%80%BA-Mobile?type=design&node-id=5621-14695&mode=design&t=eTjSvS2SdkstNDMd-4


Description / Intuition

  • custom amount view
  • when on, display custom amount input with minimum amount prefilled
  • when modified, modify the triggersInput size field

Before/After Screenshots or Videos

Before After
Simulator.Screen.Recording.-.iPhone.15.-.2024-04-11.at.21.00.31.mp4
Simulator.Screen.Recording.-.iPhone.15.-.2024-04-12.at.18.02.56.mp4

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring or Technical Debt
  • Documentation update
  • Other (please describe: )

Copy link

linear bot commented Apr 12, 2024

@mike-dydx mike-dydx requested a review from ruixhuang April 12, 2024 01:02
@mike-dydx mike-dydx force-pushed the mike/mob-428-add-custom-amount-to-price-triggers-screen branch from 0c667e2 to 29ed2c1 Compare April 12, 2024 21:21
@@ -1,5 +1,5 @@
{
"originHash" : "e085067eee7983e4ba42c06fd96e9ea3884445575db37e125bed61bde5eeb3f1",
"originHash" : "3cd7346cace16cf660f9c22302c5ca6770335c67902f3fd155011356a9d43929",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ruixhuang any chance you know why my package resolved file just keeps updating? It's all over the place

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah.. it happens to me, I'd just revert it without checking it in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i might remove

@@ -524,7 +524,7 @@ open class PlatformBooleanInputViewModel: PlatformValueInputViewModel {
if let label = label, label.length > 0 {
return Text(label)
.themeColor(foreground: isEnabled ? .textSecondary : .textTertiary)
.themeFont(fontSize: .smaller)
.themeFont(fontSize: .medium)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tested this in other places (trade input view)

@mike-dydx mike-dydx marked this pull request as draft April 12, 2024 21:23
@mike-dydx mike-dydx marked this pull request as ready for review April 12, 2024 21:23

@objc private func sliderValueChanged(sender: UISlider) {
guard let stepSizeDecimals else { return }
let roundedValue = dydxFormatter.shared.raw(number: NSNumber(value: sender.value), digits: stepSizeDecimals)
Copy link
Contributor

Choose a reason for hiding this comment

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

Markets like Shiba have stepSize like 100, 1000, 10000, so we'd need to round the size with something like

size = Int(size / stepSize) * stepSize

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, i thought the raw function did that, looks like it does in some implementations, I will update in this PR

}()

private var sliderBackground: some View {
GeometryReader { geometry in
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Nice trick!

@mike-dydx mike-dydx requested a review from ruixhuang April 12, 2024 22:06
@mike-dydx mike-dydx merged commit 444fd4e into develop Apr 12, 2024
1 of 2 checks passed
@mike-dydx mike-dydx deleted the mike/mob-428-add-custom-amount-to-price-triggers-screen branch April 12, 2024 22:07
mike-dydx added a commit that referenced this pull request Aug 20, 2024
* bump 1.6.36 -> 1.6.38

* some ui

* add label accessory to platform input, split out input views into view models

* clean up

* add cta button

* hook up button and button states

* abacus?

* clean up

* pause

* clean up

* clean up

* fix rounding
mike-dydx added a commit that referenced this pull request Aug 21, 2024
* bump 1.6.36 -> 1.6.38

* some ui

* add label accessory to platform input, split out input views into view models

* clean up

* add cta button

* hook up button and button states

* abacus?

* clean up

* pause

* clean up

* clean up

* fix rounding
mike-dydx added a commit that referenced this pull request Aug 21, 2024
* bump 1.6.36 -> 1.6.38

* some ui

* add label accessory to platform input, split out input views into view models

* clean up

* add cta button

* hook up button and button states

* abacus?

* clean up

* pause

* clean up

* clean up

* fix rounding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants