@mehul214/react-native-flash-toast 1.0.0 → 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/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +204 -68
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +204 -68
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/FlashMessage.tsx +71 -33
- package/src/icons.tsx +115 -35
- package/src/styles.ts +24 -14
package/dist/index.mjs.map
CHANGED
|
@@ -1 +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","Text","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,EAAG;AAChC,MAAA,MAAM,IAAA,GAAO,IAAA,CAAK,YAAA,CAAa,KAAA,EAAM;AACrC,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,GAAA,CAAI,YAAY,IAAI,CAAA;AAAA,MACtB;A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AC,QAAA,CAAS,IAAA;AAAA,gBAAT;AAAA,kBACC,KAAA,EAAO;AAAA,oBACLH,OAAAA,CAAO,eAAA;AAAA,oBACP,EAAE,OAAO,0BAAA;AAA2B;AACtC;AAAA,eACF,EACF;AAAA;AAAA;AAAA;AAEJ;AAAA,KACF;AAAA,EAEJ;AACF;AAEA,YAAA,CAAa,WAAA,GAAc,cAAA;ACnY3B,IAAM,mBAAA,GAAsB,cAA+C,IAAI,CAAA;AAMxE,IAAM,uBAA4D,CAAC;AAAA,EACxE,QAAA;AAAA,EACA,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,YAAA,GAAe,OAAA;AAAA,IACnB,OAAO;AAAA,MACL,IAAA,EAAM,CAAC,OAAA,KAAiC,YAAA,CAAa,YAAY,OAAO,CAAA;AAAA,MACxE,IAAA,EAAM,MAAM,YAAA,CAAa,WAAA;AAAY,KACvC,CAAA;AAAA,IACA;AAAC,GACH;AAEA,EAAA,uBACEM,IAAAA,CAAC,mBAAA,CAAoB,QAAA,EAApB,EAA6B,OAAO,YAAA,EAClC,QAAA,EAAA;AAAA,IAAA,QAAA;AAAA,oBACDH,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, Text, 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 = 22,\n color = '#FFFFFF',\n}) => {\n const containerStyle = [\n styles.circle,\n {\n width: size,\n height: size,\n borderRadius: size / 2,\n borderColor: color,\n },\n ];\n\n switch (type) {\n case 'success':\n return (\n <View style={containerStyle}>\n <Text style={[styles.symbol, { color, fontSize: size * 0.65 }]}>✓</Text>\n </View>\n );\n case 'danger':\n return (\n <View style={containerStyle}>\n <Text style={[styles.symbol, { color, fontSize: size * 0.65 }]}>✕</Text>\n </View>\n );\n case 'warning':\n return (\n <View style={containerStyle}>\n <Text style={[styles.symbol, { color, fontSize: size * 0.65 }]}>!</Text>\n </View>\n );\n case 'info':\n return (\n <View style={containerStyle}>\n <Text style={[styles.symbol, { color, fontSize: size * 0.65 }]}>ℹ</Text>\n </View>\n );\n case 'default':\n default:\n return (\n <View style={containerStyle}>\n <Text style={[styles.symbol, { color, fontSize: size * 0.6 }]}>●</Text>\n </View>\n );\n }\n};\n\nconst styles = StyleSheet.create({\n circle: {\n borderWidth: 1.5,\n justifyContent: 'center',\n alignItems: 'center',\n },\n symbol: {\n fontWeight: '800',\n textAlign: 'center',\n includeFontPadding: false,\n lineHeight: 22,\n },\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.18,\n shadowRadius: 12,\n },\n android: {\n elevation: 8,\n },\n web: {\n boxShadow: '0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1)',\n } as any,\n }),\n },\n floatingContainer: {\n marginHorizontal: 16,\n borderRadius: 14,\n borderWidth: StyleSheet.hairlineWidth,\n borderColor: 'rgba(255, 255, 255, 0.15)',\n },\n edgeToEdgeContainer: {\n marginHorizontal: 0,\n borderRadius: 0,\n },\n contentWrapper: {\n flex: 1,\n flexDirection: 'row',\n alignItems: 'center',\n paddingVertical: 14,\n paddingHorizontal: 16,\n },\n iconContainer: {\n marginRight: 12,\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 color: '#FFFFFF',\n },\n descriptionText: {\n fontSize: 13,\n fontWeight: '400',\n color: 'rgba(255, 255, 255, 0.88)',\n marginTop: 2,\n lineHeight: 18,\n },\n actionButton: {\n marginLeft: 10,\n paddingHorizontal: 12,\n paddingVertical: 6,\n borderRadius: 8,\n backgroundColor: 'rgba(255, 255, 255, 0.2)',\n },\n actionButtonText: {\n fontSize: 13,\n fontWeight: '700',\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.25)',\n },\n progressBarFill: {\n height: '100%',\n backgroundColor: '#FFFFFF',\n },\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 // 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 position = currentMessage?.position ?? defaultPosition;\n const isTop = position === 'top';\n const isBottom = position === 'bottom';\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 targetY = isTop ? -180 : isBottom ? 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 if (currentMessage?.onHide) {\n currentMessage.onHide();\n }\n setCurrentMessage(null);\n callback?.();\n });\n },\n [clearTimers, isTop, isBottom, opacity, translateY, currentMessage]\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, // width needs layout or scaleX\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 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 ? options.duration ?? defaultDuration : 0;\n if (dur > 0) {\n startAutoHideTimer(dur);\n }\n },\n [clearTimers, defaultDuration, defaultPosition, opacity, progress, startAutoHideTimer, translateY]\n );\n\n // Register with manager and imperative ref\n useImperativeHandle(\n ref,\n () => ({\n showMessage: show,\n hideMessage: () => animateHide(),\n }),\n [show, animateHide]\n );\n\n useEffect(() => {\n const instanceRef: FlashMessageRef = {\n showMessage: show,\n hideMessage: () => animateHide(),\n };\n flashManager.register(instanceRef);\n return () => {\n flashManager.unregister();\n clearTimers();\n };\n }, [show, animateHide, clearTimers]);\n\n // PanResponder for smooth swipe-to-dismiss gesture\n const panResponder = useRef(\n PanResponder.create({\n onStartShouldSetPanResponder: () => true,\n onMoveShouldSetPanResponder: (_, gestureState) => {\n return Math.abs(gestureState.dy) > 5;\n },\n onPanResponderGrant: () => {\n if (currentMessage?.pauseOnPress ?? true) {\n pauseTimer();\n }\n },\n onPanResponderMove: (_, gestureState) => {\n if (!(currentMessage?.swipeToDismiss ?? true)) return;\n\n // Only allow dragging upwards for top, downwards for bottom\n if (isTop && gestureState.dy < 0) {\n translateY.setValue(gestureState.dy);\n } else if (isBottom && gestureState.dy > 0) {\n translateY.setValue(gestureState.dy);\n }\n },\n onPanResponderRelease: (_, gestureState) => {\n const swipeThreshold = 30;\n const isDismissGesture =\n (isTop && gestureState.dy < -swipeThreshold) ||\n (isBottom && gestureState.dy > swipeThreshold);\n\n if (isDismissGesture && (currentMessage?.swipeToDismiss ?? true)) {\n animateHide();\n } else {\n // Spring back to center\n Animated.spring(translateY, {\n toValue: 0,\n tension: 80,\n friction: 8,\n useNativeDriver: true,\n }).start();\n\n if (currentMessage?.pauseOnPress ?? true) {\n resumeTimer();\n }\n }\n },\n })\n ).current;\n\n if (!isVisible || !currentMessage) {\n return null;\n }\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 {currentMessage.icon({ size: 22, color: textColor })}\n </View>\n );\n }\n\n if (React.isValidElement(currentMessage.icon)) {\n return <View style={styles.iconContainer}>{currentMessage.icon}</View>;\n }\n\n const iconType = typeof currentMessage.icon === 'string' ? currentMessage.icon : type;\n return (\n <View style={styles.iconContainer}>\n <BuiltInIcon type={iconType as any} color={textColor} size={22} />\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 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"]}
|
|
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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AAA,GAAe,OAAA;AAAA,IACnB,OAAO;AAAA,MACL,IAAA,EAAM,CAAC,OAAA,KAAiC,YAAA,CAAa,YAAY,OAAO,CAAA;AAAA,MACxE,IAAA,EAAM,MAAM,YAAA,CAAa,WAAA;AAAY,KACvC,CAAA;AAAA,IACA;AAAC,GACH;AAEA,EAAA,uBACEK,IAAAA,CAAC,mBAAA,CAAoB,QAAA,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,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mehul214/react-native-flash-toast",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
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
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
package/src/FlashMessage.tsx
CHANGED
|
@@ -36,6 +36,9 @@ export const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContai
|
|
|
36
36
|
const [currentMessage, setCurrentMessage] = useState<FlashMessageOptions | null>(null);
|
|
37
37
|
const [isVisible, setIsVisible] = useState(false);
|
|
38
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
|
+
|
|
39
42
|
// Animation values
|
|
40
43
|
const translateY = useRef(new Animated.Value(-150)).current;
|
|
41
44
|
const opacity = useRef(new Animated.Value(0)).current;
|
|
@@ -49,10 +52,6 @@ export const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContai
|
|
|
49
52
|
|
|
50
53
|
const safeInsets = getDefaultSafeAreaInsets();
|
|
51
54
|
|
|
52
|
-
const position = currentMessage?.position ?? defaultPosition;
|
|
53
|
-
const isTop = position === 'top';
|
|
54
|
-
const isBottom = position === 'bottom';
|
|
55
|
-
|
|
56
55
|
const clearTimers = useCallback(() => {
|
|
57
56
|
if (hideTimeoutRef.current) {
|
|
58
57
|
clearTimeout(hideTimeoutRef.current);
|
|
@@ -68,7 +67,8 @@ export const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContai
|
|
|
68
67
|
(callback?: () => void) => {
|
|
69
68
|
clearTimers();
|
|
70
69
|
|
|
71
|
-
const
|
|
70
|
+
const pos = currentMessageRef.current?.position ?? defaultPosition;
|
|
71
|
+
const targetY = pos === 'top' ? -180 : pos === 'bottom' ? 180 : 0;
|
|
72
72
|
|
|
73
73
|
Animated.parallel([
|
|
74
74
|
Animated.timing(translateY, {
|
|
@@ -83,14 +83,16 @@ export const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContai
|
|
|
83
83
|
}),
|
|
84
84
|
]).start(() => {
|
|
85
85
|
setIsVisible(false);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
86
|
+
const onHide = currentMessageRef.current?.onHide;
|
|
87
|
+
currentMessageRef.current = null;
|
|
89
88
|
setCurrentMessage(null);
|
|
89
|
+
if (onHide) {
|
|
90
|
+
onHide();
|
|
91
|
+
}
|
|
90
92
|
callback?.();
|
|
91
93
|
});
|
|
92
94
|
},
|
|
93
|
-
[clearTimers,
|
|
95
|
+
[clearTimers, defaultPosition, opacity, translateY]
|
|
94
96
|
);
|
|
95
97
|
|
|
96
98
|
const startAutoHideTimer = useCallback(
|
|
@@ -106,7 +108,7 @@ export const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContai
|
|
|
106
108
|
progressAnimationRef.current = Animated.timing(progress, {
|
|
107
109
|
toValue: 0,
|
|
108
110
|
duration: durationMs,
|
|
109
|
-
useNativeDriver: false,
|
|
111
|
+
useNativeDriver: false,
|
|
110
112
|
});
|
|
111
113
|
progressAnimationRef.current.start();
|
|
112
114
|
|
|
@@ -138,6 +140,7 @@ export const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContai
|
|
|
138
140
|
const show = useCallback(
|
|
139
141
|
(options: FlashMessageOptions) => {
|
|
140
142
|
clearTimers();
|
|
143
|
+
currentMessageRef.current = options;
|
|
141
144
|
setCurrentMessage(options);
|
|
142
145
|
setIsVisible(true);
|
|
143
146
|
|
|
@@ -167,7 +170,12 @@ export const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContai
|
|
|
167
170
|
});
|
|
168
171
|
|
|
169
172
|
const shouldAutoHide = options.autoHide ?? true;
|
|
170
|
-
const dur = shouldAutoHide
|
|
173
|
+
const dur = shouldAutoHide
|
|
174
|
+
? options.duration !== undefined
|
|
175
|
+
? options.duration
|
|
176
|
+
: defaultDuration
|
|
177
|
+
: 0;
|
|
178
|
+
|
|
171
179
|
if (dur > 0) {
|
|
172
180
|
startAutoHideTimer(dur);
|
|
173
181
|
}
|
|
@@ -175,60 +183,68 @@ export const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContai
|
|
|
175
183
|
[clearTimers, defaultDuration, defaultPosition, opacity, progress, startAutoHideTimer, translateY]
|
|
176
184
|
);
|
|
177
185
|
|
|
178
|
-
//
|
|
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
|
|
179
193
|
useImperativeHandle(
|
|
180
194
|
ref,
|
|
181
195
|
() => ({
|
|
182
|
-
showMessage:
|
|
183
|
-
hideMessage: () =>
|
|
196
|
+
showMessage: (options: FlashMessageOptions) => showRef.current(options),
|
|
197
|
+
hideMessage: () => animateHideRef.current(),
|
|
184
198
|
}),
|
|
185
|
-
[
|
|
199
|
+
[]
|
|
186
200
|
);
|
|
187
201
|
|
|
202
|
+
// Register with manager ON MOUNT only; only clean up on UNMOUNT
|
|
188
203
|
useEffect(() => {
|
|
189
204
|
const instanceRef: FlashMessageRef = {
|
|
190
|
-
showMessage:
|
|
191
|
-
hideMessage: () =>
|
|
205
|
+
showMessage: (options: FlashMessageOptions) => showRef.current(options),
|
|
206
|
+
hideMessage: () => animateHideRef.current(),
|
|
192
207
|
};
|
|
193
208
|
flashManager.register(instanceRef);
|
|
194
209
|
return () => {
|
|
195
210
|
flashManager.unregister();
|
|
196
211
|
clearTimers();
|
|
197
212
|
};
|
|
198
|
-
}, [
|
|
213
|
+
}, [clearTimers]);
|
|
199
214
|
|
|
200
215
|
// PanResponder for smooth swipe-to-dismiss gesture
|
|
201
216
|
const panResponder = useRef(
|
|
202
217
|
PanResponder.create({
|
|
203
|
-
onStartShouldSetPanResponder: () =>
|
|
218
|
+
onStartShouldSetPanResponder: () => false,
|
|
204
219
|
onMoveShouldSetPanResponder: (_, gestureState) => {
|
|
205
|
-
|
|
220
|
+
const swipeEnabled = currentMessageRef.current?.swipeToDismiss ?? true;
|
|
221
|
+
return swipeEnabled && Math.abs(gestureState.dy) > 8;
|
|
206
222
|
},
|
|
207
223
|
onPanResponderGrant: () => {
|
|
208
|
-
if (
|
|
224
|
+
if (currentMessageRef.current?.pauseOnPress ?? true) {
|
|
209
225
|
pauseTimer();
|
|
210
226
|
}
|
|
211
227
|
},
|
|
212
228
|
onPanResponderMove: (_, gestureState) => {
|
|
213
|
-
if (!(
|
|
229
|
+
if (!(currentMessageRef.current?.swipeToDismiss ?? true)) return;
|
|
230
|
+
const pos = currentMessageRef.current?.position ?? defaultPosition;
|
|
214
231
|
|
|
215
|
-
|
|
216
|
-
if (isTop && gestureState.dy < 0) {
|
|
232
|
+
if (pos === 'top' && gestureState.dy < 0) {
|
|
217
233
|
translateY.setValue(gestureState.dy);
|
|
218
|
-
} else if (
|
|
234
|
+
} else if (pos === 'bottom' && gestureState.dy > 0) {
|
|
219
235
|
translateY.setValue(gestureState.dy);
|
|
220
236
|
}
|
|
221
237
|
},
|
|
222
238
|
onPanResponderRelease: (_, gestureState) => {
|
|
239
|
+
const pos = currentMessageRef.current?.position ?? defaultPosition;
|
|
223
240
|
const swipeThreshold = 30;
|
|
224
241
|
const isDismissGesture =
|
|
225
|
-
(
|
|
226
|
-
(
|
|
242
|
+
(pos === 'top' && gestureState.dy < -swipeThreshold) ||
|
|
243
|
+
(pos === 'bottom' && gestureState.dy > swipeThreshold);
|
|
227
244
|
|
|
228
|
-
if (isDismissGesture && (
|
|
245
|
+
if (isDismissGesture && (currentMessageRef.current?.swipeToDismiss ?? true)) {
|
|
229
246
|
animateHide();
|
|
230
247
|
} else {
|
|
231
|
-
// Spring back to center
|
|
232
248
|
Animated.spring(translateY, {
|
|
233
249
|
toValue: 0,
|
|
234
250
|
tension: 80,
|
|
@@ -236,7 +252,7 @@ export const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContai
|
|
|
236
252
|
useNativeDriver: true,
|
|
237
253
|
}).start();
|
|
238
254
|
|
|
239
|
-
if (
|
|
255
|
+
if (currentMessageRef.current?.pauseOnPress ?? true) {
|
|
240
256
|
resumeTimer();
|
|
241
257
|
}
|
|
242
258
|
}
|
|
@@ -248,6 +264,10 @@ export const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContai
|
|
|
248
264
|
return null;
|
|
249
265
|
}
|
|
250
266
|
|
|
267
|
+
const position = currentMessage.position ?? defaultPosition;
|
|
268
|
+
const isTop = position === 'top';
|
|
269
|
+
const isBottom = position === 'bottom';
|
|
270
|
+
|
|
251
271
|
const type = currentMessage.type ?? 'default';
|
|
252
272
|
const typeColors = COLORS[type];
|
|
253
273
|
const backgroundColor = currentMessage.backgroundColor ?? typeColors.background;
|
|
@@ -274,19 +294,27 @@ export const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContai
|
|
|
274
294
|
if (typeof currentMessage.icon === 'function') {
|
|
275
295
|
return (
|
|
276
296
|
<View style={styles.iconContainer}>
|
|
277
|
-
{
|
|
297
|
+
<View style={styles.iconBadge}>
|
|
298
|
+
{currentMessage.icon({ size: 18, color: textColor })}
|
|
299
|
+
</View>
|
|
278
300
|
</View>
|
|
279
301
|
);
|
|
280
302
|
}
|
|
281
303
|
|
|
282
304
|
if (React.isValidElement(currentMessage.icon)) {
|
|
283
|
-
return
|
|
305
|
+
return (
|
|
306
|
+
<View style={styles.iconContainer}>
|
|
307
|
+
<View style={styles.iconBadge}>{currentMessage.icon}</View>
|
|
308
|
+
</View>
|
|
309
|
+
);
|
|
284
310
|
}
|
|
285
311
|
|
|
286
312
|
const iconType = typeof currentMessage.icon === 'string' ? currentMessage.icon : type;
|
|
287
313
|
return (
|
|
288
314
|
<View style={styles.iconContainer}>
|
|
289
|
-
<
|
|
315
|
+
<View style={styles.iconBadge}>
|
|
316
|
+
<BuiltInIcon type={iconType as any} color={textColor} size={18} />
|
|
317
|
+
</View>
|
|
290
318
|
</View>
|
|
291
319
|
);
|
|
292
320
|
};
|
|
@@ -328,6 +356,16 @@ export const FlashMessage = React.forwardRef<FlashMessageRef, FlashMessageContai
|
|
|
328
356
|
) : (
|
|
329
357
|
<Pressable
|
|
330
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
|
+
}}
|
|
331
369
|
onLongPress={currentMessage.onLongPress}
|
|
332
370
|
style={styles.contentWrapper}
|
|
333
371
|
>
|
package/src/icons.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View,
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
3
|
import type { FlashMessageType } from './types';
|
|
4
4
|
|
|
5
5
|
interface BuiltInIconProps {
|
|
@@ -10,65 +10,145 @@ interface BuiltInIconProps {
|
|
|
10
10
|
|
|
11
11
|
export const BuiltInIcon: React.FC<BuiltInIconProps> = ({
|
|
12
12
|
type,
|
|
13
|
-
size =
|
|
13
|
+
size = 18,
|
|
14
14
|
color = '#FFFFFF',
|
|
15
15
|
}) => {
|
|
16
|
-
const containerStyle = [
|
|
17
|
-
styles.circle,
|
|
18
|
-
{
|
|
19
|
-
width: size,
|
|
20
|
-
height: size,
|
|
21
|
-
borderRadius: size / 2,
|
|
22
|
-
borderColor: color,
|
|
23
|
-
},
|
|
24
|
-
];
|
|
25
|
-
|
|
26
16
|
switch (type) {
|
|
27
|
-
case 'success':
|
|
17
|
+
case 'success': {
|
|
18
|
+
// Crisp pixel-perfect checkmark
|
|
19
|
+
const checkWidth = size * 0.36;
|
|
20
|
+
const checkHeight = size * 0.65;
|
|
21
|
+
const stroke = Math.max(2, size * 0.12);
|
|
28
22
|
return (
|
|
29
|
-
<View style={
|
|
30
|
-
<
|
|
23
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
24
|
+
<View
|
|
25
|
+
style={{
|
|
26
|
+
width: checkWidth,
|
|
27
|
+
height: checkHeight,
|
|
28
|
+
borderColor: color,
|
|
29
|
+
borderBottomWidth: stroke,
|
|
30
|
+
borderRightWidth: stroke,
|
|
31
|
+
borderRadius: 1,
|
|
32
|
+
transform: [{ rotate: '45deg' }, { translateY: -size * 0.08 }],
|
|
33
|
+
}}
|
|
34
|
+
/>
|
|
31
35
|
</View>
|
|
32
36
|
);
|
|
33
|
-
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
case 'danger': {
|
|
40
|
+
// Crisp pixel-perfect cross
|
|
41
|
+
const crossThickness = Math.max(2, size * 0.12);
|
|
42
|
+
const crossLength = size * 0.72;
|
|
34
43
|
return (
|
|
35
|
-
<View style={
|
|
36
|
-
<
|
|
44
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
45
|
+
<View
|
|
46
|
+
style={[
|
|
47
|
+
styles.crossBar,
|
|
48
|
+
{
|
|
49
|
+
width: crossLength,
|
|
50
|
+
height: crossThickness,
|
|
51
|
+
backgroundColor: color,
|
|
52
|
+
borderRadius: crossThickness / 2,
|
|
53
|
+
transform: [{ rotate: '45deg' }],
|
|
54
|
+
},
|
|
55
|
+
]}
|
|
56
|
+
/>
|
|
57
|
+
<View
|
|
58
|
+
style={[
|
|
59
|
+
styles.crossBar,
|
|
60
|
+
{
|
|
61
|
+
width: crossLength,
|
|
62
|
+
height: crossThickness,
|
|
63
|
+
backgroundColor: color,
|
|
64
|
+
borderRadius: crossThickness / 2,
|
|
65
|
+
transform: [{ rotate: '-45deg' }],
|
|
66
|
+
},
|
|
67
|
+
]}
|
|
68
|
+
/>
|
|
37
69
|
</View>
|
|
38
70
|
);
|
|
39
|
-
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
case 'warning': {
|
|
74
|
+
// Modern clean exclamation mark
|
|
75
|
+
const warnThickness = Math.max(2, size * 0.13);
|
|
76
|
+
const dotSize = warnThickness * 1.1;
|
|
40
77
|
return (
|
|
41
|
-
<View style={
|
|
42
|
-
<
|
|
78
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
79
|
+
<View
|
|
80
|
+
style={{
|
|
81
|
+
width: warnThickness,
|
|
82
|
+
height: size * 0.46,
|
|
83
|
+
backgroundColor: color,
|
|
84
|
+
borderRadius: warnThickness / 2,
|
|
85
|
+
marginBottom: size * 0.14,
|
|
86
|
+
}}
|
|
87
|
+
/>
|
|
88
|
+
<View
|
|
89
|
+
style={{
|
|
90
|
+
width: dotSize,
|
|
91
|
+
height: dotSize,
|
|
92
|
+
borderRadius: dotSize / 2,
|
|
93
|
+
backgroundColor: color,
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
43
96
|
</View>
|
|
44
97
|
);
|
|
45
|
-
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
case 'info': {
|
|
101
|
+
// Modern clean info icon: top dot, bottom stem (no double circle!)
|
|
102
|
+
const infoThickness = Math.max(2, size * 0.13);
|
|
103
|
+
const infoDotSize = infoThickness * 1.1;
|
|
46
104
|
return (
|
|
47
|
-
<View style={
|
|
48
|
-
<
|
|
105
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
106
|
+
<View
|
|
107
|
+
style={{
|
|
108
|
+
width: infoDotSize,
|
|
109
|
+
height: infoDotSize,
|
|
110
|
+
borderRadius: infoDotSize / 2,
|
|
111
|
+
backgroundColor: color,
|
|
112
|
+
marginBottom: size * 0.14,
|
|
113
|
+
}}
|
|
114
|
+
/>
|
|
115
|
+
<View
|
|
116
|
+
style={{
|
|
117
|
+
width: infoThickness,
|
|
118
|
+
height: size * 0.46,
|
|
119
|
+
backgroundColor: color,
|
|
120
|
+
borderRadius: infoThickness / 2,
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
49
123
|
</View>
|
|
50
124
|
);
|
|
125
|
+
}
|
|
126
|
+
|
|
51
127
|
case 'default':
|
|
52
|
-
default:
|
|
128
|
+
default: {
|
|
129
|
+
const defaultDot = size * 0.44;
|
|
53
130
|
return (
|
|
54
|
-
<View style={
|
|
55
|
-
<
|
|
131
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
132
|
+
<View
|
|
133
|
+
style={{
|
|
134
|
+
width: defaultDot,
|
|
135
|
+
height: defaultDot,
|
|
136
|
+
borderRadius: defaultDot / 2,
|
|
137
|
+
backgroundColor: color,
|
|
138
|
+
}}
|
|
139
|
+
/>
|
|
56
140
|
</View>
|
|
57
141
|
);
|
|
142
|
+
}
|
|
58
143
|
}
|
|
59
144
|
};
|
|
60
145
|
|
|
61
146
|
const styles = StyleSheet.create({
|
|
62
|
-
|
|
63
|
-
borderWidth: 1.5,
|
|
147
|
+
center: {
|
|
64
148
|
justifyContent: 'center',
|
|
65
149
|
alignItems: 'center',
|
|
66
150
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
textAlign: 'center',
|
|
70
|
-
includeFontPadding: false,
|
|
71
|
-
lineHeight: 22,
|
|
151
|
+
crossBar: {
|
|
152
|
+
position: 'absolute',
|
|
72
153
|
},
|
|
73
154
|
});
|
|
74
|
-
|