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

Amount Preset inputs #1806

Merged
merged 143 commits into from
Jan 21, 2025
Merged

Amount Preset inputs #1806

merged 143 commits into from
Jan 21, 2025

Conversation

rustam-cb
Copy link
Contributor

@rustam-cb rustam-cb commented Jan 13, 2025

What changed? Why?
Added amount preset inputs for quick input options

PRODUCT REQUIREMENTS:

  • Devs can provide preset amounts (should be exactly 3)
  • Preset amounts are only for fiat (similar to how it works on most other platforms)
Screen.Recording.2025-01-17.at.2.06.06.PM.mov

Notes to reviewers

How has it been tested?

*
* const presetAmountInputs: PresetAmountInputs = ['100', '200', '300'];
*/
export type PresetAmountInputs = readonly [string, string, string];
Copy link
Contributor

Choose a reason for hiding this comment

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

why does this require 3?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alessey We only want to have 3 items listed (so that it looks the way we want it on the UI). We don't want to have less than or more than 3 items on the Ui

Copy link
Contributor

Choose a reason for hiding this comment

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

🤷, that seems like something that would be left up to the consumer, doesn't seem like it'd be hard to handle >3 wrapping. Would this component work if I didn't add the input, but only added preset amounts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alessey Wrapping is not hard to handle. It is a design decision to not wrap the preset input amounts and have 3 items or nothing.
Though I have not tested that way but nothing stops it from working with only preset amounts.

}),
[handleChange, handleFiatChange, handleCryptoChange],
);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems strange to extract since its so tightly coupled to this implementation, how are you planning to reuse it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Extracted it since I'm using it to control the amount input from outside of the amount input component (from the preset amounts component)

@rustam-cb rustam-cb merged commit 567dd02 into main Jan 21, 2025
16 checks passed
@rustam-cb rustam-cb deleted the amount-input-snippets branch January 21, 2025 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants