From dc8b6d8a2f0e24049e8f4a858b63cd223c4f2a68 Mon Sep 17 00:00:00 2001 From: Wiloke Date: Thu, 19 Dec 2019 00:19:23 +0700 Subject: [PATCH 01/14] add declaration file (index.d.ts) --- src/index.d.ts | 237 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 src/index.d.ts diff --git a/src/index.d.ts b/src/index.d.ts new file mode 100644 index 0000000..d3f157f --- /dev/null +++ b/src/index.d.ts @@ -0,0 +1,237 @@ +import React, { ReactNode } from 'react'; +import { + TouchableOpacityProps, + ImageStyle, + ViewStyle, + TextStyle, + SwitchProps as RNSwitchProps, +} from 'react-native'; + +declare module 'galio-framework' { + type IconFamilyType = + | 'Galio' + | 'antdesign' + | 'FontAwesome' + | 'Entypo' + | 'EvilIcons' + | 'Feather' + | 'FontAwesome5' + | 'FontAwesome5Brands' + | 'Fontisto' + | 'Foundation' + | 'Ionicons' + | 'MaterialCommunityIcons' + | 'MaterialIcons' + | 'SimpleLineIcons' + | 'Octicons' + | 'Zocial'; + + type BaseColorType = string; + + type ButtonColorType = string; + + interface BaseProps { + [key: string]: any; + } + + export interface BlockProps extends BaseProps { + bottom?: boolean; + card?: boolean; + center?: boolean; + flex?: boolean | number; + fluid?: boolean; + height?: number; + left?: boolean; + middle?: boolean; + right?: boolean; + row?: boolean; + safe?: boolean; + shadow?: boolean; + shadowColor?: boolean; + space?: string; + top?: boolean; + width?: number; + } + export class Block extends React.Component {} + + export interface ButtonProps extends TouchableOpacityProps, BaseProps { + capitalize?: boolean; + color?: ButtonColorType; + disabled?: boolean; + icon?: boolean; + iconColor?: boolean | string; + iconFamily?: boolean | string; + iconSize?: number; + loading?: boolean; + loadingSize?: 'small' | 'large'; + lowercase?: boolean; + onlyIcon?: boolean; + opacity?: number; + radius?: number; + shadowColor?: boolean | string; + shadowless?: boolean; + size?: 'small' | 'large'; + uppercase?: boolean; + } + export class Button extends React.Component {} + + export interface CardProps extends BaseProps { + card?: boolean; + shadow?: boolean; + borderless?: boolean; + image?: string; + imageBlockStyle?: strubg; + imageStyle?: ImageStyle; + avatar?: string; + location?: string; + locationColor?: boolean | string; + title?: string; + titleColor?: string; + caption?: string; + captionColor?: string; + footerStyle?: ViewStyle; + } + export class Card extends React.Component {} + + export interface CheckBoxProps extends BaseProps { + checkboxStyle?: ViewStyle; + disabled?: boolean; + flexDirection?: ViewStyle['flexDirection']; + iconName?: string; + iconSize?: number; + iconFamily?: IconFamilyType; + image?: string; + imageStyle?: ImageStyle; + initialValue?: boolean; + label?: string; + labelStyle?: TextStyle; + onChange?: () => void; + } + export class CheckBox extends React.Component {} + + export interface DeckSwiperProps extends BaseProps { + style?: ViewStyle; + components?: ReactNode[]; + onSwipeRight?: () => void; + onSwipeLeft?: () => void; + focusedElementStyle?: ViewStyle; + nextElementStyle?: ViewStyle; + } + export class DeckSwiper extends React.Component {} + + export interface Icon extends BaseProps { + name?: string; + family?: IconFamilyType; + size?: number; + color?: string; + } + export class Icon extends React.Component {} + + export interface InputProps extends BaseProps { + type?: 'default' | 'number-pad' | 'decimal-pad' | 'numeric' | 'email-address' | 'phone-pad'; + password?: boolean; + placeholderTextColor?: string; + label?: string; + bgColor?: string; + rounded?: boolean; + borderless?: boolean; + viewPass?: boolean; + icon?: string; + iconColor?: string; + family?: IconFamilyType; + color?: string; + help?: string; + left?: boolean; + right?: boolean; + topHelp?: boolean; + bottomHelp?: boolean; + placeholder?: string; + iconSize?: number; + onChangeText?: (text: string) => void; + } + export class Input extends React.Component {} + + export interface NavBarProps extends BaseProps { + back?: boolean; + transparent?: boolean; + title?: ReactNode; + titleStyle?: ViewStyle; + left?: ReactNode; + leftStyle?: ViewStyle; + leftIconColor?: string; + right?: ReactNode; + rightStyle?: ViewStyle; + onLeftPress?: () => void; + } + export class NavBar extends React.Component {} + + export interface RadioProps extends BaseProps { + color?: string; + containerStyle?: ViewStyle; + radioOuterStyle?: ViewStyle; + radioInnerStyle?: ViewStyle; + flexDirection?: ViewStyle['flexDirection']; + initialValue?: boolean; + label?: string; + labelStyle?: TextStyle; + onChange?: () => void; + } + export class Radio extends React.Component {} + + export interface TextProps extends BaseProps { + h1?: boolean; + h2?: boolean; + h3?: boolean; + h4?: boolean; + h5?: boolean; + p?: boolean; + size?: number; + color?: string; + muted?: boolean; + bold?: boolean; + italic?: boolean; + } + export class Text extends React.Component {} + + export interface ToastProps extends BaseProps { + style?: ViewStyle; + children?: ReactNode; + isShow?: boolean; + positionIndicator?: 'top' | 'center' | 'bottom'; + positionOffset?: number; + fadeInDuration?: number; + fadeOutDuration?: number; + color?: BaseColorType; + round?: boolean; + textStyle?: TextStyle; + } + export class Toast extends React.Component {} + + export interface SliderProps extends BaseProps { + activeColor?: string; + value?: number; + disabled?: boolean; + minimumValue?: number; + maximumValue?: number; + trackStyle?: ViewStyle; + thumbStyle?: ViewStyle; + step?: number; + onSlidingComplete?: () => void; + onSlidingStart?: () => void; + onValueChange?: () => void; + } + export class Slider extends React.Component {} + + export interface SwitchProps extends RNSwitchProps, BaseProps { + color?: BaseColorType; + disabled?: boolean; + initialValue?: boolean; + trackColor?: { + false: string; + true: string; + }; + ios_backgroundColor?: string; + onChange?: () => void; + } + export class Switch extends React.Component {} +} From 27d319e77827cd20fa384dcd8097193b2fd3d641 Mon Sep 17 00:00:00 2001 From: Wiloke Date: Thu, 19 Dec 2019 10:02:36 +0700 Subject: [PATCH 02/14] fix Icon -> IconProps and IconFamilyType --- src/index.d.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index d3f157f..460940b 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -10,21 +10,20 @@ import { declare module 'galio-framework' { type IconFamilyType = | 'Galio' - | 'antdesign' - | 'FontAwesome' + | 'AntDesign' | 'Entypo' | 'EvilIcons' | 'Feather' + | 'FontAwesome' | 'FontAwesome5' - | 'FontAwesome5Brands' | 'Fontisto' | 'Foundation' | 'Ionicons' - | 'MaterialCommunityIcons' | 'MaterialIcons' - | 'SimpleLineIcons' + | 'MaterialCommunityIcons' | 'Octicons' - | 'Zocial'; + | 'Zocial' + | 'SimpleLineIcons'; type BaseColorType = string; @@ -119,7 +118,7 @@ declare module 'galio-framework' { } export class DeckSwiper extends React.Component {} - export interface Icon extends BaseProps { + export interface IconProps extends BaseProps { name?: string; family?: IconFamilyType; size?: number; From a1a4ddb816eb47cccff9e09072572c86937f20fe Mon Sep 17 00:00:00 2001 From: Wiloke Date: Thu, 19 Dec 2019 10:32:35 +0700 Subject: [PATCH 03/14] add type GalioProvider + withGalio --- src/index.d.ts | 83 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index 460940b..6adfa76 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,4 +1,4 @@ -import React, { ReactNode } from 'react'; +import React, { ReactNode, ComponentType } from 'react'; import { TouchableOpacityProps, ImageStyle, @@ -233,4 +233,85 @@ declare module 'galio-framework' { onChange?: () => void; } export class Switch extends React.Component {} + + export interface GalioProviderProps extends BaseProps { + theme: { + SIZES?: { + BASE?: number; + FONT?: number; + ICON?: number; + OPACITY?: number; + BORDER_RADIUS?: number; + BORDER_WIDTH?: number; + BUTTON_WIDTH?: number; + BUTTON_HEIGHT?: number; + BUTTON_SHADOW_RADIUS?: number; + BLOCK_SHADOW_OPACITY?: number; + BLOCK_SHADOW_RADIUS?: number; + ANDROID_ELEVATION?: number; + CARD_BORDER_RADIUS?: number; + CARD_BORDER_WIDTH?: number; + CARD_WIDTH?: number; + CARD_MARGIN_VERTICAL?: number; + CARD_FOOTER_HORIZONTAL?: number; + CARD_FOOTER_VERTICAL?: number; + CARD_AVATAR_WIDTH?: number; + CARD_AVATAR_HEIGHT?: number; + CARD_AVATAR_RADIUS?: number; + CARD_IMAGE_HEIGHT?: number; + CARD_ROUND?: number; + CARD_ROUNDED?: number; + INPUT_BORDER_RADIUS?: number; + INPUT_BORDER_WIDTH?: number; + INPUT_HEIGHT?: number; + INPUT_HORIZONTAL?: number; + INPUT_TEXT?: number; + INPUT_LABEL_TEXT?: number; + INPUT_LABEL_BOTTOM?: number; + INPUT_HELP_TEXT?: number; + INPUT_ROUNDED?: number; + NAVBAR_HEIGHT?: number; + NAVBAR_VERTICAL?: number; + NAVBAR_TITLE_FLEX?: number; + NAVBAR_TITLE_HEIGHT?: number; + NAVBAR_TITLE_TEXT?: number; + NAVBAR_LEFT_FLEX?: number; + NAVBAR_LEFT_HEIGHT?: number; + NAVBAR_LEFT_MARGIN?: number; + NAVBAR_RIGHT_FLEX?: number; + NAVBAR_RIGHT_HEIGHT?: number; + NAVBAR_RIGHT_MARGIN?: number; + [key: string]: number; + }; + COLORS?: { + FACEBOOK?: string; + TWITTER?: string; + DRIBBBLE?: string; + THEME?: string; + PRIMARY?: string; + INFO?: string; + ERROR?: string; + WARNING?: string; + INPUT?: string; + PLACEHOLDER?: string; + NAVBAR?: string; + BLOCK?: string; + ICON?: string; + WHITE?: string; + BLACK?: string; + GREY?: string; + MUTED?: string; + TRANSPARENT?: string; + NEUTRAL?: string; + [key: string]: string; + }; + }; + } + export class GalioProvider extends React.Component {} + + type NamedStyles = ViewStyle | TextStyle | ImageStyle; + export function withGalio>( + Component: T, + styles: NamedStyles + ): ComponentType; } From c51e0979c8836c433bb78ab00e6a75d19371c9d5 Mon Sep 17 00:00:00 2001 From: Wiloke Date: Thu, 19 Dec 2019 10:51:27 +0700 Subject: [PATCH 04/14] update InputProps extends TextInputProps of RN --- src/index.d.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 6adfa76..2f23d28 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -5,6 +5,7 @@ import { ViewStyle, TextStyle, SwitchProps as RNSwitchProps, + TextInputProps, } from 'react-native'; declare module 'galio-framework' { @@ -126,10 +127,18 @@ declare module 'galio-framework' { } export class Icon extends React.Component {} - export interface InputProps extends BaseProps { - type?: 'default' | 'number-pad' | 'decimal-pad' | 'numeric' | 'email-address' | 'phone-pad'; + export interface InputProps + extends Omit< + TextInputProps, + | 'style' + | 'keyboardType' + | 'secureTextEntry' + | 'placeholderTextColor' + | 'underlineColorAndroid' + >, + BaseProps { + type?: TextInputProps['keyboardType']; password?: boolean; - placeholderTextColor?: string; label?: string; bgColor?: string; rounded?: boolean; @@ -144,9 +153,7 @@ declare module 'galio-framework' { right?: boolean; topHelp?: boolean; bottomHelp?: boolean; - placeholder?: string; iconSize?: number; - onChangeText?: (text: string) => void; } export class Input extends React.Component {} From b83a9888a8b0b82192c79916f840f6902d8816fd Mon Sep 17 00:00:00 2001 From: Wiloke Date: Thu, 19 Dec 2019 12:01:51 +0700 Subject: [PATCH 05/14] add size number ButtonProps --- src/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index 2f23d28..f4d2c99 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -70,7 +70,7 @@ declare module 'galio-framework' { radius?: number; shadowColor?: boolean | string; shadowless?: boolean; - size?: 'small' | 'large'; + size?: 'small' | 'large' | number; uppercase?: boolean; } export class Button extends React.Component {} From afa422cb373ccffcd70bac1162dfbced9d1116f8 Mon Sep 17 00:00:00 2001 From: Wiloke Date: Thu, 19 Dec 2019 12:14:31 +0700 Subject: [PATCH 06/14] add type for object theme --- src/index.d.ts | 144 +++++++++++++++++++++++++------------------------ 1 file changed, 73 insertions(+), 71 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index f4d2c99..1ebd44c 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -241,79 +241,81 @@ declare module 'galio-framework' { } export class Switch extends React.Component {} - export interface GalioProviderProps extends BaseProps { - theme: { - SIZES?: { - BASE?: number; - FONT?: number; - ICON?: number; - OPACITY?: number; - BORDER_RADIUS?: number; - BORDER_WIDTH?: number; - BUTTON_WIDTH?: number; - BUTTON_HEIGHT?: number; - BUTTON_SHADOW_RADIUS?: number; - BLOCK_SHADOW_OPACITY?: number; - BLOCK_SHADOW_RADIUS?: number; - ANDROID_ELEVATION?: number; - CARD_BORDER_RADIUS?: number; - CARD_BORDER_WIDTH?: number; - CARD_WIDTH?: number; - CARD_MARGIN_VERTICAL?: number; - CARD_FOOTER_HORIZONTAL?: number; - CARD_FOOTER_VERTICAL?: number; - CARD_AVATAR_WIDTH?: number; - CARD_AVATAR_HEIGHT?: number; - CARD_AVATAR_RADIUS?: number; - CARD_IMAGE_HEIGHT?: number; - CARD_ROUND?: number; - CARD_ROUNDED?: number; - INPUT_BORDER_RADIUS?: number; - INPUT_BORDER_WIDTH?: number; - INPUT_HEIGHT?: number; - INPUT_HORIZONTAL?: number; - INPUT_TEXT?: number; - INPUT_LABEL_TEXT?: number; - INPUT_LABEL_BOTTOM?: number; - INPUT_HELP_TEXT?: number; - INPUT_ROUNDED?: number; - NAVBAR_HEIGHT?: number; - NAVBAR_VERTICAL?: number; - NAVBAR_TITLE_FLEX?: number; - NAVBAR_TITLE_HEIGHT?: number; - NAVBAR_TITLE_TEXT?: number; - NAVBAR_LEFT_FLEX?: number; - NAVBAR_LEFT_HEIGHT?: number; - NAVBAR_LEFT_MARGIN?: number; - NAVBAR_RIGHT_FLEX?: number; - NAVBAR_RIGHT_HEIGHT?: number; - NAVBAR_RIGHT_MARGIN?: number; - [key: string]: number; - }; - COLORS?: { - FACEBOOK?: string; - TWITTER?: string; - DRIBBBLE?: string; - THEME?: string; - PRIMARY?: string; - INFO?: string; - ERROR?: string; - WARNING?: string; - INPUT?: string; - PLACEHOLDER?: string; - NAVBAR?: string; - BLOCK?: string; - ICON?: string; - WHITE?: string; - BLACK?: string; - GREY?: string; - MUTED?: string; - TRANSPARENT?: string; - NEUTRAL?: string; - [key: string]: string; - }; + interface ThemeType { + SIZES?: { + BASE?: number; + FONT?: number; + ICON?: number; + OPACITY?: number; + BORDER_RADIUS?: number; + BORDER_WIDTH?: number; + BUTTON_WIDTH?: number; + BUTTON_HEIGHT?: number; + BUTTON_SHADOW_RADIUS?: number; + BLOCK_SHADOW_OPACITY?: number; + BLOCK_SHADOW_RADIUS?: number; + ANDROID_ELEVATION?: number; + CARD_BORDER_RADIUS?: number; + CARD_BORDER_WIDTH?: number; + CARD_WIDTH?: number; + CARD_MARGIN_VERTICAL?: number; + CARD_FOOTER_HORIZONTAL?: number; + CARD_FOOTER_VERTICAL?: number; + CARD_AVATAR_WIDTH?: number; + CARD_AVATAR_HEIGHT?: number; + CARD_AVATAR_RADIUS?: number; + CARD_IMAGE_HEIGHT?: number; + CARD_ROUND?: number; + CARD_ROUNDED?: number; + INPUT_BORDER_RADIUS?: number; + INPUT_BORDER_WIDTH?: number; + INPUT_HEIGHT?: number; + INPUT_HORIZONTAL?: number; + INPUT_TEXT?: number; + INPUT_LABEL_TEXT?: number; + INPUT_LABEL_BOTTOM?: number; + INPUT_HELP_TEXT?: number; + INPUT_ROUNDED?: number; + NAVBAR_HEIGHT?: number; + NAVBAR_VERTICAL?: number; + NAVBAR_TITLE_FLEX?: number; + NAVBAR_TITLE_HEIGHT?: number; + NAVBAR_TITLE_TEXT?: number; + NAVBAR_LEFT_FLEX?: number; + NAVBAR_LEFT_HEIGHT?: number; + NAVBAR_LEFT_MARGIN?: number; + NAVBAR_RIGHT_FLEX?: number; + NAVBAR_RIGHT_HEIGHT?: number; + NAVBAR_RIGHT_MARGIN?: number; + [key: string]: number; + }; + COLORS?: { + FACEBOOK?: string; + TWITTER?: string; + DRIBBBLE?: string; + THEME?: string; + PRIMARY?: string; + INFO?: string; + ERROR?: string; + WARNING?: string; + INPUT?: string; + PLACEHOLDER?: string; + NAVBAR?: string; + BLOCK?: string; + ICON?: string; + WHITE?: string; + BLACK?: string; + GREY?: string; + MUTED?: string; + TRANSPARENT?: string; + NEUTRAL?: string; + [key: string]: string; }; } + export const theme: ThemeType = {}; + export interface GalioProviderProps extends BaseProps { + theme: ThemeType; + } export class GalioProvider extends React.Component {} type NamedStyles = ViewStyle | TextStyle | ImageStyle; From ba180cc1aa5e35dc62c7d6ad2210f1a0544d0198 Mon Sep 17 00:00:00 2001 From: Wiloke Date: Thu, 19 Dec 2019 12:27:44 +0700 Subject: [PATCH 07/14] edit ButtonProps icon number -> string --- src/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index 1ebd44c..5e2fa33 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -58,7 +58,7 @@ declare module 'galio-framework' { capitalize?: boolean; color?: ButtonColorType; disabled?: boolean; - icon?: boolean; + icon?: string; iconColor?: boolean | string; iconFamily?: boolean | string; iconSize?: number; From 146717bde611458ed3413ecfbc46da55af6b69a9 Mon Sep 17 00:00:00 2001 From: Rufat Date: Wed, 22 Jul 2020 18:52:59 +0400 Subject: [PATCH 08/14] Adding "loadingColor" to Button.js There was not a proper way to change the loading color of button. So, I added a prop for that. --- src/atomic/atoms/Button.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/atomic/atoms/Button.js b/src/atomic/atoms/Button.js index 4121ff0..9b11c9b 100644 --- a/src/atomic/atoms/Button.js +++ b/src/atomic/atoms/Button.js @@ -19,6 +19,7 @@ function Button({ iconColor, loading, loadingSize, + loadingColor, lowercase, onlyIcon, opacity, @@ -90,7 +91,7 @@ function Button({ } if (loading) { - content = ; + content = ; } return content; From 1d877eed810d6f4814cd209f928b58c27f76d93b Mon Sep 17 00:00:00 2001 From: Rufat Date: Thu, 30 Jul 2020 17:23:32 +0400 Subject: [PATCH 09/14] NavBar titleNumberOfLines, titleTextProps added. --- src/NavBar.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/NavBar.js b/src/NavBar.js index 154ea6a..1df37e0 100644 --- a/src/NavBar.js +++ b/src/NavBar.js @@ -30,12 +30,14 @@ function NavBar({ theme, title, titleStyle, + titleNumberOfLines, + titleTextProps, }) { function renderTitle() { if (typeof title === 'string') { return ( - {title} + {title} ); } From 2b5faa0863818a3e0390c4fc94f93964295a07bf Mon Sep 17 00:00:00 2001 From: Adrian Nungka Date: Sat, 6 Feb 2021 15:34:35 +0800 Subject: [PATCH 10/14] Fix bug on animation useNativeDriver --- src/Toast.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Toast.js b/src/Toast.js index fc3b557..459d911 100644 --- a/src/Toast.js +++ b/src/Toast.js @@ -21,9 +21,10 @@ class Toast extends Component { ]), round: PropTypes.bool, style: ViewPropTypes.style, - textStyle: ViewPropTypes.style, + textStyle: PropTypes.object, styles: PropTypes.any, theme: PropTypes.any, + useNativeDriver: PropTypes.bool }; static defaultProps = { @@ -37,6 +38,7 @@ class Toast extends Component { textStyle: null, styles: {}, theme: GalioTheme, + useNativeDriver: true }; state = { @@ -49,7 +51,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; @@ -59,6 +61,7 @@ class Toast extends Component { this.animation = Animated.timing(fadeAnim, { toValue: 1, duration: fadeInDuration, + useNativeDriver, }).start(); } @@ -66,6 +69,7 @@ class Toast extends Component { this.animation = Animated.timing(fadeAnim, { toValue: 0, duration: fadeOutDuration, + useNativeDriver, }).start(); this.visibilityTimeout = setTimeout(() => { From 6067a8c2e03a2e01f8d790e3a1ba224b1637136f Mon Sep 17 00:00:00 2001 From: Adrian Nungka Date: Sat, 6 Feb 2021 15:35:03 +0800 Subject: [PATCH 11/14] fix space for selected options only --- src/Block.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Block.js b/src/Block.js index 19eaaf6..da038d4 100644 --- a/src/Block.js +++ b/src/Block.js @@ -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, From 8e82e9951a1c07b7db7deac09db67d5a553cf9c0 Mon Sep 17 00:00:00 2001 From: M1chael Date: Sat, 27 Feb 2021 21:17:30 +1100 Subject: [PATCH 12/14] remove `ViewPropTypes` as it has been deprecated --- src/Avatar.js | 8 +++++--- src/Toast.js | 14 +++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/Avatar.js b/src/Avatar.js index d331fbd..1e6fe0b 100644 --- a/src/Avatar.js +++ b/src/Avatar.js @@ -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'; @@ -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, diff --git a/src/Toast.js b/src/Toast.js index fc3b557..b9b7b9f 100644 --- a/src/Toast.js +++ b/src/Toast.js @@ -1,5 +1,5 @@ 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 import Text from './atomic/ions/Text'; @@ -20,8 +20,12 @@ 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, }; @@ -84,7 +88,7 @@ class Toast extends Component { } } - setVisibility = isShow => this.setState({ isShow }); + setVisibility = (isShow) => this.setState({ isShow }); getTopPosition = () => { const { positionIndicator, positionOffset } = this.props; @@ -135,7 +139,7 @@ class Toast extends Component { } } -const styles = theme => +const styles = (theme) => StyleSheet.create({ toast: { padding: theme.SIZES.BASE, From ec2c0198876e596c73674e8145f1c67b00cf268a Mon Sep 17 00:00:00 2001 From: palingheorghe Date: Mon, 29 Mar 2021 22:21:35 +0300 Subject: [PATCH 13/14] fixed warnings and added more props to typescript --- src/index.d.ts | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 5e2fa33..747700e 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -48,7 +48,7 @@ declare module 'galio-framework' { safe?: boolean; shadow?: boolean; shadowColor?: boolean; - space?: string; + space?: 'between' | 'around' | 'evenly'; top?: boolean; width?: number; } @@ -64,10 +64,11 @@ declare module 'galio-framework' { iconSize?: number; loading?: boolean; loadingSize?: 'small' | 'large'; + loadingColor?: string; lowercase?: boolean; onlyIcon?: boolean; opacity?: number; - radius?: number; + round?: boolean; shadowColor?: boolean | string; shadowless?: boolean; size?: 'small' | 'large' | number; @@ -80,7 +81,7 @@ declare module 'galio-framework' { shadow?: boolean; borderless?: boolean; image?: string; - imageBlockStyle?: strubg; + imageBlockStyle?: string; imageStyle?: ImageStyle; avatar?: string; location?: string; @@ -159,15 +160,21 @@ declare module 'galio-framework' { export interface NavBarProps extends BaseProps { back?: boolean; - transparent?: boolean; - title?: ReactNode; - titleStyle?: ViewStyle; + hideLeft?: boolean; + hideRight?: boolean; left?: ReactNode; - leftStyle?: ViewStyle; leftIconColor?: string; + leftIconFamily?: string; + leftIconName?: string; + leftIconSize?: number; + leftStyle?: ViewStyle; + onLeftPress?: () => void; right?: ReactNode; rightStyle?: ViewStyle; - onLeftPress?: () => void; + title?: ReactNode; + titleNumberOfLines?: number; + titleStyle?: ViewStyle; + transparent?: boolean; } export class NavBar extends React.Component {} @@ -210,6 +217,7 @@ declare module 'galio-framework' { color?: BaseColorType; round?: boolean; textStyle?: TextStyle; + useNativeDriver?: boolean; } export class Toast extends React.Component {} From f492bbc44271957ea03e3a61b62fc5a3b9d732a5 Mon Sep 17 00:00:00 2001 From: palingheorghe Date: Tue, 30 Mar 2021 22:37:14 +0300 Subject: [PATCH 14/14] package update --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a86e4fe..b61b77c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "galio-framework", "main": "src/index.js", - "version": "0.7.1", + "version": "0.8.0", "files": [ "src/" ],