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

refactor: assign color in fill instead of className #59

Open
wit03 opened this issue Oct 9, 2024 · 0 comments
Open

refactor: assign color in fill instead of className #59

wit03 opened this issue Oct 9, 2024 · 0 comments

Comments

@wit03
Copy link
Member

wit03 commented Oct 9, 2024

          _:warning: Potential issue_

Incorrect use of className for color codes on icons

In lines 86-88 and 103-105, you're assigning color codes (e.g., #161616, #94A3B8) to the className prop of the Grid and List components. The className prop is intended for CSS class names, not color values.

To set the color of the icons, you should use the fill prop or style prop.

Apply this diff to fix the issue:

-<Grid
-  size={28}
-  className={`${
-    state.view === 'g' ? '#161616' : '#94A3B8'
-  } p-0.5`}
-/>
+<Grid
+  size={28}
+  fill={state.view === 'g' ? '#161616' : '#94A3B8'}
+  className="p-0.5"
/>

And similarly for the List component:

-<List
-  size={28}
-  className={`${
-    state.view === 'l' ? '#161616' : '#94A3B8'
-  } p-0.5`}
-/>
+<List
+  size={28}
+  fill={state.view === 'l' ? '#161616' : '#94A3B8'}
+  className="p-0.5"
/>

Also applies to: 103-105

Originally posted by @coderabbitai[bot] in #46 (comment)

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

No branches or pull requests

1 participant