Files
mobile-darmasaba/components/toastCustom.tsx
2026-02-23 14:20:26 +08:00

25 lines
821 B
TypeScript

import Styles from "@/constants/Styles";
import { useTheme } from "@/providers/ThemeProvider";
import { View } from "react-native";
import Toast from "react-native-toast-message";
import Text from "./Text";
export default function ToastCustom({ position }: { position?: 'top' | 'bottom' }) {
const { colors } = useTheme()
return (
<Toast
autoHide
onPress={() => Toast.hide()}
visibilityTime={1500}
position={position || 'bottom'}
bottomOffset={80}
config={{
small: ({ text1 }) => (
<View style={[Styles.toastContainer, { backgroundColor: colors.modalBackground, borderColor: colors.icon + '20' }]}>
<Text style={{ fontSize: 12 }}>{text1}</Text>
</View>
)
}}
/>
)
}