Skip to content

Commit

Permalink
refactor(Slider.tsx): remove unused import and type declaration
Browse files Browse the repository at this point in the history
fix(Slider.tsx): fix type error in onClick event handler
  • Loading branch information
danny-avila committed Aug 9, 2023
1 parent b896225 commit 002bba2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions client/src/components/ui/Slider.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
'use client';

import * as React from 'react';
import * as SliderPrimitive from '@radix-ui/react-slider';
import { useDoubleClick } from '@zattoo/use-double-click';
import type { clickEvent } from '@zattoo/use-double-click';
import { cn } from '../../utils';

type clickEvent = (event: React.MouseEvent<HTMLButtonElement>) => void;

interface SliderProps extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {
doubleClickHandler?: clickEvent;
}
Expand All @@ -23,7 +20,7 @@ const Slider = React.forwardRef<React.ElementRef<typeof SliderPrimitive.Root>, S
</SliderPrimitive.Track>
<SliderPrimitive.Thumb
onClick={
useDoubleClick(doubleClickHandler) ??
useDoubleClick(doubleClickHandler as clickEvent) ??
(() => {
return;
})
Expand Down

0 comments on commit 002bba2

Please sign in to comment.