Skip to content

feat(ui): Toast Notification System - Bounty #825#1011

Open
yw13931835525-cyber wants to merge 1 commit intoSolFoundry:mainfrom
yw13931835525-cyber:feature/toast-notification-v2
Open

feat(ui): Toast Notification System - Bounty #825#1011
yw13931835525-cyber wants to merge 1 commit intoSolFoundry:mainfrom
yw13931835525-cyber:feature/toast-notification-v2

Conversation

@yw13931835525-cyber
Copy link
Copy Markdown

Bounty: Toast Notification System (#825)

Reward: 150,000 FNDRY

Summary

Implements a reusable toast notification system with React Context and Framer Motion.

Features

  • ToastProvider — Context provider managing toast state and auto-dismiss timers
  • useToast hook — Clean API for triggering toasts from any component
  • 4 variants — success (emerald), error (red), warning (amber), info (blue) with unique Lucide icons
  • Auto-dismiss — 5 second countdown with animated progress bar
  • Slide-in animation — Top-right entry using Framer Motion spring physics
  • Stacking — Multiple toasts stack vertically with popLayout mode
  • Accessible — role="alert", aria-live="assertive", aria-atomic="true"
  • Manual close — X button on each toast for instant dismissal

Usage

import { ToastProvider, useToast } from "../components/Toast";

// Wrap app with ToastProvider (in main.tsx or App.tsx)
// <ToastProvider>...</ToastProvider>

// In any component:
const { showToast } = useToast();
showToast("Bounty claimed successfully!", "success");
showToast("Connection failed", "error");

Files Changed

  • frontend/src/components/Toast.tsx — Full implementation
  • frontend/src/hooks/useToast.ts — Hook export

Closes #825

Implements a reusable toast notification system with context provider and hook.

- ToastProvider with useToast hook for global toast state
- 4 variants: success, error, warning, info with unique icons
- Auto-dismiss with 5s progress bar animation
- Slide-in animation from top-right with Framer Motion
- Stack multiple toasts properly
- Accessible (role='alert', aria-live='assertive')
- Manual close button on each toast

Closes SolFoundry#825
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🏭 Bounty T1: Toast Notification System

1 participant