Skip to content

Commit

Permalink
fix keys and ripple lib
Browse files Browse the repository at this point in the history
  • Loading branch information
jekrch committed Jul 2, 2024
1 parent f271eba commit d8acf3e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/modals/config/AnalyzeTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const AnalyzeTab: React.FC = () => {
</a>
<IconButton
className="ml-2 bg-blue-500 hover:bg-blue-700 text-white font-normal pl-[0.7em] rounded-md text-xs py-[0.5em] pr-[1em]"
onClick={() => addRankingAsCategory(comparison.list2Code, rankingTitle, true)}
onClick={() => addRankingAsCategory(comparison.list2Code, rankingTitle)}
icon={undefined}
title="Add as Category"
/>
Expand Down Expand Up @@ -227,7 +227,7 @@ const AnalyzeTab: React.FC = () => {
</a>
<IconButton
className="ml-2 bg-blue-500 hover:bg-blue-700 text-white font-normal pl-[0.7em] rounded-md text-xs py-[0.5em] pr-[1em]"
onClick={() => addRankingAsCategory(comparison.list2Code, rankingTitle, true)}
onClick={() => addRankingAsCategory(comparison.list2Code, rankingTitle)}
icon={undefined}
title="Add as Category"
/>
Expand Down
9 changes: 5 additions & 4 deletions src/components/ranking/RankedItemsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ const RankedItemsHeader: React.FC<IRankedItemsHeaderProps> = ({
/>
</div>
)}

{(!showUnranked && categories.length > 0) && (
<div className="flex bg-gray-800 bg-opacity-40 border-gray-200 mt-1 -mb-[0.2em] overflow-x-auto">
<Ripples placeholder={<></>} onPointerEnterCapture={undefined} onPointerLeaveCapture={undefined}>
<div key={`total-tab-container`} className="flex bg-gray-800 bg-opacity-40 border-gray-200 mt-1 -mb-[0.2em] overflow-x-auto">
<Ripples key="total-ripple" placeholder={<></>}>
<button
key="total-tab"
className={classNames(
Expand All @@ -118,9 +119,9 @@ const RankedItemsHeader: React.FC<IRankedItemsHeaderProps> = ({
</button>
</Ripples>
{categories.map((category, index) => (
<Ripples placeholder={<></>} onPointerEnterCapture={undefined} onPointerLeaveCapture={undefined}>
<Ripples key={`ripple-${index + 1}`} placeholder={<></>}>
<button
key={index + 1}
key={`cat-btn-${index + 1}`}
className={classNames(
"px-4 py-[0.2em] text-sm font-medium flex-shrink-0",
activeTab === index + 1 ? "text-blue-400 border-b-0 border-blue-400" : "text-gray-500 hover:text-blue-500"
Expand Down
13 changes: 13 additions & 0 deletions src/modules/react-ripples.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// src/global.d.ts
import 'react'

declare module 'react' {
interface HTMLAttributes<T> {
onPointerEnterCapture?: (e: React.PointerEvent<T>) => void
onPointerLeaveCapture?: (e: React.PointerEvent<T>) => void
}
interface RefAttributes<T> {
onPointerEnterCapture?: (e: React.PointerEvent<T>) => void
onPointerLeaveCapture?: (e: React.PointerEvent<T>) => void
}
}

0 comments on commit d8acf3e

Please sign in to comment.