Skip to content

Commit

Permalink
Merge pull request #241 from galio-org/dev
Browse files Browse the repository at this point in the history
v0.8.0
  • Loading branch information
palingheorghe authored Mar 30, 2021
2 parents 01f0f3d + f492bbc commit a5ece90
Show file tree
Hide file tree
Showing 7 changed files with 361 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "galio-framework",
"main": "src/index.js",
"version": "0.7.1",
"version": "0.8.0",
"files": [
"src/"
],
Expand Down
8 changes: 5 additions & 3 deletions src/Avatar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { View, Text, StyleSheet, Image, ViewPropTypes } from 'react-native';
import { View, Text, StyleSheet, Image } from 'react-native';
import PropTypes from 'prop-types';
import { withGalio } from 'theme';

Expand Down Expand Up @@ -87,12 +87,14 @@ Avatar.propTypes = {
backgroundColor: PropTypes.string,
imageProps: PropTypes.object,
imageStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]),
containerStyle: ViewPropTypes.style,
containerStyle: PropTypes.shape({
style: PropTypes.any,
}),
styles: PropTypes.any,
theme: PropTypes.any,
};

const styles = theme =>
const styles = (theme) =>
StyleSheet.create({
labelContainerWithInset: {
top: 1,
Expand Down
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
4 changes: 3 additions & 1 deletion src/NavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ function NavBar({
theme,
title,
titleStyle,
titleNumberOfLines,
titleTextProps,
}) {
function renderTitle() {
if (typeof title === 'string') {
return (
<View style={styles.title}>
<Text style={[styles.titleTextStyle, titleStyle]}>{title}</Text>
<Text numberOfLines={titleNumberOfLines || 1} style={[styles.titleTextStyle, titleStyle]} {...titleTextProps}>{title}</Text>
</View>
);
}
Expand Down
22 changes: 15 additions & 7 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, ViewPropTypes } from 'react-native';
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 @@ -20,10 +20,15 @@ class Toast extends Component {
PropTypes.string,
]),
round: PropTypes.bool,
style: ViewPropTypes.style,
textStyle: ViewPropTypes.style,
style: PropTypes.shape({
style: PropTypes.any,
}),
textStyle: PropTypes.shape({
style: PropTypes.any,
}),
styles: PropTypes.any,
theme: PropTypes.any,
useNativeDriver: PropTypes.bool
};

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

state = {
Expand All @@ -49,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 @@ -59,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 All @@ -84,7 +92,7 @@ class Toast extends Component {
}
}

setVisibility = isShow => this.setState({ isShow });
setVisibility = (isShow) => this.setState({ isShow });

getTopPosition = () => {
const { positionIndicator, positionOffset } = this.props;
Expand Down Expand Up @@ -135,7 +143,7 @@ class Toast extends Component {
}
}

const styles = theme =>
const styles = (theme) =>
StyleSheet.create({
toast: {
padding: theme.SIZES.BASE,
Expand Down
3 changes: 2 additions & 1 deletion src/atomic/atoms/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function Button({
iconColor,
loading,
loadingSize,
loadingColor,
lowercase,
onlyIcon,
opacity,
Expand Down Expand Up @@ -90,7 +91,7 @@ function Button({
}

if (loading) {
content = <ActivityIndicator size={loadingSize} color={theme.COLORS.WHITE} />;
content = <ActivityIndicator size={loadingSize} color={loadingColor || theme.COLORS.WHITE} />;
}

return content;
Expand Down
Loading

0 comments on commit a5ece90

Please sign in to comment.