update sorting
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import {type Theme, select} from '#/alf'
|
||||
import {CircleInfo_Stroke2_Corner0_Rounded as ErrorIcon} from '#/components/icons/CircleInfo'
|
||||
import {Warning_Stroke2_Corner0_Rounded as WarningIcon} from '#/components/icons/Warning'
|
||||
import {Check_Stroke2_Corner0_Rounded as SuccessIcon} from '#/components/icons/Check'
|
||||
import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/icons/CircleInfo'
|
||||
import {CircleInfo_Stroke2_Corner0_Rounded as ErrorIcon} from '#/components/icons/CircleInfo'
|
||||
import {type Theme, select} from '#/alf'
|
||||
import {Warning_Stroke2_Corner0_Rounded as WarningIcon} from '#/components/icons/Warning'
|
||||
|
||||
export type ToastType = 'default' | 'success' | 'error' | 'warning' | 'info'
|
||||
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||
import {
|
||||
type ToastType,
|
||||
getToastTypeStyles,
|
||||
TOAST_ANIMATION_CONFIG,
|
||||
TOAST_TYPE_TO_ICON,
|
||||
} from '#/view/com/util/Toast.style'
|
||||
import {useEffect, useMemo, useRef, useState} from 'react'
|
||||
import {AccessibilityInfo, View} from 'react-native'
|
||||
import {
|
||||
@@ -17,15 +26,6 @@ import Animated, {
|
||||
} from 'react-native-reanimated'
|
||||
import RootSiblings from 'react-native-root-siblings'
|
||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {
|
||||
type ToastType,
|
||||
TOAST_TYPE_TO_ICON,
|
||||
getToastTypeStyles,
|
||||
TOAST_ANIMATION_CONFIG,
|
||||
} from '#/view/com/util/Toast.style'
|
||||
|
||||
const TIMEOUT = 2e3
|
||||
|
||||
|
||||
@@ -4,14 +4,15 @@
|
||||
|
||||
import {useEffect, useState} from 'react'
|
||||
import {Pressable, StyleSheet, Text, View} from 'react-native'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
|
||||
import {
|
||||
type ToastType,
|
||||
TOAST_TYPE_TO_ICON,
|
||||
getToastTypeStyles,
|
||||
getToastWebAnimationStyles,
|
||||
TOAST_TYPE_TO_ICON,
|
||||
TOAST_WEB_KEYFRAMES,
|
||||
type ToastType,
|
||||
} from '#/view/com/util/Toast.style'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
|
||||
const DURATION = 3500
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import {View, Pressable} from 'react-native'
|
||||
import {Pressable,View} from 'react-native'
|
||||
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {Text, H1} from '#/components/Typography'
|
||||
import {
|
||||
type ToastType,
|
||||
TOAST_TYPE_TO_ICON,
|
||||
getToastTypeStyles,
|
||||
} from '#/view/com/util/Toast.style'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
import {
|
||||
getToastTypeStyles,
|
||||
TOAST_TYPE_TO_ICON,
|
||||
type ToastType,
|
||||
} from '#/view/com/util/Toast.style'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {H1,Text} from '#/components/Typography'
|
||||
|
||||
function ToastPreview({message, type}: {message: string; type: ToastType}) {
|
||||
const t = useTheme()
|
||||
@@ -16,7 +16,7 @@ function ToastPreview({message, type}: {message: string; type: ToastType}) {
|
||||
const IconComponent = TOAST_TYPE_TO_ICON[type]
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
<Pressable accessibilityRole="button"
|
||||
onPress={() => Toast.show(message, type)}
|
||||
style={[
|
||||
{backgroundColor: colors.backgroundColor},
|
||||
|
||||
Reference in New Issue
Block a user