mirror of
https://github.com/Noooste/garage-ui.git
synced 2026-09-01 17:58:25 +00:00
chore(deps): upgraded react-router-dom to 8.3.0
This commit is contained in:
@@ -30,5 +30,3 @@ export interface BadgeProps
|
||||
export function Badge({ className, variant, ...props }: BadgeProps) {
|
||||
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
||||
}
|
||||
|
||||
export { badgeVariants };
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Link } from 'react-router';
|
||||
import { ChevronRight } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
|
||||
@@ -52,4 +52,4 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
);
|
||||
Button.displayName = 'Button';
|
||||
|
||||
export { Button, buttonVariants };
|
||||
export { Button };
|
||||
|
||||
@@ -40,7 +40,13 @@ export function DangerousConfirmDialog({
|
||||
onConfirm,
|
||||
}: DangerousConfirmDialogProps) {
|
||||
const [value, setValue] = React.useState('');
|
||||
React.useEffect(() => { if (!open) setValue(''); }, [open]);
|
||||
|
||||
// Clear the field when the dialog closes (adjust-during-render, not an effect).
|
||||
const [wasOpen, setWasOpen] = React.useState(open);
|
||||
if (open !== wasOpen) {
|
||||
setWasOpen(open);
|
||||
if (!open) setValue('');
|
||||
}
|
||||
|
||||
const matches = value === confirmationText;
|
||||
|
||||
|
||||
@@ -65,9 +65,12 @@ const Select = React.forwardRef<HTMLButtonElement, SelectProps>(
|
||||
return currentValue;
|
||||
}, [value, internalValue, children, placeholder]);
|
||||
|
||||
React.useEffect(() => {
|
||||
// Track the controlled value in internal state (adjust-during-render).
|
||||
const [prevValue, setPrevValue] = React.useState(value);
|
||||
if (value !== prevValue) {
|
||||
setPrevValue(value);
|
||||
setInternalValue(value);
|
||||
}, [value]);
|
||||
}
|
||||
|
||||
// The popup is portalled to the body so an ancestor with overflow-hidden
|
||||
// (a dialog card, a scroll container) cannot clip it.
|
||||
|
||||
Reference in New Issue
Block a user