Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnartorfis committed Sep 4, 2024
1 parent 10c8a68 commit 62cf9d0
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 22 deletions.
4 changes: 2 additions & 2 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -30,7 +30,7 @@ const App: React.FC = () => {
/>
</Stack.Navigator>
</NavigationContainer>
<ToastProvider
<Toaster
position={ToastPosition.TOP_CENTER}
duration={3000}
swipToDismissDirection={ToastSwipeDirection.UP}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,4 @@
"type": "library",
"version": "0.41.0"
}
}
}
8 changes: 4 additions & 4 deletions src/components/toast/Toast.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
ANIMATION_DURATION,
useToastLayoutAnimations,
} from '@/components/toast/toastAnimations';
import { useToastContext } from '@/components/toast/ToastContext';
import { ToastSwipeHandler } from '@/components/toast/ToastSwipeHandler';
import { ToastVariant, type ToastProps } from '@/types/toastTypes';
} from '../toast/toastAnimations';
import { useToastContext } from './ToastContext';
import { ToastSwipeHandler } from './ToastSwipeHandler';
import { ToastVariant, type ToastProps } from '../../types/toastTypes';
import { CircleCheck, CircleX, Info, X } from 'lucide-react-native';
import * as React from 'react';
import { ActivityIndicator, Pressable, Text, View } from 'react-native';
Expand Down
2 changes: 1 addition & 1 deletion src/components/toast/ToastContext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ToastContextType } from '@/types/toastTypes';
import { type ToastContextType } from '../../types/toastTypes';
import * as React from 'react';

export const ToastContext = React.createContext<ToastContextType | null>(null);
Expand Down
6 changes: 3 additions & 3 deletions src/components/toast/ToastSwipeHandler.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
8 changes: 4 additions & 4 deletions src/components/toast/Toaster.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ToastContext } from '@/components/toast/ToastContext';
import { ToastContext } from './ToastContext';
import {
ToastPosition,
type ToastFunctionBase,
type ToastFunctionOptions,
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';
Expand All @@ -20,7 +20,7 @@ let updateToastHandler: ToastUpdateFunction;

const { TOP_CENTER, BOTTOM_CENTER } = ToastPosition;

export const ToastProvider: React.FC<ToastProviderProps> = ({
export const Toaster: React.FC<ToastProviderProps> = ({
duration,
position,
maxToasts = 3,
Expand Down
4 changes: 2 additions & 2 deletions src/components/toast/toastAnimations.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/toastConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
ToastPosition,
ToastSwipeDirection,
ToastVariant,
} from '@/types/toastTypes';
} from '../types/toastTypes';

export const toastDefaultValues = {
duration: 3000,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/toastFunctions.ts
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"rootDir": ".",
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"react-native-reanimated-toasts": ["./src/index"]
},
"allowUnreachableCode": false,
Expand Down

0 comments on commit 62cf9d0

Please sign in to comment.