Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/components/Global/Sorting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ const Sorting = ({ title }: SortingProps) => {
const [active, setActive] = useState<boolean>(false)
return (
<button
className={`group inline-flex items-center text-xs font-bold transition-colors hover:text-purple-2 ${
className={`group inline-flex cursor-default items-center text-xs font-bold transition-colors ${
active ? 'text-purple-2' : ''
}`}
Comment on lines +12 to 14
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider improving the user experience for the disabled sorting feature.

The removal of the hover effect and addition of the default cursor correctly reflects that the button is no longer interactive. However, keeping a non-interactive button might confuse users.

Consider one of the following options:

  1. Remove the button entirely if sorting is no longer a feature.
  2. If sorting will be re-enabled in the future, add visual cues to indicate its disabled state:
-            className={`group inline-flex cursor-default items-center text-xs font-bold transition-colors ${
-                active ? 'text-purple-2' : ''
-            }`}
+            className={`group inline-flex items-center text-xs font-bold transition-colors opacity-50 cursor-not-allowed ${
+                active ? 'text-purple-2' : ''
+            }`}

This change will visually indicate that the button is disabled while maintaining its presence for future use.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
className={`group inline-flex cursor-default items-center text-xs font-bold transition-colors ${
active ? 'text-purple-2' : ''
}`}
className={`group inline-flex items-center text-xs font-bold transition-colors opacity-50 cursor-not-allowed ${
active ? 'text-purple-2' : ''
}`}

onClick={() => setActive(!active)}
onClick={() => console.warn('Table sorting disabled')}
// onClick={() => setActive(!active)} // Currently disabled because the sorting doesn't work and needs to be revisited
>
{title}
{/* <Icon
Expand Down