Skip to content

Commit a5ece90

Browse files
Merge pull request #241 from galio-org/dev
v0.8.0
2 parents 01f0f3d + f492bbc commit a5ece90

File tree

7 files changed

+361
-14
lines changed

7 files changed

+361
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "galio-framework",
33
"main": "src/index.js",
4-
"version": "0.7.1",
4+
"version": "0.8.0",
55
"files": [
66
"src/"
77
],

src/Avatar.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { View, Text, StyleSheet, Image, ViewPropTypes } from 'react-native';
2+
import { View, Text, StyleSheet, Image } from 'react-native';
33
import PropTypes from 'prop-types';
44
import { withGalio } from 'theme';
55

@@ -87,12 +87,14 @@ Avatar.propTypes = {
8787
backgroundColor: PropTypes.string,
8888
imageProps: PropTypes.object,
8989
imageStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]),
90-
containerStyle: ViewPropTypes.style,
90+
containerStyle: PropTypes.shape({
91+
style: PropTypes.any,
92+
}),
9193
styles: PropTypes.any,
9294
theme: PropTypes.any,
9395
};
9496

95-
const styles = theme =>
97+
const styles = (theme) =>
9698
StyleSheet.create({
9799
labelContainerWithInset: {
98100
top: 1,

src/Block.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Block.propTypes = {
9393
card: PropTypes.bool,
9494
left: PropTypes.bool,
9595
shadow: PropTypes.bool,
96-
space: PropTypes.string,
96+
space: PropTypes.oneOf(['between', 'around', 'evenly' ]),
9797
fluid: PropTypes.bool,
9898
height: PropTypes.number,
9999
width: PropTypes.number,

src/NavBar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ function NavBar({
3030
theme,
3131
title,
3232
titleStyle,
33+
titleNumberOfLines,
34+
titleTextProps,
3335
}) {
3436
function renderTitle() {
3537
if (typeof title === 'string') {
3638
return (
3739
<View style={styles.title}>
38-
<Text style={[styles.titleTextStyle, titleStyle]}>{title}</Text>
40+
<Text numberOfLines={titleNumberOfLines || 1} style={[styles.titleTextStyle, titleStyle]} {...titleTextProps}>{title}</Text>
3941
</View>
4042
);
4143
}

src/Toast.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { Component } from 'react';
2-
import { Dimensions, StyleSheet, Animated, ViewPropTypes } from 'react-native';
2+
import { Dimensions, StyleSheet, Animated } from 'react-native';
33
import PropTypes from 'prop-types';
4-
// galio components
4+
// Galio components
55
import Text from './atomic/ions/Text';
66
import GalioTheme, { withGalio } from './theme';
77

@@ -20,10 +20,15 @@ class Toast extends Component {
2020
PropTypes.string,
2121
]),
2222
round: PropTypes.bool,
23-
style: ViewPropTypes.style,
24-
textStyle: ViewPropTypes.style,
23+
style: PropTypes.shape({
24+
style: PropTypes.any,
25+
}),
26+
textStyle: PropTypes.shape({
27+
style: PropTypes.any,
28+
}),
2529
styles: PropTypes.any,
2630
theme: PropTypes.any,
31+
useNativeDriver: PropTypes.bool
2732
};
2833

2934
static defaultProps = {
@@ -37,6 +42,7 @@ class Toast extends Component {
3742
textStyle: null,
3843
styles: {},
3944
theme: GalioTheme,
45+
useNativeDriver: true
4046
};
4147

4248
state = {
@@ -49,7 +55,7 @@ class Toast extends Component {
4955
visibilityTimeout;
5056

5157
componentDidUpdate(prevProps) {
52-
const { isShow, fadeInDuration, fadeOutDuration } = this.props;
58+
const { isShow, fadeInDuration, fadeOutDuration, useNativeDriver } = this.props;
5359
const { isShow: prevIsShow } = prevProps;
5460
const { fadeAnim } = this.state;
5561

@@ -59,13 +65,15 @@ class Toast extends Component {
5965
this.animation = Animated.timing(fadeAnim, {
6066
toValue: 1,
6167
duration: fadeInDuration,
68+
useNativeDriver,
6269
}).start();
6370
}
6471

6572
if (prevIsShow && !isShow) {
6673
this.animation = Animated.timing(fadeAnim, {
6774
toValue: 0,
6875
duration: fadeOutDuration,
76+
useNativeDriver,
6977
}).start();
7078

7179
this.visibilityTimeout = setTimeout(() => {
@@ -84,7 +92,7 @@ class Toast extends Component {
8492
}
8593
}
8694

87-
setVisibility = isShow => this.setState({ isShow });
95+
setVisibility = (isShow) => this.setState({ isShow });
8896

8997
getTopPosition = () => {
9098
const { positionIndicator, positionOffset } = this.props;
@@ -135,7 +143,7 @@ class Toast extends Component {
135143
}
136144
}
137145

138-
const styles = theme =>
146+
const styles = (theme) =>
139147
StyleSheet.create({
140148
toast: {
141149
padding: theme.SIZES.BASE,

src/atomic/atoms/Button.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function Button({
1919
iconColor,
2020
loading,
2121
loadingSize,
22+
loadingColor,
2223
lowercase,
2324
onlyIcon,
2425
opacity,
@@ -90,7 +91,7 @@ function Button({
9091
}
9192

9293
if (loading) {
93-
content = <ActivityIndicator size={loadingSize} color={theme.COLORS.WHITE} />;
94+
content = <ActivityIndicator size={loadingSize} color={loadingColor || theme.COLORS.WHITE} />;
9495
}
9596

9697
return content;

0 commit comments

Comments
 (0)