Set all toast to destruct except error popups

This commit is contained in:
2025-08-05 00:51:28 +03:00
parent 7dbb224642
commit 925da2ecff
9 changed files with 17 additions and 6 deletions

View File

@@ -61,7 +61,7 @@ export function AdminDashboard({ token, onLogout }: AdminDashboardProps) {
}
toast({
variant: type === "error" ? "destructive" : "default",
variant: type === "error" ? "default" : "destructive",
title: type === "error" ? "Error" : "Warning",
description: error,
})

View File

@@ -117,7 +117,7 @@ export function AdminsSection({ admins, apiClient, onAdminsUpdate }: AdminsSecti
onAdminsUpdate(updatedAdmins)
toast({
variant: "default",
variant: "destructive",
title: "Admin Deleted",
description: "Admin account deleted successfully!",
})
@@ -130,7 +130,7 @@ export function AdminsSection({ admins, apiClient, onAdminsUpdate }: AdminsSecti
onAdminsUpdate([...admins, admin])
toast({
variant: "default",
variant: "destructive",
title: "Admin Added",
description: "Admin account added successfully!",
})

View File

@@ -49,7 +49,7 @@ export function ChangePasswordDialog({ admin, apiClient, onClose }: ChangePasswo
onClose()
toast({
variant: "default",
variant: "destructive",
title: "Admin Updated",
description: "Admin account password updated successfully!",
})

View File

@@ -95,6 +95,7 @@ export function AddItemDrawer({ table, apiClient, open, onClose, onItemAdded }:
onClose()
toast({
variant: "destructive",
title: "Table Created",
description: `A table ${table.name} has been created successfully.`,
})
@@ -225,9 +226,9 @@ export function AddItemDrawer({ table, apiClient, open, onClose, onItemAdded }:
<DrawerDescription>Create a new record in {table.name} table</DrawerDescription>
</DrawerHeader>
<div className="flex-1 overflow-hidden">
<div className="flex-1 overflow-auto">
<ScrollArea className="h-full">
<div className="p-6 space-y-6">
<div className="p-6 space-y-6 pb-64">
<div className="text-sm text-muted-foreground">
Autogenerated fields for <Badge variant="default" className="text-sm mr-2">
{table.name}
@@ -299,6 +300,10 @@ export function AddItemDrawer({ table, apiClient, open, onClose, onItemAdded }:
<Input
id={field.name}
type="datetime-local"
onFocus={(e) => {
// scroll parent container into view
e.target.scrollIntoView({ behavior: "auto", block: "center" });
}}
value={formatDateForInput(formData[field.name])}
onChange={(e) => handleFieldChange(field.name, e.target.value)}
disabled={(field.type === "view" || isSystemGeneratedField(field))}

View File

@@ -170,6 +170,7 @@ export function AddTableDialog({ apiClient, onTablesUpdate, children }: AddTable
setOpen(false)
toast({
variant: "destructive",
title: "Table Created",
description: `The table '${tableData.name}' been updated successfully.`,
})

View File

@@ -63,6 +63,7 @@ export function DatabaseSection({ apiClient, tables, onTablesUpdate }: DatabaseS
onTablesUpdate(updatedTables)
toast({
variant: "destructive",
title: "Table Deleted",
description: "Table deleted successfully!",
})

View File

@@ -57,6 +57,7 @@ export function EditItemDrawer({ table, item, apiClient, open, onClose, onItemUp
onClose()
toast({
variant: "destructive",
title: "Table Updated",
description: "Table data has been updated successfully.",
})

View File

@@ -132,6 +132,7 @@ export function TableConfigDrawer({ table, apiClient, open, onClose, onTableUpda
onTableUpdate(updatedTable)
toast({
variant: "destructive",
title: "Table Updated",
description: "Table fields updated successfully.",
})
@@ -162,6 +163,7 @@ export function TableConfigDrawer({ table, apiClient, open, onClose, onTableUpda
onTableUpdate(updatedTable)
toast({
variant: "destructive",
title: "Table Updated",
description: "Table access rules updated successfully!",
})

View File

@@ -74,6 +74,7 @@ export function SettingsSection({ apiClient, settings, onSettingsUpdate, onModeC
setHasChanges(false)
toast({
variant: "destructive",
title: "Settings Saved",
description: "Application settings have been updated successfully.",
})