11import { Link } from "expo-router" ;
22import { View } from "react-native" ;
3+ import { type ToastConfig } from "react-native-toast-message" ;
34import { CheckCircleIcon , XCircleIcon } from "~/components/Icons" ;
45import { Button } from "./ui/button" ;
56import { Text } from "./ui/text" ;
67
7- export const toastConfig = {
8- success : ( { text1, text2 } : { text1 : string ; text2 : string } ) => (
8+ export const toastConfig : ToastConfig = {
9+ success : ( { text1, text2 } ) => (
910 < View className = "bg-foreground rounded-xl px-6 py-3 mx-6" >
1011 < View className = "flex flex-row gap-2 justify-center items-center" >
1112 < CheckCircleIcon className = "text-background" width = { 16 } height = { 16 } />
@@ -14,7 +15,7 @@ export const toastConfig = {
1415 { text2 && < Text className = "text-background text-center" > { text2 } </ Text > }
1516 </ View >
1617 ) ,
17- info : ( { text1, text2 } : { text1 : string ; text2 : string } ) => (
18+ info : ( { text1, text2, hide } ) => (
1819 < View className = "bg-yellow-500 rounded-full px-6 py-3 mx-6" >
1920 < View className = "flex flex-row gap-2 justify-center items-center" >
2021 < XCircleIcon className = "text-background" width = { 16 } height = { 16 } />
@@ -23,7 +24,7 @@ export const toastConfig = {
2324 { text2 && < Text className = "text-background text-center" > { text2 } </ Text > }
2425 </ View >
2526 ) ,
26- error : ( { text1, text2 } : { text1 : string ; text2 : string } ) => (
27+ error : ( { text1, text2, hide } ) => (
2728 < View className = "bg-destructive rounded-xl px-6 py-3 mx-6" >
2829 < View className = "flex flex-row gap-2 justify-center items-center" >
2930 < XCircleIcon className = "text-background" width = { 16 } height = { 16 } />
@@ -32,7 +33,7 @@ export const toastConfig = {
3233 { text2 && < Text className = "text-background text-center" > { text2 } </ Text > }
3334 </ View >
3435 ) ,
35- connectionError : ( { text1 } : { text1 : string } ) => {
36+ connectionError : ( { text1, text2 , hide } ) => {
3637 return (
3738 < View className = "bg-foreground rounded-xl px-6 py-3 mx-6 flex flex-col gap-2" >
3839 < View className = "flex flex-row gap-2 justify-center items-center" >
0 commit comments