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

Changed function responsible for trimming leading zeros. #87

Merged
merged 3 commits into from
Nov 7, 2019

Conversation

Cich0sza
Copy link
Contributor

No description provided.

Copy link
Collaborator

@goeson00 goeson00 left a comment

Choose a reason for hiding this comment

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

Minor changes.

@@ -16,8 +16,14 @@ const BoardForm = ({ onSubmit, renderActions, boardId, ...initialFormValues }) =
const validationSchema = createValidationSchema(boardId, boards);
const {values, handleChange, handleSubmit, errors} = useFormData(initialFormValues, validationSchema, true);

const numberInputHandler = (event) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change the name to handleNumberInput or handleInput according to convention.


export const trimLeadingZeros = (event) => {
const inputValue = event.target.value;
export const trimLeadingZeros = (inputValue) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change it to oneliner => String(parseInt(inputValue)). In my opinion it is clear what parseInt is doing, so it will be readable.

Copy link
Contributor

@szymon-owczarzak szymon-owczarzak left a comment

Choose a reason for hiding this comment

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

Resolve conflicts and merge

…r/triming-zeros

# Conflicts:
#	cogboard-webapp/src/helpers/index.js
@Cich0sza Cich0sza merged commit ad6dd59 into master Nov 7, 2019
@Cich0sza Cich0sza deleted the coderefactor/triming-zeros branch November 7, 2019 16:29
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.

3 participants