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

Transform otherAmount select to input field #1581

Merged
merged 3 commits into from
Sep 5, 2023

Conversation

dphilipov
Copy link
Contributor

Closes #1561

Motivation and context

  • When clicking the otherAmount option, the input field renders in it's place instead of next to it, to avoid confusion for the users
  • The input field is auto focused
  • Since the issue didn't specify, I added a fade transition (200ms)

Screenshots:

Before

before

After

after

Testing

Steps to test

  1. Initiate a donation to a cmpaign
  2. Choose the Other Amount field

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

✅ Tests will run for this PR. Once they succeed it can be merged.

@@ -18,6 +20,10 @@ export default function NumberInputField({
const [, meta, { setValue, setError }] = useField(name)
const decimalSeparator = (1.1).toLocaleString(i18n.lang).charAt(1)

useEffect(() => {
setValue(1)
Copy link
Contributor Author

@dphilipov dphilipov Sep 4, 2023

Choose a reason for hiding this comment

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

I'm setting the value to 1, because currently there is brief moment where the validation gets triggered and the Минималната сума която може да дарите с карта е 1лв. error message gets shown. This was kinda hidden by the Collapse animation.

@dphilipov
Copy link
Contributor Author

Not related to the issue, but I believe this translation does not exist setError(t('first-step.only-numbers')). Is there a translation text that I can use, or should I remove the setter?

Currently it shows this:
image

@igoychev igoychev added the run tests Allows running the tests workflows for forked repos label Sep 5, 2023
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Sep 5, 2023
@igoychev
Copy link
Contributor

igoychev commented Sep 5, 2023

Not related to the issue, but I believe this translation does not exist setError(t('first-step.only-numbers')). Is there a translation text that I can use

Great find! Let's add the missing one - please search for 'transaction-limit' in the code(Ctrl+Shift+F) and it will show you the translation files with translations and feel free to add the "only-numbers" text messages.

@dphilipov
Copy link
Contributor Author

Not related to the issue, but I believe this translation does not exist setError(t('first-step.only-numbers')). Is there a translation text that I can use

Great find! Let's add the missing one - please search for 'transaction-limit' in the code(Ctrl+Shift+F) and it will show you the translation files with translations and feel free to add the "only-numbers" text messages.

I added the missing translation. Hope the text is ok.

Copy link
Contributor

@igoychev igoychev left a comment

Choose a reason for hiding this comment

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

great change and very professional side improvements for the translations!

@igoychev igoychev added the run tests Allows running the tests workflows for forked repos label Sep 5, 2023
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Sep 5, 2023
@igoychev igoychev merged commit 28cdd9c into podkrepi-bg:master Sep 5, 2023
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Other amount field for donation custom sum
2 participants