UNPKG

rn-toastify

Version:

A professional, production-ready toast notification library for React Native. Featuring smooth spring animations, swipe-to-dismiss gestures, progress bars, queue management, and a beautiful design system with light/dark themes.

23 lines (20 loc) 717 B
import React from 'react'; import BaseToast from './BaseToast'; import { CrossIcon } from './icons'; import { TOAST_COLORS, TOAST_DEFAULTS } from '../utils/theme'; const ErrorToast = ({ title, message, theme = 'light', duration }) => { const isDark = theme === 'dark'; const colors = TOAST_COLORS.error; return ( <BaseToast icon={<CrossIcon size={TOAST_DEFAULTS.iconSize} color={isDark ? colors.iconDark : colors.icon} />} title={title || null} message={message || null} accentColor={colors.accent} toastType="error" theme={theme} duration={duration} /> ); }; export default React.memo(ErrorToast);