Skip to content

Commit

Permalink
Merge branch 'dev' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
palingheorghe authored Mar 29, 2021
2 parents 8e82e99 + b92a3dc commit 04aabe4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Block.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Block.propTypes = {
card: PropTypes.bool,
left: PropTypes.bool,
shadow: PropTypes.bool,
space: PropTypes.string,
space: PropTypes.oneOf(['between', 'around', 'evenly' ]),
fluid: PropTypes.bool,
height: PropTypes.number,
width: PropTypes.number,
Expand Down
8 changes: 6 additions & 2 deletions src/Toast.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { Dimensions, StyleSheet, Animated } from 'react-native';
import PropTypes from 'prop-types';
// galio components
// Galio components
import Text from './atomic/ions/Text';
import GalioTheme, { withGalio } from './theme';

Expand All @@ -28,6 +28,7 @@ class Toast extends Component {
}),
styles: PropTypes.any,
theme: PropTypes.any,
useNativeDriver: PropTypes.bool
};

static defaultProps = {
Expand All @@ -41,6 +42,7 @@ class Toast extends Component {
textStyle: null,
styles: {},
theme: GalioTheme,
useNativeDriver: true
};

state = {
Expand All @@ -53,7 +55,7 @@ class Toast extends Component {
visibilityTimeout;

componentDidUpdate(prevProps) {
const { isShow, fadeInDuration, fadeOutDuration } = this.props;
const { isShow, fadeInDuration, fadeOutDuration, useNativeDriver } = this.props;
const { isShow: prevIsShow } = prevProps;
const { fadeAnim } = this.state;

Expand All @@ -63,13 +65,15 @@ class Toast extends Component {
this.animation = Animated.timing(fadeAnim, {
toValue: 1,
duration: fadeInDuration,
useNativeDriver,
}).start();
}

if (prevIsShow && !isShow) {
this.animation = Animated.timing(fadeAnim, {
toValue: 0,
duration: fadeOutDuration,
useNativeDriver,
}).start();

this.visibilityTimeout = setTimeout(() => {
Expand Down

0 comments on commit 04aabe4

Please sign in to comment.