Skip to content

Commit

Permalink
fix: 修复showToast图标错误 (#11666)
Browse files Browse the repository at this point in the history
Co-authored-by: lixiaobing <[email protected]>
Co-authored-by: tony chen <[email protected]>
  • Loading branch information
3 people authored Apr 19, 2022
1 parent bb62ad5 commit 10f01bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Binary file added packages/taro-rn/src/lib/showModal/error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion packages/taro-rn/src/lib/showModal/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
import { View, Text, Image, StyleSheet, ActivityIndicator } from 'react-native'
import RootSiblings from 'react-native-root-siblings'
import successPng from './success.png'
import errorPng from './error.png'
import { errorHandler, shouldBeObject, successHandler } from '../../utils'

const globalAny: any = global
Expand Down Expand Up @@ -148,7 +149,7 @@ function showToast (options: Taro.showToast.Option): Promise<TaroGeneral.Callbac
ToastView = <View style={maskStyle}>
<View style={styles.grayBlock}>
<View style={styles.toastView}>
<Image source={successPng} style={styles.toastIcon} />
<Image source={icon === 'error' ? errorPng : successPng} style={styles.toastIcon} />
<Text style={styles.toastContent}>{title || ''}</Text>
</View>
</View>
Expand Down

0 comments on commit 10f01bf

Please sign in to comment.