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

[FEATURE] Apply SOLID and Clean code practices in some react components #72

Open
jpcirqueira opened this issue Apr 4, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@jpcirqueira
Copy link
Collaborator

jpcirqueira commented Apr 4, 2022

Is your feature request related to a problem? Please describe.
Some components must follow clean code practices as well as solid for better readability and maintainability.

Describe the solution you'd like
Apply clean code and solid best practices to chosen components.

Describe alternatives you've considered
Components to be refactored:

  • app/javascript/components/form_fields/MoneyTextField.tsx
  • app/javascript/components/users/SignInComponent.tsx
  • app/javascript/legacy_react/src/components/common/layout.tsx
  • app/javascript/legacy_react/src/components/common/ProgressableButton.tsx

Branch:

apply-solid-and-clean-code-in-react-componentes

@jpcirqueira jpcirqueira added the enhancement New feature or request label Apr 4, 2022
@jpcirqueira jpcirqueira self-assigned this Apr 4, 2022
@jpcirqueira
Copy link
Collaborator Author

jpcirqueira commented Apr 6, 2022

app/javascript/components/form_fields/MoneyTextField.tsx

  • abstraído logica do hook para outro componente app/javascript/hooks/useSerializeMoney.ts (SRP)
  • removido comentários desnecessários (clean code)
  • ajustado tipagens erradas (clean code)
  • renomeado variáveis (clean code)
  • retirando códigos não utilizados (clean code)

@jpcirqueira
Copy link
Collaborator Author

jpcirqueira commented Apr 6, 2022

app/javascript/components/users/SignInComponent.tsx

  • abstraído logica do hook (SRP)
  • adicionado tratamento de erro na requisição signIn (clean code)
  • removido comentários desnecessários (clean code)

@jpcirqueira
Copy link
Collaborator Author

jpcirqueira commented Apr 7, 2022

app/javascript/legacy_react/src/components/common/layout.tsx
app/javascript/legacy_react/src/components/common/ProgressableButton.tsx

  • romovido importações não utilizadas (clean code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant