Skip to content

Commit

Permalink
chore: fix toast
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban committed Sep 8, 2024
1 parent 0e619cd commit 405bef8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/(app)/feed/detail/[entryId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { FlatList, Pressable, View } from 'react-native'
import ContextMenu from 'react-native-context-menu-view'
import PagerView from 'react-native-pager-view'
import Animated, { FadeIn, runOnJS, SlideInDown, SlideOutDown, useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated'
import { toast } from 'react-native-reanimated-toasts'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import { createStyleSheet, UnistylesRuntime, useStyles } from 'react-native-unistyles'
import { toast } from 'sonner-native'
import useSWR from 'swr'

import { apiClient } from '~/api/client'
Expand Down
11 changes: 8 additions & 3 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import { Slot } from 'expo-router'
import * as SplashScreen from 'expo-splash-screen'
import { useEffect } from 'react'
import type { AppStateStatus } from 'react-native'
import { AppState } from 'react-native'
import { AppState, LogBox } from 'react-native'
import { GestureHandlerRootView } from 'react-native-gesture-handler'
import { createModalStack, ModalProvider } from 'react-native-modalfy'
import { Toaster } from 'react-native-reanimated-toasts'
import { SafeAreaView } from 'react-native-safe-area-context'
import { Toaster } from 'sonner-native'
import { SWRConfig } from 'swr'

import { Text } from '~/components'
Expand All @@ -23,6 +23,11 @@ import { db, expoDb } from '~/db'
import migrations from '~/drizzle/migrations'
import { useNavigationTheme, useTheme } from '~/hooks/use-theme'

// TODO: Remove this once toast doesn't throw a warning.
LogBox.ignoreLogs([
/^\[react-native-gesture-handler\]/,
])

export const unstable_settings = {
// Ensure that reloading on `/settings` keeps a back button present.
initialRouteName: '(app)',
Expand Down Expand Up @@ -119,7 +124,7 @@ export default function Root() {
<BottomSheetModalProvider>
<ModalProvider stack={stack}>
<Slot />
<Toaster position="bottom-center" offset={50} duration={1000} />
<Toaster position="bottom-center" offset={70} duration={1000} />
</ModalProvider>
</BottomSheetModalProvider>
</GestureHandlerRootView>
Expand Down
2 changes: 1 addition & 1 deletion components/entry-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import type { SwipeableMethods } from 'react-native-gesture-handler/ReanimatedSw
import ReanimatedSwipeable from 'react-native-gesture-handler/ReanimatedSwipeable'
import type { SharedValue } from 'react-native-reanimated'
import Reanimated, { useAnimatedStyle } from 'react-native-reanimated'
import { toast } from 'react-native-reanimated-toasts'
import TrackPlayer, { usePlaybackState } from 'react-native-track-player'
import { createStyleSheet, useStyles } from 'react-native-unistyles'
import { toast } from 'sonner-native'
import { unstable_serialize } from 'swr'

import { checkNotExistEntries, flagEntryReadStatus } from '~/api/entry'
Expand Down

0 comments on commit 405bef8

Please sign in to comment.