"Avoid using magic numbers or hard-coded values. Instead, use constants or variables to improve code readability and maintainability."
Description
This PR addresses the issue of hard-coded values in the BackgroundSelector.tsx file. Hard-coded values for the dimensions of elements have been replaced with constants to improve code readability and maintainability.
Summary of Changes
Added constants BACKGROUND_SIZE and DELETE_BUTTON_SIZE at the top of the BackgroundSelector.tsx file.
Replaced hard-coded values for the width and height of background elements with the BACKGROUND_SIZE constant.
Replaced hard-coded values for the width and height of the delete button with the DELETE_BUTTON_SIZE constant.
This change ensures that the code follows best practices and avoids magic numbers or hard-coded values.
PR Feedback (click)
I created this PR to address this rule:
"Avoid using magic numbers or hard-coded values. Instead, use constants or variables to improve code readability and maintainability."
Description
This PR addresses the issue of hard-coded values in the
BackgroundSelector.tsx
file. Hard-coded values for the dimensions of elements have been replaced with constants to improve code readability and maintainability.Summary of Changes
BACKGROUND_SIZE
andDELETE_BUTTON_SIZE
at the top of theBackgroundSelector.tsx
file.BACKGROUND_SIZE
constant.DELETE_BUTTON_SIZE
constant.This change ensures that the code follows best practices and avoids magic numbers or hard-coded values.