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.
24 lines (20 loc) • 730 B
JavaScript
import React from 'react';
import BaseToast from './BaseToast';
import { WarningIcon } from './icons';
import { TOAST_COLORS, TOAST_DEFAULTS } from '../utils/theme';
const WarningToast = ({ title, message, theme = 'light', duration }) => {
const isDark = theme === 'dark';
const colors = TOAST_COLORS.warning;
return (
<BaseToast
icon={<WarningIcon size={TOAST_DEFAULTS.iconSize} color={isDark ? colors.iconDark : colors.icon} />}
title={title || null}
message={message || null}
accentColor={colors.accent}
toastType="warning"
theme={theme}
duration={duration}
/>
);
};
export default React.memo(WarningToast);