NORY-47: fix alert dialog action styling
This commit is contained in:
parent
6edf6ee1b3
commit
e6b9095454
3 changed files with 26 additions and 31 deletions
|
@ -15,7 +15,7 @@ import {
|
|||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from '@/components/ui/dropdown-menu';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Button, buttonVariants } from '@/components/ui/button';
|
||||
import Link from 'next/link';
|
||||
import { toast } from 'sonner';
|
||||
import {
|
||||
|
@ -259,12 +259,14 @@ export function IdentityDataTable({ data, pageSize, pageToken, query, fetchIdent
|
|||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogAction onClick={() => deleteIdentitySessions(currentIdentity.id)}>
|
||||
Invalidate sessions
|
||||
</AlertDialogAction>
|
||||
<AlertDialogCancel>
|
||||
Cancel
|
||||
</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
className={buttonVariants({ variant: 'destructive' })}
|
||||
onClick={() => deleteIdentitySessions(currentIdentity.id)}>
|
||||
Invalidate sessions
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
|
@ -280,13 +282,13 @@ export function IdentityDataTable({ data, pageSize, pageToken, query, fetchIdent
|
|||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>
|
||||
Cancel
|
||||
</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
onClick={() => blockIdentity(currentIdentity.id)}>
|
||||
Block identity
|
||||
</AlertDialogAction>
|
||||
<AlertDialogCancel>
|
||||
Cancel
|
||||
</AlertDialogCancel>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
|
@ -302,13 +304,13 @@ export function IdentityDataTable({ data, pageSize, pageToken, query, fetchIdent
|
|||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>
|
||||
Cancel
|
||||
</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
onClick={() => unblockIdentity(currentIdentity.id)}>
|
||||
Unblock identity
|
||||
</AlertDialogAction>
|
||||
<AlertDialogCancel>
|
||||
Cancel
|
||||
</AlertDialogCancel>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
|
@ -325,13 +327,14 @@ export function IdentityDataTable({ data, pageSize, pageToken, query, fetchIdent
|
|||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogAction
|
||||
onClick={() => deleteIdentity(currentIdentity.id)}>
|
||||
Delete identity
|
||||
</AlertDialogAction>
|
||||
<AlertDialogCancel>
|
||||
Cancel
|
||||
</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
className={buttonVariants({ variant: 'destructive' })}
|
||||
onClick={() => deleteIdentity(currentIdentity.id)}>
|
||||
Delete identity
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import { Button, ButtonProps } from '@/components/ui/button';
|
||||
import { ButtonProps, buttonVariants } from '@/components/ui/button';
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
|
@ -23,9 +23,8 @@ interface ButtonWithConfirmDialogProps {
|
|||
dialogTitle: string
|
||||
dialogDescription: string
|
||||
dialogButtonCancel?: string
|
||||
dialogButtonCancelProps?: ButtonProps
|
||||
dialogButtonSubmit?: string
|
||||
dialogButtonSubmitProps?: ButtonProps
|
||||
dialogButtonSubmitProps?: typeof buttonVariants
|
||||
children: ReactNode
|
||||
}
|
||||
|
||||
|
@ -37,7 +36,6 @@ export function ConfirmationDialogWrapper(
|
|||
dialogTitle,
|
||||
dialogDescription,
|
||||
dialogButtonCancel,
|
||||
dialogButtonCancelProps,
|
||||
dialogButtonSubmit,
|
||||
dialogButtonSubmitProps,
|
||||
children,
|
||||
|
@ -59,19 +57,13 @@ export function ConfirmationDialogWrapper(
|
|||
<AlertDialogDescription>{dialogDescription}</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel asChild>
|
||||
<Button
|
||||
onClick={onCancel}
|
||||
{...dialogButtonCancelProps}>
|
||||
{dialogButtonCancel ?? 'Cancel'}
|
||||
</Button>
|
||||
<AlertDialogCancel onClick={onCancel}>
|
||||
{dialogButtonCancel ?? 'Cancel'}
|
||||
</AlertDialogCancel>
|
||||
<AlertDialogAction asChild>
|
||||
<Button
|
||||
onClick={onSubmit}
|
||||
{...dialogButtonSubmitProps}>
|
||||
{dialogButtonSubmit ?? 'Confirm'}
|
||||
</Button>
|
||||
<AlertDialogAction
|
||||
onClick={onSubmit}
|
||||
className={buttonVariants({ ...dialogButtonSubmitProps })}>
|
||||
{dialogButtonSubmit ?? 'Confirm'}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
|
|
|
@ -104,7 +104,7 @@ const AlertDialogAction = React.forwardRef<
|
|||
>(({ className, ...props }, ref) => (
|
||||
<AlertDialogPrimitive.Action
|
||||
ref={ref}
|
||||
className={className}
|
||||
className={(cn(buttonVariants(), className))}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
|
|
Loading…
Add table
Reference in a new issue