@mehul214/react-native-flash-toast 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +251 -2
- package/dist/index.d.mts +240 -0
- package/dist/index.d.ts +242 -0
- package/dist/index.js +749 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +730 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +87 -4
- package/src/FlashMessage.tsx +436 -0
- package/src/FlashMessageManager.ts +71 -0
- package/src/FlashMessageProvider.tsx +48 -0
- package/src/hooks/useFlashMessage.ts +2 -0
- package/src/icons.tsx +154 -0
- package/src/index.ts +31 -0
- package/src/styles.ts +145 -0
- package/src/types.ts +101 -0
- package/src/utils/safeArea.ts +45 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/FlashMessageManager.ts","../src/icons.tsx","../src/styles.ts","../src/utils/safeArea.ts","../src/FlashMessage.tsx","../src/FlashMessageProvider.tsx","../src/index.ts"],"names":["styles","StyleSheet","Platform","jsx","View","jsxs"],"mappings":";;;;;;;AAEA,IAAM,sBAAN,MAA0B;AAAA,EAA1B,WAAA,GAAA;AACE,IAAA,IAAA,CAAQ,eAAA,GAA0C,IAAA;AAClD,IAAA,IAAA,CAAQ,SAAA,uBAA8C,GAAA,EAAI;AAC1D,IAAA,IAAA,CAAQ,eAAsC,EAAC;AAAA,EAAA;AAAA,EAExC,QAAA,CAAS,GAAA,EAAsB,EAAA,GAAa,SAAA,EAAiB;AAClE,IAAA,IAAA,CAAK,SAAA,CAAU,GAAA,CAAI,EAAA,EAAI,GAAG,CAAA;AAC1B,IAAA,IAAI,CAAC,IAAA,CAAK,eAAA,IAAmB,EAAA,KAAO,SAAA,EAAW;AAC7C,MAAA,IAAA,CAAK,eAAA,GAAkB,GAAA;AAAA,IACzB;AAGA,IAAA,IAAI,IAAA,CAAK,YAAA,CAAa,MAAA,GAAS,CAAA,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,EAApB,EAA6B,OAAO,YAAA,EAClC,QAAA,EAAA;AAAA,IAAA,QAAA;AAAA,oBACDF,GAAAA,CAAC,YAAA,EAAA,EAAc,GAAG,cAAA,EAAgB;AAAA,GAAA,EACpC,CAAA;AAEJ;AAEO,SAAS,eAAA,GAA4C;AAC1D,EAAA,MAAM,OAAA,GAAU,WAAW,mBAAmB,CAAA;AAC9C,EAAA,IAAI,CAAC,OAAA,EAAS;AAEZ,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,CAAC,OAAA,KAAiC,YAAA,CAAa,YAAY,OAAO,CAAA;AAAA,MACxE,IAAA,EAAM,MAAM,YAAA,CAAa,WAAA;AAAY,KACvC;AAAA,EACF;AACA,EAAA,OAAO,OAAA;AACT;;;AC3CA,IAAO,aAAA,GAAQ","file":"index.mjs","sourcesContent":["import type { FlashMessageOptions, FlashMessageRef } from './types';\n\nclass FlashMessageManager {\n private defaultInstance: FlashMessageRef | null = null;\n private instances: Map<string, FlashMessageRef> = new Map();\n private pendingQueue: FlashMessageOptions[] = [];\n\n public register(ref: FlashMessageRef, id: string = 'default'): void {\n this.instances.set(id, ref);\n if (!this.defaultInstance || id === 'default') {\n this.defaultInstance = ref;\n }\n\n // Flush any pending messages that arrived before mount\n if (this.pendingQueue.length > 0) {\n const next = this.pendingQueue.shift();\n if (next) {\n ref.showMessage(next);\n }\n }\n }\n\n public unregister(id: string = 'default'): void {\n this.instances.delete(id);\n if (this.defaultInstance === this.instances.get(id)) {\n this.defaultInstance = this.instances.values().next().value || null;\n }\n }\n\n public showMessage(options: FlashMessageOptions, targetId?: string): void {\n const target = targetId ? this.instances.get(targetId) : this.defaultInstance;\n\n if (target) {\n target.showMessage(options);\n } else {\n // Buffer if component hasn't mounted yet\n this.pendingQueue.push(options);\n }\n }\n\n public hideMessage(targetId?: string): void {\n const target = targetId ? this.instances.get(targetId) : this.defaultInstance;\n if (target) {\n target.hideMessage();\n }\n }\n}\n\nexport const flashManager = new FlashMessageManager();\n\n/**\n * Imperative helper to trigger a flash message from anywhere in the app\n * (services, Zustand, Redux, API handlers, navigation screens).\n */\nexport function showMessage(options: FlashMessageOptions): void {\n flashManager.showMessage(options);\n}\n\n/**\n * Imperative helper to dismiss the currently displayed flash message.\n */\nexport function hideMessage(): void {\n flashManager.hideMessage();\n}\n\n/**\n * Modern alias for showMessage\n */\nexport const flash = showMessage;\nexport const dismissFlash = hideMessage;\n\n","import React from 'react';\nimport { View, StyleSheet } from 'react-native';\nimport type { FlashMessageType } from './types';\n\ninterface BuiltInIconProps {\n type: FlashMessageType;\n size?: number;\n color?: string;\n}\n\nexport const BuiltInIcon: React.FC<BuiltInIconProps> = ({\n type,\n size = 18,\n color = '#FFFFFF',\n}) => {\n switch (type) {\n case 'success': {\n // Crisp pixel-perfect checkmark\n const checkWidth = size * 0.36;\n const checkHeight = size * 0.65;\n const stroke = Math.max(2, size * 0.12);\n return (\n <View style={[styles.center, { width: size, height: size }]}>\n <View\n style={{\n width: checkWidth,\n height: checkHeight,\n borderColor: color,\n borderBottomWidth: stroke,\n borderRightWidth: stroke,\n borderRadius: 1,\n transform: [{ rotate: '45deg' }, { translateY: -size * 0.08 }],\n }}\n />\n </View>\n );\n }\n\n case 'danger': {\n // Crisp pixel-perfect cross\n const crossThickness = Math.max(2, size * 0.12);\n const crossLength = size * 0.72;\n return (\n <View style={[styles.center, { width: size, height: size }]}>\n <View\n style={[\n styles.crossBar,\n {\n width: crossLength,\n height: crossThickness,\n backgroundColor: color,\n borderRadius: crossThickness / 2,\n transform: [{ rotate: '45deg' }],\n },\n ]}\n />\n <View\n style={[\n styles.crossBar,\n {\n width: crossLength,\n height: crossThickness,\n backgroundColor: color,\n borderRadius: crossThickness / 2,\n transform: [{ rotate: '-45deg' }],\n },\n ]}\n />\n </View>\n );\n }\n\n case 'warning': {\n // Modern clean exclamation mark\n const warnThickness = Math.max(2, size * 0.13);\n const dotSize = warnThickness * 1.1;\n return (\n <View style={[styles.center, { width: size, height: size }]}>\n <View\n style={{\n width: warnThickness,\n height: size * 0.46,\n backgroundColor: color,\n borderRadius: warnThickness / 2,\n marginBottom: size * 0.14,\n }}\n />\n <View\n style={{\n width: dotSize,\n height: dotSize,\n borderRadius: dotSize / 2,\n backgroundColor: color,\n }}\n />\n </View>\n );\n }\n\n case 'info': {\n // Modern clean info icon: top dot, bottom stem (no double circle!)\n const infoThickness = Math.max(2, size * 0.13);\n const infoDotSize = infoThickness * 1.1;\n return (\n <View style={[styles.center, { width: size, height: size }]}>\n <View\n style={{\n width: infoDotSize,\n height: infoDotSize,\n borderRadius: infoDotSize / 2,\n backgroundColor: color,\n marginBottom: size * 0.14,\n }}\n />\n <View\n style={{\n width: infoThickness,\n height: size * 0.46,\n backgroundColor: color,\n borderRadius: infoThickness / 2,\n }}\n />\n </View>\n );\n }\n\n case 'default':\n default: {\n const defaultDot = size * 0.44;\n return (\n <View style={[styles.center, { width: size, height: size }]}>\n <View\n style={{\n width: defaultDot,\n height: defaultDot,\n borderRadius: defaultDot / 2,\n backgroundColor: color,\n }}\n />\n </View>\n );\n }\n }\n};\n\nconst styles = StyleSheet.create({\n center: {\n justifyContent: 'center',\n alignItems: 'center',\n },\n crossBar: {\n position: 'absolute',\n },\n});\n","import { StyleSheet, Platform } from 'react-native';\nimport type { FlashMessageType } from './types';\n\nexport const COLORS: Record<FlashMessageType, { background: string; text: string; icon: string }> = {\n default: {\n background: '#1F2937', // Slate 800\n text: '#FFFFFF',\n icon: '#9CA3AF',\n },\n success: {\n background: '#059669', // Emerald 600\n text: '#FFFFFF',\n icon: '#D1FAE5',\n },\n danger: {\n background: '#DC2626', // Red 600\n text: '#FFFFFF',\n icon: '#FEE2E2',\n },\n warning: {\n background: '#D97706', // Amber 600\n text: '#FFFFFF',\n icon: '#FEF3C7',\n },\n info: {\n background: '#2563EB', // Blue 600\n text: '#FFFFFF',\n icon: '#DBEAFE',\n },\n};\n\nexport const styles = StyleSheet.create({\n rootOverlay: {\n position: 'absolute',\n left: 0,\n right: 0,\n zIndex: 99999,\n elevation: 99999,\n },\n rootTop: {\n top: 0,\n },\n rootBottom: {\n bottom: 0,\n },\n rootCenter: {\n top: 0,\n bottom: 0,\n justifyContent: 'center',\n alignItems: 'center',\n },\n toastContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n overflow: 'hidden',\n ...Platform.select({\n ios: {\n shadowColor: '#000000',\n shadowOffset: { width: 0, height: 6 },\n shadowOpacity: 0.2,\n shadowRadius: 14,\n },\n android: {\n elevation: 8,\n },\n web: {\n boxShadow: '0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15)',\n } as any,\n }),\n },\n floatingContainer: {\n marginHorizontal: 16,\n borderRadius: 16,\n borderWidth: 1,\n borderColor: 'rgba(255, 255, 255, 0.16)',\n },\n edgeToEdgeContainer: {\n marginHorizontal: 0,\n borderRadius: 0,\n },\n contentWrapper: {\n flex: 1,\n flexDirection: 'row',\n alignItems: 'center',\n paddingVertical: 13,\n paddingHorizontal: 16,\n },\n iconContainer: {\n marginRight: 12,\n justifyContent: 'center',\n alignItems: 'center',\n },\n iconBadge: {\n width: 32,\n height: 32,\n borderRadius: 16,\n backgroundColor: 'rgba(255, 255, 255, 0.22)',\n justifyContent: 'center',\n alignItems: 'center',\n },\n textContainer: {\n flex: 1,\n justifyContent: 'center',\n },\n titleText: {\n fontSize: 15,\n fontWeight: '600',\n letterSpacing: -0.2,\n lineHeight: 20,\n color: '#FFFFFF',\n },\n descriptionText: {\n fontSize: 13,\n fontWeight: '400',\n color: 'rgba(255, 255, 255, 0.9)',\n marginTop: 2,\n lineHeight: 18,\n },\n actionButton: {\n marginLeft: 12,\n paddingHorizontal: 12,\n paddingVertical: 6,\n borderRadius: 8,\n backgroundColor: 'rgba(255, 255, 255, 0.22)',\n borderWidth: 1,\n borderColor: 'rgba(255, 255, 255, 0.2)',\n },\n actionButtonText: {\n fontSize: 13,\n fontWeight: '600',\n color: '#FFFFFF',\n },\n progressBarContainer: {\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n height: 3,\n backgroundColor: 'rgba(255, 255, 255, 0.2)',\n },\n progressBarFill: {\n height: '100%',\n backgroundColor: 'rgba(255, 255, 255, 0.9)',\n },\n});\n","import { Platform, StatusBar, Dimensions } from 'react-native';\n\nexport interface EdgeInsets {\n top: number;\n bottom: number;\n left: number;\n right: number;\n}\n\n/**\n * Returns safe default insets when react-native-safe-area-context is not present.\n * If the user's app wraps FlashMessage in SafeAreaProvider, safe-area context takes precedence.\n */\nexport function getDefaultSafeAreaInsets(): EdgeInsets {\n const { width, height } = Dimensions.get('window');\n const isLandscape = width > height;\n\n if (Platform.OS === 'android') {\n return {\n top: StatusBar.currentHeight ?? 24,\n bottom: 16,\n left: 0,\n right: 0,\n };\n }\n\n if (Platform.OS === 'ios') {\n // Dynamic island & modern notch iPhones typically have 47-59pt top inset\n const isModernIphone = !Platform.isPad && !Platform.isTV && (height >= 812 || width >= 812);\n return {\n top: isModernIphone ? (isLandscape ? 0 : 50) : 20,\n bottom: isModernIphone ? 34 : 0,\n left: 0,\n right: 0,\n };\n }\n\n return {\n top: 16,\n bottom: 16,\n left: 0,\n right: 0,\n };\n}\n\n","import React, {\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport {\n Animated,\n PanResponder,\n Pressable,\n Text,\n View,\n} from 'react-native';\nimport { flashManager } from './FlashMessageManager';\nimport { BuiltInIcon } from './icons';\nimport { COLORS, styles } from './styles';\nimport type {\n FlashMessageContainerProps,\n FlashMessageOptions,\n FlashMessageRef,\n} from './types';\nimport { getDefaultSafeAreaInsets } from './utils/safeArea';\n\nexport const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContainerProps>(\n (props, ref) => {\n const {\n position: defaultPosition = 'top',\n duration: defaultDuration = 3000,\n floating: defaultFloating = true,\n statusBarOffset,\n bottomOffset,\n style: containerCustomStyle,\n } = props;\n\n const [currentMessage, setCurrentMessage] = useState<FlashMessageOptions | null>(null);\n const [isVisible, setIsVisible] = useState(false);\n\n // Keep active message in a mutable ref so callbacks always access the latest values without re-creating functions\n const currentMessageRef = useRef<FlashMessageOptions | null>(null);\n\n // Animation values\n const translateY = useRef(new Animated.Value(-150)).current;\n const opacity = useRef(new Animated.Value(0)).current;\n const progress = useRef(new Animated.Value(1)).current;\n\n // Timers & gesture tracking\n const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const progressAnimationRef = useRef<Animated.CompositeAnimation | null>(null);\n const remainingTimeRef = useRef<number>(0);\n const timerStartedAtRef = useRef<number>(0);\n\n const safeInsets = getDefaultSafeAreaInsets();\n\n const clearTimers = useCallback(() => {\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = null;\n }\n if (progressAnimationRef.current) {\n progressAnimationRef.current.stop();\n progressAnimationRef.current = null;\n }\n }, []);\n\n const animateHide = useCallback(\n (callback?: () => void) => {\n clearTimers();\n\n const pos = currentMessageRef.current?.position ?? defaultPosition;\n const targetY = pos === 'top' ? -180 : pos === 'bottom' ? 180 : 0;\n\n Animated.parallel([\n Animated.timing(translateY, {\n toValue: targetY,\n duration: 220,\n useNativeDriver: true,\n }),\n Animated.timing(opacity, {\n toValue: 0,\n duration: 200,\n useNativeDriver: true,\n }),\n ]).start(() => {\n setIsVisible(false);\n const onHide = currentMessageRef.current?.onHide;\n currentMessageRef.current = null;\n setCurrentMessage(null);\n if (onHide) {\n onHide();\n }\n callback?.();\n });\n },\n [clearTimers, defaultPosition, opacity, translateY]\n );\n\n const startAutoHideTimer = useCallback(\n (durationMs: number) => {\n clearTimers();\n if (durationMs <= 0) return;\n\n remainingTimeRef.current = durationMs;\n timerStartedAtRef.current = Date.now();\n\n // Start progress bar animation\n progress.setValue(1);\n progressAnimationRef.current = Animated.timing(progress, {\n toValue: 0,\n duration: durationMs,\n useNativeDriver: false,\n });\n progressAnimationRef.current.start();\n\n hideTimeoutRef.current = setTimeout(() => {\n animateHide();\n }, durationMs);\n },\n [animateHide, clearTimers, progress]\n );\n\n const pauseTimer = useCallback(() => {\n if (hideTimeoutRef.current && timerStartedAtRef.current > 0) {\n clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = null;\n const elapsed = Date.now() - timerStartedAtRef.current;\n remainingTimeRef.current = Math.max(0, remainingTimeRef.current - elapsed);\n if (progressAnimationRef.current) {\n progressAnimationRef.current.stop();\n }\n }\n }, []);\n\n const resumeTimer = useCallback(() => {\n if (remainingTimeRef.current > 0) {\n startAutoHideTimer(remainingTimeRef.current);\n }\n }, [startAutoHideTimer]);\n\n const show = useCallback(\n (options: FlashMessageOptions) => {\n clearTimers();\n currentMessageRef.current = options;\n setCurrentMessage(options);\n setIsVisible(true);\n\n const pos = options.position ?? defaultPosition;\n const initialY = pos === 'top' ? -150 : pos === 'bottom' ? 150 : 0;\n\n translateY.setValue(initialY);\n opacity.setValue(0);\n progress.setValue(1);\n\n Animated.parallel([\n Animated.spring(translateY, {\n toValue: 0,\n tension: 70,\n friction: 9,\n useNativeDriver: true,\n }),\n Animated.timing(opacity, {\n toValue: 1,\n duration: 200,\n useNativeDriver: true,\n }),\n ]).start(() => {\n if (options.onShow) {\n options.onShow();\n }\n });\n\n const shouldAutoHide = options.autoHide ?? true;\n const dur = shouldAutoHide\n ? options.duration !== undefined\n ? options.duration\n : defaultDuration\n : 0;\n\n if (dur > 0) {\n startAutoHideTimer(dur);\n }\n },\n [clearTimers, defaultDuration, defaultPosition, opacity, progress, startAutoHideTimer, translateY]\n );\n\n // Mutable ref wrappers so external callers always invoke the latest logic\n const showRef = useRef(show);\n const animateHideRef = useRef(animateHide);\n showRef.current = show;\n animateHideRef.current = animateHide;\n\n // Register with imperative ref\n useImperativeHandle(\n ref,\n () => ({\n showMessage: (options: FlashMessageOptions) => showRef.current(options),\n hideMessage: () => animateHideRef.current(),\n }),\n []\n );\n\n // Register with manager ON MOUNT only; only clean up on UNMOUNT\n useEffect(() => {\n const instanceRef: FlashMessageRef = {\n showMessage: (options: FlashMessageOptions) => showRef.current(options),\n hideMessage: () => animateHideRef.current(),\n };\n flashManager.register(instanceRef);\n return () => {\n flashManager.unregister();\n clearTimers();\n };\n }, [clearTimers]);\n\n // PanResponder for smooth swipe-to-dismiss gesture\n const panResponder = useRef(\n PanResponder.create({\n onStartShouldSetPanResponder: () => false,\n onMoveShouldSetPanResponder: (_, gestureState) => {\n const swipeEnabled = currentMessageRef.current?.swipeToDismiss ?? true;\n return swipeEnabled && Math.abs(gestureState.dy) > 8;\n },\n onPanResponderGrant: () => {\n if (currentMessageRef.current?.pauseOnPress ?? true) {\n pauseTimer();\n }\n },\n onPanResponderMove: (_, gestureState) => {\n if (!(currentMessageRef.current?.swipeToDismiss ?? true)) return;\n const pos = currentMessageRef.current?.position ?? defaultPosition;\n\n if (pos === 'top' && gestureState.dy < 0) {\n translateY.setValue(gestureState.dy);\n } else if (pos === 'bottom' && gestureState.dy > 0) {\n translateY.setValue(gestureState.dy);\n }\n },\n onPanResponderRelease: (_, gestureState) => {\n const pos = currentMessageRef.current?.position ?? defaultPosition;\n const swipeThreshold = 30;\n const isDismissGesture =\n (pos === 'top' && gestureState.dy < -swipeThreshold) ||\n (pos === 'bottom' && gestureState.dy > swipeThreshold);\n\n if (isDismissGesture && (currentMessageRef.current?.swipeToDismiss ?? true)) {\n animateHide();\n } else {\n Animated.spring(translateY, {\n toValue: 0,\n tension: 80,\n friction: 8,\n useNativeDriver: true,\n }).start();\n\n if (currentMessageRef.current?.pauseOnPress ?? true) {\n resumeTimer();\n }\n }\n },\n })\n ).current;\n\n if (!isVisible || !currentMessage) {\n return null;\n }\n\n const position = currentMessage.position ?? defaultPosition;\n const isTop = position === 'top';\n const isBottom = position === 'bottom';\n\n const type = currentMessage.type ?? 'default';\n const typeColors = COLORS[type];\n const backgroundColor = currentMessage.backgroundColor ?? typeColors.background;\n const textColor = currentMessage.color ?? typeColors.text;\n const floating = currentMessage.floating ?? defaultFloating;\n\n const topInset =\n currentMessage.statusBarHeight ??\n statusBarOffset ??\n (isTop ? safeInsets.top + (floating ? 8 : 0) : 0);\n\n const bottomInset =\n bottomOffset ?? (isBottom ? safeInsets.bottom + (floating ? 8 : 0) : 0);\n\n const rootPositionStyle = isTop\n ? [styles.rootTop, { paddingTop: topInset }]\n : isBottom\n ? [styles.rootBottom, { paddingBottom: bottomInset }]\n : styles.rootCenter;\n\n const renderIcon = () => {\n if (currentMessage.icon === 'none') return null;\n\n if (typeof currentMessage.icon === 'function') {\n return (\n <View style={styles.iconContainer}>\n <View style={styles.iconBadge}>\n {currentMessage.icon({ size: 18, color: textColor })}\n </View>\n </View>\n );\n }\n\n if (React.isValidElement(currentMessage.icon)) {\n return (\n <View style={styles.iconContainer}>\n <View style={styles.iconBadge}>{currentMessage.icon}</View>\n </View>\n );\n }\n\n const iconType = typeof currentMessage.icon === 'string' ? currentMessage.icon : type;\n return (\n <View style={styles.iconContainer}>\n <View style={styles.iconBadge}>\n <BuiltInIcon type={iconType as any} color={textColor} size={18} />\n </View>\n </View>\n );\n };\n\n const handlePress = () => {\n if (currentMessage.onPress) {\n currentMessage.onPress();\n }\n if (currentMessage.hideOnPress ?? true) {\n animateHide();\n }\n };\n\n const progressWidthInterpolation = progress.interpolate({\n inputRange: [0, 1],\n outputRange: ['0%', '100%'],\n });\n\n return (\n <View\n pointerEvents=\"box-none\"\n style={[styles.rootOverlay, rootPositionStyle, containerCustomStyle]}\n >\n <Animated.View\n {...panResponder.panHandlers}\n style={[\n styles.toastContainer,\n floating ? styles.floatingContainer : styles.edgeToEdgeContainer,\n { backgroundColor },\n currentMessage.style,\n {\n transform: [{ translateY }],\n opacity,\n },\n ]}\n >\n {currentMessage.customComponent ? (\n currentMessage.customComponent(currentMessage, () => animateHide())\n ) : (\n <Pressable\n onPress={handlePress}\n onPressIn={() => {\n if (currentMessage.pauseOnPress ?? true) {\n pauseTimer();\n }\n }}\n onPressOut={() => {\n if (currentMessage.pauseOnPress ?? true) {\n resumeTimer();\n }\n }}\n onLongPress={currentMessage.onLongPress}\n style={styles.contentWrapper}\n >\n {renderIcon()}\n\n <View style={styles.textContainer}>\n {typeof currentMessage.message === 'string' ? (\n <Text\n style={[styles.titleText, { color: textColor }, currentMessage.titleStyle]}\n numberOfLines={2}\n >\n {currentMessage.message}\n </Text>\n ) : (\n currentMessage.message\n )}\n\n {currentMessage.description ? (\n typeof currentMessage.description === 'string' ? (\n <Text\n style={[\n styles.descriptionText,\n { color: textColor },\n currentMessage.textStyle,\n ]}\n numberOfLines={3}\n >\n {currentMessage.description}\n </Text>\n ) : (\n currentMessage.description\n )\n ) : null}\n </View>\n\n {currentMessage.action ? (\n <Pressable\n onPress={() => {\n currentMessage.action?.onPress();\n animateHide();\n }}\n style={[styles.actionButton, currentMessage.action.style]}\n >\n <Text style={[styles.actionButtonText, currentMessage.action.textStyle]}>\n {currentMessage.action.label}\n </Text>\n </Pressable>\n ) : null}\n </Pressable>\n )}\n\n {currentMessage.showProgressBar && (\n <View style={styles.progressBarContainer}>\n <Animated.View\n style={[\n styles.progressBarFill,\n { width: progressWidthInterpolation },\n ]}\n />\n </View>\n )}\n </Animated.View>\n </View>\n );\n }\n);\n\nFlashMessage.displayName = 'FlashMessage';\n","import React, { createContext, useContext, useMemo } from 'react';\nimport { FlashMessage } from './FlashMessage';\nimport { flashManager } from './FlashMessageManager';\nimport type { FlashMessageContainerProps, FlashMessageOptions } from './types';\n\ninterface FlashMessageContextValue {\n show: (options: FlashMessageOptions) => void;\n hide: () => void;\n}\n\nconst FlashMessageContext = createContext<FlashMessageContextValue | null>(null);\n\nexport interface FlashMessageProviderProps extends FlashMessageContainerProps {\n children: React.ReactNode;\n}\n\nexport const FlashMessageProvider: React.FC<FlashMessageProviderProps> = ({\n children,\n ...containerProps\n}) => {\n const contextValue = useMemo<FlashMessageContextValue>(\n () => ({\n show: (options: FlashMessageOptions) => flashManager.showMessage(options),\n hide: () => flashManager.hideMessage(),\n }),\n []\n );\n\n return (\n <FlashMessageContext.Provider value={contextValue}>\n {children}\n <FlashMessage {...containerProps} />\n </FlashMessageContext.Provider>\n );\n};\n\nexport function useFlashMessage(): FlashMessageContextValue {\n const context = useContext(FlashMessageContext);\n if (!context) {\n // Graceful fallback to global manager even if Provider is omitted\n return {\n show: (options: FlashMessageOptions) => flashManager.showMessage(options),\n hide: () => flashManager.hideMessage(),\n };\n }\n return context;\n}\n\n","import { FlashMessage } from './FlashMessage';\n\nexport { FlashMessage };\nexport default FlashMessage;\n\nexport {\n flashManager,\n showMessage,\n hideMessage,\n flash,\n dismissFlash,\n} from './FlashMessageManager';\n\nexport {\n FlashMessageProvider,\n useFlashMessage,\n} from './FlashMessageProvider';\n\nexport { BuiltInIcon } from './icons';\nexport { COLORS, styles } from './styles';\n\nexport type {\n FlashMessageAction,\n FlashMessageContainerProps,\n FlashMessageIcon,\n FlashMessageOptions,\n FlashMessagePosition,\n FlashMessageRef,\n FlashMessageTransition,\n FlashMessageType,\n} from './types';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,89 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mehul214/react-native-flash-toast",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Next-generation, highly customizable flash message and toast banner for React Native & Expo. 100% Fabric / New Architecture ready with swipe-to-dismiss gestures.",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.mjs",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"react-native": "src/index.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"require": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"src",
|
|
22
|
+
"README.md",
|
|
23
|
+
"LICENSE"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsup",
|
|
27
|
+
"dev": "tsup --watch",
|
|
28
|
+
"test": "node test/smoke.test.js",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"react-native",
|
|
34
|
+
"react-native-flash-message",
|
|
35
|
+
"flash-message",
|
|
36
|
+
"toast",
|
|
37
|
+
"banner",
|
|
38
|
+
"notification",
|
|
39
|
+
"alert",
|
|
40
|
+
"snackbar",
|
|
41
|
+
"fabric",
|
|
42
|
+
"new-architecture",
|
|
43
|
+
"expo",
|
|
44
|
+
"swipe-to-dismiss",
|
|
45
|
+
"ios",
|
|
46
|
+
"android"
|
|
47
|
+
],
|
|
48
|
+
"funding": [
|
|
49
|
+
{
|
|
50
|
+
"type": "github",
|
|
51
|
+
"url": "https://github.com/sponsors/Mehul214"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "buy-me-a-coffee",
|
|
55
|
+
"url": "https://buymeacoffee.com/mehulreshac"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "individual",
|
|
59
|
+
"url": "https://github.com/Mehul214/react-native-flash-toast#-support-via-upi"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"author": "Mehul",
|
|
63
|
+
"license": "MIT",
|
|
64
|
+
"homepage": "https://github.com/Mehul214/react-native-flash-toast#readme",
|
|
65
|
+
"repository": {
|
|
66
|
+
"type": "git",
|
|
67
|
+
"url": "git+https://github.com/Mehul214/react-native-flash-toast.git"
|
|
68
|
+
},
|
|
69
|
+
"bugs": {
|
|
70
|
+
"url": "https://github.com/Mehul214/react-native-flash-toast/issues"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"react": ">=17.0.0",
|
|
74
|
+
"react-native": ">=0.68.0"
|
|
75
|
+
},
|
|
76
|
+
"peerDependenciesMeta": {
|
|
77
|
+
"react-native-safe-area-context": {
|
|
78
|
+
"optional": true
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@types/react": "^19.0.0",
|
|
83
|
+
"@types/react-native": "^0.73.0",
|
|
84
|
+
"react": "^19.0.0",
|
|
85
|
+
"react-native": "^0.78.0",
|
|
86
|
+
"tsup": "^8.3.0",
|
|
87
|
+
"typescript": "^5.7.3"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
useCallback,
|
|
3
|
+
useEffect,
|
|
4
|
+
useImperativeHandle,
|
|
5
|
+
useRef,
|
|
6
|
+
useState,
|
|
7
|
+
} from 'react';
|
|
8
|
+
import {
|
|
9
|
+
Animated,
|
|
10
|
+
PanResponder,
|
|
11
|
+
Pressable,
|
|
12
|
+
Text,
|
|
13
|
+
View,
|
|
14
|
+
} from 'react-native';
|
|
15
|
+
import { flashManager } from './FlashMessageManager';
|
|
16
|
+
import { BuiltInIcon } from './icons';
|
|
17
|
+
import { COLORS, styles } from './styles';
|
|
18
|
+
import type {
|
|
19
|
+
FlashMessageContainerProps,
|
|
20
|
+
FlashMessageOptions,
|
|
21
|
+
FlashMessageRef,
|
|
22
|
+
} from './types';
|
|
23
|
+
import { getDefaultSafeAreaInsets } from './utils/safeArea';
|
|
24
|
+
|
|
25
|
+
export const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContainerProps>(
|
|
26
|
+
(props, ref) => {
|
|
27
|
+
const {
|
|
28
|
+
position: defaultPosition = 'top',
|
|
29
|
+
duration: defaultDuration = 3000,
|
|
30
|
+
floating: defaultFloating = true,
|
|
31
|
+
statusBarOffset,
|
|
32
|
+
bottomOffset,
|
|
33
|
+
style: containerCustomStyle,
|
|
34
|
+
} = props;
|
|
35
|
+
|
|
36
|
+
const [currentMessage, setCurrentMessage] = useState<FlashMessageOptions | null>(null);
|
|
37
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
38
|
+
|
|
39
|
+
// Keep active message in a mutable ref so callbacks always access the latest values without re-creating functions
|
|
40
|
+
const currentMessageRef = useRef<FlashMessageOptions | null>(null);
|
|
41
|
+
|
|
42
|
+
// Animation values
|
|
43
|
+
const translateY = useRef(new Animated.Value(-150)).current;
|
|
44
|
+
const opacity = useRef(new Animated.Value(0)).current;
|
|
45
|
+
const progress = useRef(new Animated.Value(1)).current;
|
|
46
|
+
|
|
47
|
+
// Timers & gesture tracking
|
|
48
|
+
const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
49
|
+
const progressAnimationRef = useRef<Animated.CompositeAnimation | null>(null);
|
|
50
|
+
const remainingTimeRef = useRef<number>(0);
|
|
51
|
+
const timerStartedAtRef = useRef<number>(0);
|
|
52
|
+
|
|
53
|
+
const safeInsets = getDefaultSafeAreaInsets();
|
|
54
|
+
|
|
55
|
+
const clearTimers = useCallback(() => {
|
|
56
|
+
if (hideTimeoutRef.current) {
|
|
57
|
+
clearTimeout(hideTimeoutRef.current);
|
|
58
|
+
hideTimeoutRef.current = null;
|
|
59
|
+
}
|
|
60
|
+
if (progressAnimationRef.current) {
|
|
61
|
+
progressAnimationRef.current.stop();
|
|
62
|
+
progressAnimationRef.current = null;
|
|
63
|
+
}
|
|
64
|
+
}, []);
|
|
65
|
+
|
|
66
|
+
const animateHide = useCallback(
|
|
67
|
+
(callback?: () => void) => {
|
|
68
|
+
clearTimers();
|
|
69
|
+
|
|
70
|
+
const pos = currentMessageRef.current?.position ?? defaultPosition;
|
|
71
|
+
const targetY = pos === 'top' ? -180 : pos === 'bottom' ? 180 : 0;
|
|
72
|
+
|
|
73
|
+
Animated.parallel([
|
|
74
|
+
Animated.timing(translateY, {
|
|
75
|
+
toValue: targetY,
|
|
76
|
+
duration: 220,
|
|
77
|
+
useNativeDriver: true,
|
|
78
|
+
}),
|
|
79
|
+
Animated.timing(opacity, {
|
|
80
|
+
toValue: 0,
|
|
81
|
+
duration: 200,
|
|
82
|
+
useNativeDriver: true,
|
|
83
|
+
}),
|
|
84
|
+
]).start(() => {
|
|
85
|
+
setIsVisible(false);
|
|
86
|
+
const onHide = currentMessageRef.current?.onHide;
|
|
87
|
+
currentMessageRef.current = null;
|
|
88
|
+
setCurrentMessage(null);
|
|
89
|
+
if (onHide) {
|
|
90
|
+
onHide();
|
|
91
|
+
}
|
|
92
|
+
callback?.();
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
[clearTimers, defaultPosition, opacity, translateY]
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
const startAutoHideTimer = useCallback(
|
|
99
|
+
(durationMs: number) => {
|
|
100
|
+
clearTimers();
|
|
101
|
+
if (durationMs <= 0) return;
|
|
102
|
+
|
|
103
|
+
remainingTimeRef.current = durationMs;
|
|
104
|
+
timerStartedAtRef.current = Date.now();
|
|
105
|
+
|
|
106
|
+
// Start progress bar animation
|
|
107
|
+
progress.setValue(1);
|
|
108
|
+
progressAnimationRef.current = Animated.timing(progress, {
|
|
109
|
+
toValue: 0,
|
|
110
|
+
duration: durationMs,
|
|
111
|
+
useNativeDriver: false,
|
|
112
|
+
});
|
|
113
|
+
progressAnimationRef.current.start();
|
|
114
|
+
|
|
115
|
+
hideTimeoutRef.current = setTimeout(() => {
|
|
116
|
+
animateHide();
|
|
117
|
+
}, durationMs);
|
|
118
|
+
},
|
|
119
|
+
[animateHide, clearTimers, progress]
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
const pauseTimer = useCallback(() => {
|
|
123
|
+
if (hideTimeoutRef.current && timerStartedAtRef.current > 0) {
|
|
124
|
+
clearTimeout(hideTimeoutRef.current);
|
|
125
|
+
hideTimeoutRef.current = null;
|
|
126
|
+
const elapsed = Date.now() - timerStartedAtRef.current;
|
|
127
|
+
remainingTimeRef.current = Math.max(0, remainingTimeRef.current - elapsed);
|
|
128
|
+
if (progressAnimationRef.current) {
|
|
129
|
+
progressAnimationRef.current.stop();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}, []);
|
|
133
|
+
|
|
134
|
+
const resumeTimer = useCallback(() => {
|
|
135
|
+
if (remainingTimeRef.current > 0) {
|
|
136
|
+
startAutoHideTimer(remainingTimeRef.current);
|
|
137
|
+
}
|
|
138
|
+
}, [startAutoHideTimer]);
|
|
139
|
+
|
|
140
|
+
const show = useCallback(
|
|
141
|
+
(options: FlashMessageOptions) => {
|
|
142
|
+
clearTimers();
|
|
143
|
+
currentMessageRef.current = options;
|
|
144
|
+
setCurrentMessage(options);
|
|
145
|
+
setIsVisible(true);
|
|
146
|
+
|
|
147
|
+
const pos = options.position ?? defaultPosition;
|
|
148
|
+
const initialY = pos === 'top' ? -150 : pos === 'bottom' ? 150 : 0;
|
|
149
|
+
|
|
150
|
+
translateY.setValue(initialY);
|
|
151
|
+
opacity.setValue(0);
|
|
152
|
+
progress.setValue(1);
|
|
153
|
+
|
|
154
|
+
Animated.parallel([
|
|
155
|
+
Animated.spring(translateY, {
|
|
156
|
+
toValue: 0,
|
|
157
|
+
tension: 70,
|
|
158
|
+
friction: 9,
|
|
159
|
+
useNativeDriver: true,
|
|
160
|
+
}),
|
|
161
|
+
Animated.timing(opacity, {
|
|
162
|
+
toValue: 1,
|
|
163
|
+
duration: 200,
|
|
164
|
+
useNativeDriver: true,
|
|
165
|
+
}),
|
|
166
|
+
]).start(() => {
|
|
167
|
+
if (options.onShow) {
|
|
168
|
+
options.onShow();
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
const shouldAutoHide = options.autoHide ?? true;
|
|
173
|
+
const dur = shouldAutoHide
|
|
174
|
+
? options.duration !== undefined
|
|
175
|
+
? options.duration
|
|
176
|
+
: defaultDuration
|
|
177
|
+
: 0;
|
|
178
|
+
|
|
179
|
+
if (dur > 0) {
|
|
180
|
+
startAutoHideTimer(dur);
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
[clearTimers, defaultDuration, defaultPosition, opacity, progress, startAutoHideTimer, translateY]
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
// Mutable ref wrappers so external callers always invoke the latest logic
|
|
187
|
+
const showRef = useRef(show);
|
|
188
|
+
const animateHideRef = useRef(animateHide);
|
|
189
|
+
showRef.current = show;
|
|
190
|
+
animateHideRef.current = animateHide;
|
|
191
|
+
|
|
192
|
+
// Register with imperative ref
|
|
193
|
+
useImperativeHandle(
|
|
194
|
+
ref,
|
|
195
|
+
() => ({
|
|
196
|
+
showMessage: (options: FlashMessageOptions) => showRef.current(options),
|
|
197
|
+
hideMessage: () => animateHideRef.current(),
|
|
198
|
+
}),
|
|
199
|
+
[]
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
// Register with manager ON MOUNT only; only clean up on UNMOUNT
|
|
203
|
+
useEffect(() => {
|
|
204
|
+
const instanceRef: FlashMessageRef = {
|
|
205
|
+
showMessage: (options: FlashMessageOptions) => showRef.current(options),
|
|
206
|
+
hideMessage: () => animateHideRef.current(),
|
|
207
|
+
};
|
|
208
|
+
flashManager.register(instanceRef);
|
|
209
|
+
return () => {
|
|
210
|
+
flashManager.unregister();
|
|
211
|
+
clearTimers();
|
|
212
|
+
};
|
|
213
|
+
}, [clearTimers]);
|
|
214
|
+
|
|
215
|
+
// PanResponder for smooth swipe-to-dismiss gesture
|
|
216
|
+
const panResponder = useRef(
|
|
217
|
+
PanResponder.create({
|
|
218
|
+
onStartShouldSetPanResponder: () => false,
|
|
219
|
+
onMoveShouldSetPanResponder: (_, gestureState) => {
|
|
220
|
+
const swipeEnabled = currentMessageRef.current?.swipeToDismiss ?? true;
|
|
221
|
+
return swipeEnabled && Math.abs(gestureState.dy) > 8;
|
|
222
|
+
},
|
|
223
|
+
onPanResponderGrant: () => {
|
|
224
|
+
if (currentMessageRef.current?.pauseOnPress ?? true) {
|
|
225
|
+
pauseTimer();
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
onPanResponderMove: (_, gestureState) => {
|
|
229
|
+
if (!(currentMessageRef.current?.swipeToDismiss ?? true)) return;
|
|
230
|
+
const pos = currentMessageRef.current?.position ?? defaultPosition;
|
|
231
|
+
|
|
232
|
+
if (pos === 'top' && gestureState.dy < 0) {
|
|
233
|
+
translateY.setValue(gestureState.dy);
|
|
234
|
+
} else if (pos === 'bottom' && gestureState.dy > 0) {
|
|
235
|
+
translateY.setValue(gestureState.dy);
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
onPanResponderRelease: (_, gestureState) => {
|
|
239
|
+
const pos = currentMessageRef.current?.position ?? defaultPosition;
|
|
240
|
+
const swipeThreshold = 30;
|
|
241
|
+
const isDismissGesture =
|
|
242
|
+
(pos === 'top' && gestureState.dy < -swipeThreshold) ||
|
|
243
|
+
(pos === 'bottom' && gestureState.dy > swipeThreshold);
|
|
244
|
+
|
|
245
|
+
if (isDismissGesture && (currentMessageRef.current?.swipeToDismiss ?? true)) {
|
|
246
|
+
animateHide();
|
|
247
|
+
} else {
|
|
248
|
+
Animated.spring(translateY, {
|
|
249
|
+
toValue: 0,
|
|
250
|
+
tension: 80,
|
|
251
|
+
friction: 8,
|
|
252
|
+
useNativeDriver: true,
|
|
253
|
+
}).start();
|
|
254
|
+
|
|
255
|
+
if (currentMessageRef.current?.pauseOnPress ?? true) {
|
|
256
|
+
resumeTimer();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
})
|
|
261
|
+
).current;
|
|
262
|
+
|
|
263
|
+
if (!isVisible || !currentMessage) {
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const position = currentMessage.position ?? defaultPosition;
|
|
268
|
+
const isTop = position === 'top';
|
|
269
|
+
const isBottom = position === 'bottom';
|
|
270
|
+
|
|
271
|
+
const type = currentMessage.type ?? 'default';
|
|
272
|
+
const typeColors = COLORS[type];
|
|
273
|
+
const backgroundColor = currentMessage.backgroundColor ?? typeColors.background;
|
|
274
|
+
const textColor = currentMessage.color ?? typeColors.text;
|
|
275
|
+
const floating = currentMessage.floating ?? defaultFloating;
|
|
276
|
+
|
|
277
|
+
const topInset =
|
|
278
|
+
currentMessage.statusBarHeight ??
|
|
279
|
+
statusBarOffset ??
|
|
280
|
+
(isTop ? safeInsets.top + (floating ? 8 : 0) : 0);
|
|
281
|
+
|
|
282
|
+
const bottomInset =
|
|
283
|
+
bottomOffset ?? (isBottom ? safeInsets.bottom + (floating ? 8 : 0) : 0);
|
|
284
|
+
|
|
285
|
+
const rootPositionStyle = isTop
|
|
286
|
+
? [styles.rootTop, { paddingTop: topInset }]
|
|
287
|
+
: isBottom
|
|
288
|
+
? [styles.rootBottom, { paddingBottom: bottomInset }]
|
|
289
|
+
: styles.rootCenter;
|
|
290
|
+
|
|
291
|
+
const renderIcon = () => {
|
|
292
|
+
if (currentMessage.icon === 'none') return null;
|
|
293
|
+
|
|
294
|
+
if (typeof currentMessage.icon === 'function') {
|
|
295
|
+
return (
|
|
296
|
+
<View style={styles.iconContainer}>
|
|
297
|
+
<View style={styles.iconBadge}>
|
|
298
|
+
{currentMessage.icon({ size: 18, color: textColor })}
|
|
299
|
+
</View>
|
|
300
|
+
</View>
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if (React.isValidElement(currentMessage.icon)) {
|
|
305
|
+
return (
|
|
306
|
+
<View style={styles.iconContainer}>
|
|
307
|
+
<View style={styles.iconBadge}>{currentMessage.icon}</View>
|
|
308
|
+
</View>
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const iconType = typeof currentMessage.icon === 'string' ? currentMessage.icon : type;
|
|
313
|
+
return (
|
|
314
|
+
<View style={styles.iconContainer}>
|
|
315
|
+
<View style={styles.iconBadge}>
|
|
316
|
+
<BuiltInIcon type={iconType as any} color={textColor} size={18} />
|
|
317
|
+
</View>
|
|
318
|
+
</View>
|
|
319
|
+
);
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
const handlePress = () => {
|
|
323
|
+
if (currentMessage.onPress) {
|
|
324
|
+
currentMessage.onPress();
|
|
325
|
+
}
|
|
326
|
+
if (currentMessage.hideOnPress ?? true) {
|
|
327
|
+
animateHide();
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
const progressWidthInterpolation = progress.interpolate({
|
|
332
|
+
inputRange: [0, 1],
|
|
333
|
+
outputRange: ['0%', '100%'],
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
return (
|
|
337
|
+
<View
|
|
338
|
+
pointerEvents="box-none"
|
|
339
|
+
style={[styles.rootOverlay, rootPositionStyle, containerCustomStyle]}
|
|
340
|
+
>
|
|
341
|
+
<Animated.View
|
|
342
|
+
{...panResponder.panHandlers}
|
|
343
|
+
style={[
|
|
344
|
+
styles.toastContainer,
|
|
345
|
+
floating ? styles.floatingContainer : styles.edgeToEdgeContainer,
|
|
346
|
+
{ backgroundColor },
|
|
347
|
+
currentMessage.style,
|
|
348
|
+
{
|
|
349
|
+
transform: [{ translateY }],
|
|
350
|
+
opacity,
|
|
351
|
+
},
|
|
352
|
+
]}
|
|
353
|
+
>
|
|
354
|
+
{currentMessage.customComponent ? (
|
|
355
|
+
currentMessage.customComponent(currentMessage, () => animateHide())
|
|
356
|
+
) : (
|
|
357
|
+
<Pressable
|
|
358
|
+
onPress={handlePress}
|
|
359
|
+
onPressIn={() => {
|
|
360
|
+
if (currentMessage.pauseOnPress ?? true) {
|
|
361
|
+
pauseTimer();
|
|
362
|
+
}
|
|
363
|
+
}}
|
|
364
|
+
onPressOut={() => {
|
|
365
|
+
if (currentMessage.pauseOnPress ?? true) {
|
|
366
|
+
resumeTimer();
|
|
367
|
+
}
|
|
368
|
+
}}
|
|
369
|
+
onLongPress={currentMessage.onLongPress}
|
|
370
|
+
style={styles.contentWrapper}
|
|
371
|
+
>
|
|
372
|
+
{renderIcon()}
|
|
373
|
+
|
|
374
|
+
<View style={styles.textContainer}>
|
|
375
|
+
{typeof currentMessage.message === 'string' ? (
|
|
376
|
+
<Text
|
|
377
|
+
style={[styles.titleText, { color: textColor }, currentMessage.titleStyle]}
|
|
378
|
+
numberOfLines={2}
|
|
379
|
+
>
|
|
380
|
+
{currentMessage.message}
|
|
381
|
+
</Text>
|
|
382
|
+
) : (
|
|
383
|
+
currentMessage.message
|
|
384
|
+
)}
|
|
385
|
+
|
|
386
|
+
{currentMessage.description ? (
|
|
387
|
+
typeof currentMessage.description === 'string' ? (
|
|
388
|
+
<Text
|
|
389
|
+
style={[
|
|
390
|
+
styles.descriptionText,
|
|
391
|
+
{ color: textColor },
|
|
392
|
+
currentMessage.textStyle,
|
|
393
|
+
]}
|
|
394
|
+
numberOfLines={3}
|
|
395
|
+
>
|
|
396
|
+
{currentMessage.description}
|
|
397
|
+
</Text>
|
|
398
|
+
) : (
|
|
399
|
+
currentMessage.description
|
|
400
|
+
)
|
|
401
|
+
) : null}
|
|
402
|
+
</View>
|
|
403
|
+
|
|
404
|
+
{currentMessage.action ? (
|
|
405
|
+
<Pressable
|
|
406
|
+
onPress={() => {
|
|
407
|
+
currentMessage.action?.onPress();
|
|
408
|
+
animateHide();
|
|
409
|
+
}}
|
|
410
|
+
style={[styles.actionButton, currentMessage.action.style]}
|
|
411
|
+
>
|
|
412
|
+
<Text style={[styles.actionButtonText, currentMessage.action.textStyle]}>
|
|
413
|
+
{currentMessage.action.label}
|
|
414
|
+
</Text>
|
|
415
|
+
</Pressable>
|
|
416
|
+
) : null}
|
|
417
|
+
</Pressable>
|
|
418
|
+
)}
|
|
419
|
+
|
|
420
|
+
{currentMessage.showProgressBar && (
|
|
421
|
+
<View style={styles.progressBarContainer}>
|
|
422
|
+
<Animated.View
|
|
423
|
+
style={[
|
|
424
|
+
styles.progressBarFill,
|
|
425
|
+
{ width: progressWidthInterpolation },
|
|
426
|
+
]}
|
|
427
|
+
/>
|
|
428
|
+
</View>
|
|
429
|
+
)}
|
|
430
|
+
</Animated.View>
|
|
431
|
+
</View>
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
|
|
436
|
+
FlashMessage.displayName = 'FlashMessage';
|