From 98c299e8d3287a80f9c847cb00b6f79e5f65ca73 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Sat, 23 Sep 2023 12:51:07 +0000 Subject: [PATCH 1/2] feat: Updated components/magicui/dot-pattern.tsx --- components/magicui/dot-pattern.tsx | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/components/magicui/dot-pattern.tsx b/components/magicui/dot-pattern.tsx index 83664c3..19be009 100644 --- a/components/magicui/dot-pattern.tsx +++ b/components/magicui/dot-pattern.tsx @@ -12,17 +12,18 @@ interface DotPatternProps { className?: string; [key: string]: any; } -export function DotPattern({ - width = 16, - height = 16, - x = 0, - y = 0, - cx = 1, - cy = 1, - cr = 1, - className, - ...props -}: DotPatternProps) { +const DotPattern = (props: DotPatternProps) => { + const { + width = 16, + height = 16, + x = 0, + y = 0, + cx = 1, + cy = 1, + cr = 1, + className, + ...restProps + } = props; const id = useId(); return ( @@ -32,7 +33,7 @@ export function DotPattern({ "pointer-events-none absolute inset-0 h-full w-full fill-gray-400/40", className )} - {...props} + {...restProps} > ); -} +}; + +export default DotPattern; export default DotPattern; From 864cefd79f5d427a7d59361774e216044fb7e204 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Sat, 23 Sep 2023 12:58:11 +0000 Subject: [PATCH 2/2] feat: Updated lib/hooks/use-toast.ts --- lib/hooks/use-toast.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/hooks/use-toast.ts b/lib/hooks/use-toast.ts index 90d8959..166bcbd 100644 --- a/lib/hooks/use-toast.ts +++ b/lib/hooks/use-toast.ts @@ -169,24 +169,26 @@ function toast({ ...props }: Toast) { } } -function useToast() { - const [state, setState] = React.useState(memoryState) +const useToast = () => { + const [state, setState] = React.useState(memoryState); React.useEffect(() => { - listeners.push(setState) + listeners.push(setState); return () => { - const index = listeners.indexOf(setState) + const index = listeners.indexOf(setState); if (index > -1) { - listeners.splice(index, 1) + listeners.splice(index, 1); } - } - }, [state]) + }; + }, [state]); return { ...state, toast, dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }), - } -} + }; +}; + +export default useToast; export { useToast, toast }