diff --git a/example/src/App.tsx b/example/src/App.tsx index 4da4a62..bb20986 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -6,7 +6,7 @@ import * as React from 'react'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { ToastPosition, - ToastProvider, + Toaster, ToastSwipeDirection, } from 'react-native-reanimated-toasts'; import { SafeAreaProvider } from 'react-native-safe-area-context'; @@ -30,7 +30,7 @@ const App: React.FC = () => { /> - (null); diff --git a/src/components/toast/ToastSwipeHandler.tsx b/src/components/toast/ToastSwipeHandler.tsx index 4c93f65..10b34a6 100644 --- a/src/components/toast/ToastSwipeHandler.tsx +++ b/src/components/toast/ToastSwipeHandler.tsx @@ -1,6 +1,6 @@ -import { ANIMATION_DURATION } from '@/components/toast/toastAnimations'; -import { useToastContext } from '@/components/toast/ToastContext'; -import { ToastSwipeDirection } from '@/types/toastTypes'; +import { ANIMATION_DURATION } from './toastAnimations'; +import { useToastContext } from './ToastContext'; +import { ToastSwipeDirection } from '../../types/toastTypes'; import * as React from 'react'; import { Dimensions, type ViewStyle } from 'react-native'; import { Gesture, GestureDetector } from 'react-native-gesture-handler'; diff --git a/src/components/toast/Toaster.tsx b/src/components/toast/Toaster.tsx index 263f0cd..434637c 100644 --- a/src/components/toast/Toaster.tsx +++ b/src/components/toast/Toaster.tsx @@ -1,4 +1,4 @@ -import { ToastContext } from '@/components/toast/ToastContext'; +import { ToastContext } from './ToastContext'; import { ToastPosition, type ToastFunctionBase, @@ -6,8 +6,8 @@ import { type ToastProps, type ToastProviderProps, type ToastUpdateFunction, -} from '@/types/toastTypes'; -import { toastDefaultValues } from '@/utils/toastConstants'; +} from '../../types/toastTypes'; +import { toastDefaultValues } from '../../utils/toastConstants'; import * as React from 'react'; import { View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; @@ -20,7 +20,7 @@ let updateToastHandler: ToastUpdateFunction; const { TOP_CENTER, BOTTOM_CENTER } = ToastPosition; -export const ToastProvider: React.FC = ({ +export const Toaster: React.FC = ({ duration, position, maxToasts = 3, diff --git a/src/components/toast/toastAnimations.ts b/src/components/toast/toastAnimations.ts index 7f1fdac..0d83a95 100644 --- a/src/components/toast/toastAnimations.ts +++ b/src/components/toast/toastAnimations.ts @@ -1,5 +1,5 @@ -import { useToastContext } from '@/components/toast/ToastContext'; -import { ToastPosition } from '@/types/toastTypes'; +import { useToastContext } from './ToastContext'; +import { ToastPosition } from '../../types/toastTypes'; import React from 'react'; import { Easing, withTiming } from 'react-native-reanimated'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; diff --git a/src/index.tsx b/src/index.tsx index eaae8a7..3fe0291 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,5 +1,5 @@ export { default as Toast } from './components/toast/Toast'; -export { ToastProvider } from './components/toast/Toaster'; +export { Toaster } from './components/toast/Toaster'; export { default as toast } from './utils/toastFunctions'; export { ToastVariant, diff --git a/src/utils/toastConstants.ts b/src/utils/toastConstants.ts index a7d719b..9790a0d 100644 --- a/src/utils/toastConstants.ts +++ b/src/utils/toastConstants.ts @@ -2,7 +2,7 @@ import { ToastPosition, ToastSwipeDirection, ToastVariant, -} from '@/types/toastTypes'; +} from '../types/toastTypes'; export const toastDefaultValues = { duration: 3000, diff --git a/src/utils/toastFunctions.ts b/src/utils/toastFunctions.ts index be1c473..4d22a43 100644 --- a/src/utils/toastFunctions.ts +++ b/src/utils/toastFunctions.ts @@ -1,5 +1,5 @@ -import { getToastContext } from '@/components/toast/Toaster'; -import { ToastVariant, type ToastFunction } from '@/types/toastTypes'; +import { getToastContext } from '../components/toast/Toaster'; +import { ToastVariant, type ToastFunction } from '../types/toastTypes'; const toast: ToastFunction = (title, options) => { const { addToast } = getToastContext(); diff --git a/tsconfig.json b/tsconfig.json index 89d8f97..2d094e3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,6 @@ "rootDir": ".", "baseUrl": ".", "paths": { - "@/*": ["src/*"], "react-native-reanimated-toasts": ["./src/index"] }, "allowUnreachableCode": false,