Skip to content

Commit

Permalink
feat: update toast message level to success and enhance styling for i…
Browse files Browse the repository at this point in the history
…mproved user feedback
  • Loading branch information
drikusroor committed Jan 7, 2025
1 parent 1ddb626 commit efa2132
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const ExperimentForm: React.FC<ExperimentFormProps> = () => {
addToast({
message: "Experiment saved successfully!",
duration: 3000,
level: "info"
level: "success"
});
} catch (err) {
addToast({
Expand Down Expand Up @@ -161,10 +161,6 @@ const ExperimentForm: React.FC<ExperimentFormProps> = () => {
</Button>

<form onSubmit={handleSubmit} className="bg-white shadow-md rounded p-5 space-y-5 max-w-5xl">
{error && <div className="text-red-600 mb-4">{error}</div>}
{success && <div className="text-green-600 mb-4">Saved successfully!</div>}
{saveError && <div className="text-red-600 mb-4">{saveError}</div>}

<div className="space-y-5">
<FormField label="Slug">
<Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface ToastProps {
export const Toast: React.FC<ToastProps> = ({ toast }) => {
const bgColorClass = {
info: 'bg-gray-800',
success: 'bg-green-600',
warning: 'bg-yellow-600',
error: 'bg-red-600'
}[toast.level];
Expand Down

0 comments on commit efa2132

Please sign in to comment.