completely rearchitect toasts

This commit is contained in:
Samuel Newman
2025-04-28 16:17:56 +03:00
parent 4fd42d9adf
commit 2e2fcaeeed
4 changed files with 115 additions and 90 deletions
+4 -5
View File
@@ -2,12 +2,12 @@
* Note: the dataSet properties are used to leverage custom CSS in public/index.html
*/
import React, {useEffect, useState} from 'react'
import {useEffect, useState} from 'react'
import {Pressable, StyleSheet, Text, View} from 'react-native'
import {
FontAwesomeIcon,
FontAwesomeIconStyle,
Props as FontAwesomeProps,
type FontAwesomeIconStyle,
type Props as FontAwesomeProps,
} from '@fortawesome/react-native-fontawesome'
const DURATION = 3500
@@ -25,8 +25,7 @@ let toastTimeout: NodeJS.Timeout | undefined
// components
// =
type ToastContainerProps = {}
export const ToastContainer: React.FC<ToastContainerProps> = ({}) => {
export function ToastContainer() {
const [activeToast, setActiveToast] = useState<ActiveToast | undefined>()
useEffect(() => {
globalSetActiveToast = (t: ActiveToast | undefined) => {