migrating operation on est branch
|
|
@ -373,7 +373,7 @@ const AppSuperAdministrator = createDrawerNavigator({
|
||||||
headerMode: 'none'
|
headerMode: 'none'
|
||||||
});
|
});
|
||||||
|
|
||||||
export const AppNavigator = createSwitchNavigator({
|
const AppNavigator = createSwitchNavigator({
|
||||||
first: {
|
first: {
|
||||||
screen: SplashScreen
|
screen: SplashScreen
|
||||||
},
|
},
|
||||||
|
|
@ -387,16 +387,15 @@ export const AppNavigator = createSwitchNavigator({
|
||||||
});
|
});
|
||||||
const AppContainer = createAppContainer(AppNavigator);
|
const AppContainer = createAppContainer(AppNavigator);
|
||||||
|
|
||||||
class App extends React.Component {
|
export default class App extends React.Component {
|
||||||
|
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
console.log("APP PROPS", this.props);
|
console.log("APP PROPS", this.props);
|
||||||
global.appHasLoaded = false;
|
global.appHasLoaded = false;
|
||||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
|
||||||
//Remove this method to stop OneSignal Debugging
|
//Remove this method to stop OneSignal Debugging
|
||||||
/* OneSignal.setLogLevel(6, 0);
|
OneSignal.setLogLevel(6, 0);
|
||||||
|
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
||||||
// Replace 'YOUR_ONESIGNAL_APP_ID' with your OneSignal App ID.
|
// Replace 'YOUR_ONESIGNAL_APP_ID' with your OneSignal App ID.
|
||||||
OneSignal.init("e8e7251f-713d-4658-9510-86d877fa6a7c", {
|
OneSignal.init("e8e7251f-713d-4658-9510-86d877fa6a7c", {
|
||||||
kOSSettingsKeyAutoPrompt: false,
|
kOSSettingsKeyAutoPrompt: false,
|
||||||
|
|
@ -410,7 +409,7 @@ class App extends React.Component {
|
||||||
|
|
||||||
OneSignal.addEventListener('received', this.onReceived);
|
OneSignal.addEventListener('received', this.onReceived);
|
||||||
OneSignal.addEventListener('opened', this.onOpened);
|
OneSignal.addEventListener('opened', this.onOpened);
|
||||||
OneSignal.addEventListener('ids', this.onIds);*/
|
OneSignal.addEventListener('ids', this.onIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLangue() {
|
updateLangue() {
|
||||||
|
|
@ -541,8 +540,6 @@ function myiOSPromptCallback(permission) {
|
||||||
// do something with permission value
|
// do something with permission value
|
||||||
}
|
}
|
||||||
|
|
||||||
export default App;
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,8 @@ import CasserEpargneUser from './screens/nano-credit/CasserEpargneUser';
|
||||||
import {IlinkEmitter} from './utils/events';
|
import {IlinkEmitter} from './utils/events';
|
||||||
import EnvoieWalletToBankAgent from "./screens/wallet/agent/EnvoieWalletToBankAgent";
|
import EnvoieWalletToBankAgent from "./screens/wallet/agent/EnvoieWalletToBankAgent";
|
||||||
import ReattachAccountUser from "./screens/wallet/user/ReattachAccountUser";
|
import ReattachAccountUser from "./screens/wallet/user/ReattachAccountUser";
|
||||||
|
import InsuranceSubscriptionScreen from "./screens/wallet/user/InsuranceSubscriptionScreen";
|
||||||
|
import AddBeneficiaryScreen from "./screens/wallet/user/AddBeneficiaryScreen";
|
||||||
|
|
||||||
|
|
||||||
const instructions = Platform.select({
|
const instructions = Platform.select({
|
||||||
|
|
@ -113,7 +115,8 @@ const AppStack = createDrawerNavigator({
|
||||||
/* filtre:Filter,
|
/* filtre:Filter,
|
||||||
network:Networks,*/
|
network:Networks,*/
|
||||||
useraccount: {
|
useraccount: {
|
||||||
screen: UserAccount,
|
screen: InsuranceSubscriptionScreen,
|
||||||
|
/*screen: UserAccount,*/
|
||||||
navigationOptions: {},
|
navigationOptions: {},
|
||||||
},
|
},
|
||||||
walletSelect: WalletSelect,
|
walletSelect: WalletSelect,
|
||||||
|
|
@ -130,6 +133,8 @@ const AppStack = createDrawerNavigator({
|
||||||
envoieWalletToCashUser: EnvoieWalletToCashUser,
|
envoieWalletToCashUser: EnvoieWalletToCashUser,
|
||||||
envoieWalletToCardUser: EnvoieWalletToCardUser,
|
envoieWalletToCardUser: EnvoieWalletToCardUser,
|
||||||
envoieWalletToBankUser: EnvoieWalletToBankUser,
|
envoieWalletToBankUser: EnvoieWalletToBankUser,
|
||||||
|
addBeneficiaryScreen:AddBeneficiaryScreen,
|
||||||
|
insuranceSubscriptionScreen: InsuranceSubscriptionScreen,
|
||||||
retraitWalletVersCashUser: RetraitWalletVersCashUser,
|
retraitWalletVersCashUser: RetraitWalletVersCashUser,
|
||||||
retraitCarteVersCashUser: RetraitCarteVersCashUser,
|
retraitCarteVersCashUser: RetraitCarteVersCashUser,
|
||||||
retraitCarteVersWalletUser: RetraitCarteVersWalletUser,
|
retraitCarteVersWalletUser: RetraitCarteVersWalletUser,
|
||||||
|
|
@ -397,7 +402,7 @@ export default class App extends React.Component {
|
||||||
OneSignal.setLogLevel(6, 0);
|
OneSignal.setLogLevel(6, 0);
|
||||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
||||||
// Replace 'YOUR_ONESIGNAL_APP_ID' with your OneSignal App ID.
|
// Replace 'YOUR_ONESIGNAL_APP_ID' with your OneSignal App ID.
|
||||||
OneSignal.init("ab02121a-ecec-424f-910a-2709ef85698d", {
|
OneSignal.init("e8e7251f-713d-4658-9510-86d877fa6a7c", {
|
||||||
kOSSettingsKeyAutoPrompt: false,
|
kOSSettingsKeyAutoPrompt: false,
|
||||||
kOSSettingsKeyInAppLaunchURL: false,
|
kOSSettingsKeyInAppLaunchURL: false,
|
||||||
kOSSettingsKeyInFocusDisplayOption: 2
|
kOSSettingsKeyInFocusDisplayOption: 2
|
||||||
|
|
@ -438,7 +443,6 @@ export default class App extends React.Component {
|
||||||
|
|
||||||
goToScreen = (routeName, params, isReset = true) => {
|
goToScreen = (routeName, params, isReset = true) => {
|
||||||
const {navigator} = this.refs;
|
const {navigator} = this.refs;
|
||||||
console.log("NAVIGATOR", navigator);
|
|
||||||
if (typeof navigator !== 'undefined') {
|
if (typeof navigator !== 'undefined') {
|
||||||
console.log("APP HAS LOADED", global.appHasLoaded);
|
console.log("APP HAS LOADED", global.appHasLoaded);
|
||||||
if (global.appHasLoaded) {
|
if (global.appHasLoaded) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
import React from "react";
|
||||||
|
import {ActivityIndicator, StyleSheet, TouchableOpacity} from "react-native";
|
||||||
|
import PropTypes from "prop-types";
|
||||||
|
import styles from "./styles";
|
||||||
|
import {Color} from "../../config/Color";
|
||||||
|
import Text from '../Text';
|
||||||
|
|
||||||
|
|
||||||
|
export default function Button(props) {
|
||||||
|
const {
|
||||||
|
style,
|
||||||
|
styleText,
|
||||||
|
icon,
|
||||||
|
outline,
|
||||||
|
full,
|
||||||
|
round,
|
||||||
|
loading,
|
||||||
|
children,
|
||||||
|
...rest
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TouchableOpacity
|
||||||
|
{...rest}
|
||||||
|
style={StyleSheet.flatten([
|
||||||
|
[styles.default, {backgroundColor: Color.primaryColor}],
|
||||||
|
outline && [
|
||||||
|
styles.outline,
|
||||||
|
{backgroundColor: Color.cardBackgroundColor, borderColor: Color.primaryColor}
|
||||||
|
],
|
||||||
|
full && styles.full,
|
||||||
|
round && styles.round,
|
||||||
|
style
|
||||||
|
])}
|
||||||
|
activeOpacity={0.9}
|
||||||
|
>
|
||||||
|
{icon ? icon : null}
|
||||||
|
<Text
|
||||||
|
style={StyleSheet.flatten([
|
||||||
|
styles.textDefault,
|
||||||
|
outline && {color: Color.primaryColor},
|
||||||
|
styleText
|
||||||
|
])}
|
||||||
|
numberOfLines={1}
|
||||||
|
>
|
||||||
|
{children || "Button"}
|
||||||
|
</Text>
|
||||||
|
{loading ? (
|
||||||
|
<ActivityIndicator
|
||||||
|
size="small"
|
||||||
|
color={outline ? Color.primaryColor : Color.whiteColor}
|
||||||
|
style={{paddingLeft: 5}}
|
||||||
|
/>
|
||||||
|
) : null}
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Button.propTypes = {
|
||||||
|
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
||||||
|
icon: PropTypes.node,
|
||||||
|
outline: PropTypes.bool,
|
||||||
|
full: PropTypes.bool,
|
||||||
|
round: PropTypes.bool,
|
||||||
|
loading: PropTypes.bool
|
||||||
|
};
|
||||||
|
|
||||||
|
Button.defaultProps = {
|
||||||
|
style: {},
|
||||||
|
icon: null,
|
||||||
|
outline: false,
|
||||||
|
full: false,
|
||||||
|
round: false,
|
||||||
|
loading: false
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
import {StyleSheet} from "react-native";
|
||||||
|
import {FontWeight, Typography} from "../../config/typography";
|
||||||
|
import {Color} from "../../config/Color";
|
||||||
|
|
||||||
|
export default StyleSheet.create({
|
||||||
|
default: {
|
||||||
|
height: 56,
|
||||||
|
borderRadius: 8,
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
paddingHorizontal: 20
|
||||||
|
},
|
||||||
|
textDefault: {
|
||||||
|
...Typography.headline,
|
||||||
|
color: Color.whiteColor,
|
||||||
|
fontWeight: FontWeight.semibold
|
||||||
|
},
|
||||||
|
outline: {
|
||||||
|
borderWidth: 1
|
||||||
|
},
|
||||||
|
|
||||||
|
full: {
|
||||||
|
width: "100%",
|
||||||
|
alignSelf: "auto"
|
||||||
|
},
|
||||||
|
round: {
|
||||||
|
borderRadius: 28
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
import React from 'react';
|
||||||
|
import {StyleSheet} from 'react-native';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
|
import styles from './styles';
|
||||||
|
|
||||||
|
export default function Index(props) {
|
||||||
|
const {style, enableRTL, ...rest} = props;
|
||||||
|
const layoutStyle = enableRTL ? styles.styleRTL : {};
|
||||||
|
return <Icon style={StyleSheet.flatten([style, layoutStyle])} {...rest} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
Index.propTypes = {
|
||||||
|
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
||||||
|
enableRTL: PropTypes.bool,
|
||||||
|
};
|
||||||
|
|
||||||
|
Index.defaultProps = {
|
||||||
|
style: {},
|
||||||
|
enableRTL: false,
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
import {StyleSheet, I18nManager} from 'react-native';
|
||||||
|
|
||||||
|
export default StyleSheet.create({
|
||||||
|
styleRTL: {transform: [{scaleX: I18nManager.isRTL ? -1 : 1}]},
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
/**
|
||||||
|
* Project iLinkWorld
|
||||||
|
* File NetInfoBar
|
||||||
|
* Path components
|
||||||
|
* Created by BRICE ZELE
|
||||||
|
* Date: 18/10/2021
|
||||||
|
*/
|
||||||
|
import React from 'react';
|
||||||
|
import {useNetInfo} from '@react-native-community/netinfo';
|
||||||
|
import {Dimensions, StyleSheet, View} from 'react-native';
|
||||||
|
import Text from './Text';
|
||||||
|
|
||||||
|
const {width} = Dimensions.get('window');
|
||||||
|
|
||||||
|
export const NetInfoBar = () => {
|
||||||
|
const netInfo = useNetInfo();
|
||||||
|
|
||||||
|
if (!netInfo.isConnected && netInfo.isConnected !== null) {
|
||||||
|
return (
|
||||||
|
<View style={styles.offlineContainer}>
|
||||||
|
<Text style={styles.offlineText}>No Internet Connection</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
offlineContainer: {
|
||||||
|
backgroundColor: '#C31C0D',
|
||||||
|
height: 30,
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
flexDirection: 'row',
|
||||||
|
width,
|
||||||
|
position: 'absolute',
|
||||||
|
},
|
||||||
|
offlineText: {color: '#fff'},
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,108 @@
|
||||||
|
import React, {useState} from 'react';
|
||||||
|
import {Platform, TextInput, View} from 'react-native';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import Icon from '../Icon';
|
||||||
|
import {Color} from '../../config/Color';
|
||||||
|
|
||||||
|
|
||||||
|
export default function Index(props) {
|
||||||
|
const cardColor = Color.cardBackgroundColor;
|
||||||
|
const {
|
||||||
|
style,
|
||||||
|
onChangeText,
|
||||||
|
onFocus,
|
||||||
|
placeholder,
|
||||||
|
value,
|
||||||
|
success,
|
||||||
|
secureTextEntry,
|
||||||
|
keyboardType,
|
||||||
|
multiline,
|
||||||
|
textAlignVertical,
|
||||||
|
icon,
|
||||||
|
onSubmitEditing,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const [secure, setSecure] = useState(true);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={[{
|
||||||
|
height: 46,
|
||||||
|
borderRadius: 5,
|
||||||
|
paddingHorizontal: 10,
|
||||||
|
width: '100%',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
flexDirection: 'row',
|
||||||
|
backgroundColor: cardColor
|
||||||
|
}, style]}>
|
||||||
|
{React.Children.map(icon, child =>
|
||||||
|
React.cloneElement(child, {
|
||||||
|
color: success ? Color.primaryColor : Color.accentColor,
|
||||||
|
style: {marginRight: Platform.OS === 'ios' ? 10 : 5}
|
||||||
|
}),
|
||||||
|
)}
|
||||||
|
<TextInput
|
||||||
|
style={{
|
||||||
|
fontFamily: 'Raleway',
|
||||||
|
flex: 1,
|
||||||
|
height: '100%',
|
||||||
|
color: Color.textColor,
|
||||||
|
paddingTop: 5,
|
||||||
|
paddingBottom: 5,
|
||||||
|
}}
|
||||||
|
onChangeText={text => onChangeText(text)}
|
||||||
|
onFocus={() => onFocus()}
|
||||||
|
autoCorrect={false}
|
||||||
|
placeholder={placeholder}
|
||||||
|
placeholderTextColor={success ? Color.grayColor : Color.primaryColor}
|
||||||
|
secureTextEntry={secure}
|
||||||
|
value={value}
|
||||||
|
selectionColor={Color.primaryColor}
|
||||||
|
keyboardType={keyboardType}
|
||||||
|
multiline={multiline}
|
||||||
|
textAlignVertical={textAlignVertical}
|
||||||
|
onSubmitEditing={onSubmitEditing}
|
||||||
|
/>
|
||||||
|
<Icon
|
||||||
|
style={{paddingRight: 5}}
|
||||||
|
name={!secure ? 'eye' : 'eye-slash'}
|
||||||
|
size={20}
|
||||||
|
color="gray"
|
||||||
|
onPress={() => setSecure(!secure)}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Index.propTypes = {
|
||||||
|
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
||||||
|
onChangeText: PropTypes.func,
|
||||||
|
onFocus: PropTypes.func,
|
||||||
|
placeholder: PropTypes.string,
|
||||||
|
value: PropTypes.string,
|
||||||
|
success: PropTypes.bool,
|
||||||
|
secureTextEntry: PropTypes.bool,
|
||||||
|
keyboardType: PropTypes.string,
|
||||||
|
multiline: PropTypes.bool,
|
||||||
|
textAlignVertical: PropTypes.string,
|
||||||
|
icon: PropTypes.node,
|
||||||
|
onSubmitEditing: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
Index.defaultProps = {
|
||||||
|
style: {},
|
||||||
|
onChangeText: text => {
|
||||||
|
},
|
||||||
|
onFocus: () => {
|
||||||
|
},
|
||||||
|
placeholder: 'Placeholder',
|
||||||
|
value: '',
|
||||||
|
success: true,
|
||||||
|
secureTextEntry: false,
|
||||||
|
keyboardType: 'default',
|
||||||
|
multiline: false,
|
||||||
|
textAlignVertical: 'center',
|
||||||
|
icon: null,
|
||||||
|
onSubmitEditing: () => {
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
import {StyleSheet} from 'react-native';
|
||||||
|
|
||||||
|
export default StyleSheet.create({
|
||||||
|
textInput: {
|
||||||
|
height: 46,
|
||||||
|
borderRadius: 5,
|
||||||
|
paddingHorizontal: 10,
|
||||||
|
width: '100%',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
flexDirection: 'row',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
/**
|
||||||
|
* Project YooLearn
|
||||||
|
* File index
|
||||||
|
* Path app/components/Screen
|
||||||
|
* Created by BRICE ZELE
|
||||||
|
* Date: 26/08/2021
|
||||||
|
*/
|
||||||
|
import React from 'react';
|
||||||
|
import {SafeAreaView} from 'react-native';
|
||||||
|
import {NetInfoBar} from './NetInfoBar';
|
||||||
|
import {Color} from "../config/Color";
|
||||||
|
|
||||||
|
export const ScreenComponent = React.forwardRef((props, ref) => (
|
||||||
|
<SafeAreaView style={[{flex: 1, backgroundColor: Color.containerBackgroundColor}, props.style]} {...props}>
|
||||||
|
<NetInfoBar/>
|
||||||
|
{/* React.Children.map(props.children, child =>
|
||||||
|
React.cloneElement(child, {}),
|
||||||
|
) */}
|
||||||
|
{props.children}
|
||||||
|
</SafeAreaView>
|
||||||
|
));
|
||||||
|
|
@ -0,0 +1,180 @@
|
||||||
|
import React from 'react';
|
||||||
|
import {StyleSheet, Text} from 'react-native';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import {FontWeight, Typography} from "../../config/typography";
|
||||||
|
import {Color} from "../../config/Color";
|
||||||
|
|
||||||
|
export default function Index(props) {
|
||||||
|
const {
|
||||||
|
//props style
|
||||||
|
header,
|
||||||
|
title1,
|
||||||
|
title2,
|
||||||
|
title3,
|
||||||
|
headline,
|
||||||
|
body1,
|
||||||
|
body2,
|
||||||
|
callout,
|
||||||
|
subhead,
|
||||||
|
footnote,
|
||||||
|
caption1,
|
||||||
|
caption2,
|
||||||
|
overline,
|
||||||
|
// props font
|
||||||
|
thin,
|
||||||
|
ultraLight,
|
||||||
|
light,
|
||||||
|
regular,
|
||||||
|
medium,
|
||||||
|
semibold,
|
||||||
|
bold,
|
||||||
|
heavy,
|
||||||
|
black,
|
||||||
|
//custom color
|
||||||
|
primaryColor,
|
||||||
|
darkPrimaryColor,
|
||||||
|
lightPrimaryColor,
|
||||||
|
accentColor,
|
||||||
|
grayColor,
|
||||||
|
dividerColor,
|
||||||
|
whiteColor,
|
||||||
|
fieldColor,
|
||||||
|
//numberOfLines
|
||||||
|
numberOfLines,
|
||||||
|
textAlign,
|
||||||
|
//custom
|
||||||
|
style,
|
||||||
|
//children
|
||||||
|
children,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Text
|
||||||
|
style={StyleSheet.flatten([
|
||||||
|
{textAlign},
|
||||||
|
header && Typography.header,
|
||||||
|
title1 && Typography.title1,
|
||||||
|
title2 && Typography.title2,
|
||||||
|
title3 && Typography.title3,
|
||||||
|
headline && Typography.headline,
|
||||||
|
body1 && Typography.body1,
|
||||||
|
body2 && Typography.body2,
|
||||||
|
callout && Typography.callout,
|
||||||
|
subhead && Typography.subhead,
|
||||||
|
footnote && Typography.footnote,
|
||||||
|
caption1 && Typography.caption1,
|
||||||
|
caption2 && Typography.caption2,
|
||||||
|
overline && Typography.overline,
|
||||||
|
//custom for font
|
||||||
|
thin && StyleSheet.flatten({fontWeight: FontWeight.thin}),
|
||||||
|
ultraLight && StyleSheet.flatten({fontWeight: FontWeight.ultraLight}),
|
||||||
|
light && StyleSheet.flatten({fontWeight: FontWeight.light}),
|
||||||
|
regular && StyleSheet.flatten({fontWeight: FontWeight.regular}),
|
||||||
|
medium && StyleSheet.flatten({fontWeight: FontWeight.medium}),
|
||||||
|
semibold && StyleSheet.flatten({fontWeight: FontWeight.semibold}),
|
||||||
|
bold && StyleSheet.flatten({fontWeight: FontWeight.bold}),
|
||||||
|
heavy && StyleSheet.flatten({fontWeight: FontWeight.heavy}),
|
||||||
|
black && StyleSheet.flatten({fontWeight: FontWeight.black}),
|
||||||
|
// default color
|
||||||
|
StyleSheet.flatten({color: Color.textColor}),
|
||||||
|
//custom for color
|
||||||
|
primaryColor && StyleSheet.flatten({color: Color.primaryColor}),
|
||||||
|
darkPrimaryColor && StyleSheet.flatten({color: Color.primaryDarkColor}),
|
||||||
|
lightPrimaryColor && StyleSheet.flatten({color: Color.primaryLightColor}),
|
||||||
|
accentColor && StyleSheet.flatten({color: Color.accentColor}),
|
||||||
|
grayColor && StyleSheet.flatten({color: Color.grayColor}),
|
||||||
|
dividerColor && StyleSheet.flatten({color: Color.dividerColor}),
|
||||||
|
whiteColor && StyleSheet.flatten({color: Color.whiteColor}),
|
||||||
|
fieldColor && StyleSheet.flatten({color: Color.fieldColor}),
|
||||||
|
style && style,
|
||||||
|
])}
|
||||||
|
numberOfLines={numberOfLines}>
|
||||||
|
{children}
|
||||||
|
</Text>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define typechecking
|
||||||
|
Index.propTypes = {
|
||||||
|
//define style
|
||||||
|
header: PropTypes.bool,
|
||||||
|
title1: PropTypes.bool,
|
||||||
|
title2: PropTypes.bool,
|
||||||
|
title3: PropTypes.bool,
|
||||||
|
headline: PropTypes.bool,
|
||||||
|
body1: PropTypes.bool,
|
||||||
|
body2: PropTypes.bool,
|
||||||
|
callout: PropTypes.bool,
|
||||||
|
subhead: PropTypes.bool,
|
||||||
|
footnote: PropTypes.bool,
|
||||||
|
caption1: PropTypes.bool,
|
||||||
|
caption2: PropTypes.bool,
|
||||||
|
overline: PropTypes.bool,
|
||||||
|
//define font custom
|
||||||
|
thin: PropTypes.bool,
|
||||||
|
ultraLight: PropTypes.bool,
|
||||||
|
light: PropTypes.bool,
|
||||||
|
regular: PropTypes.bool,
|
||||||
|
medium: PropTypes.bool,
|
||||||
|
semibold: PropTypes.bool,
|
||||||
|
bold: PropTypes.bool,
|
||||||
|
heavy: PropTypes.bool,
|
||||||
|
black: PropTypes.bool,
|
||||||
|
//custon for text color
|
||||||
|
primaryColor: PropTypes.bool,
|
||||||
|
darkPrimaryColor: PropTypes.bool,
|
||||||
|
lightPrimaryColor: PropTypes.bool,
|
||||||
|
accentColor: PropTypes.bool,
|
||||||
|
grayColor: PropTypes.bool,
|
||||||
|
dividerColor: PropTypes.bool,
|
||||||
|
whiteColor: PropTypes.bool,
|
||||||
|
fieldColor: PropTypes.bool,
|
||||||
|
//numberOfLines
|
||||||
|
numberOfLines: PropTypes.number,
|
||||||
|
textAlign: PropTypes.string,
|
||||||
|
//custom style
|
||||||
|
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
||||||
|
children: PropTypes.node, // plain text
|
||||||
|
};
|
||||||
|
|
||||||
|
Index.defaultProps = {
|
||||||
|
//props for style
|
||||||
|
header: false,
|
||||||
|
title1: false,
|
||||||
|
title2: false,
|
||||||
|
title3: false,
|
||||||
|
headline: false,
|
||||||
|
body1: false,
|
||||||
|
body2: false,
|
||||||
|
callout: false,
|
||||||
|
subhead: false,
|
||||||
|
footnote: false,
|
||||||
|
caption1: false,
|
||||||
|
caption2: false,
|
||||||
|
overline: false,
|
||||||
|
//props for font
|
||||||
|
thin: false,
|
||||||
|
ultraLight: false,
|
||||||
|
light: false,
|
||||||
|
regular: false,
|
||||||
|
medium: false,
|
||||||
|
semibold: false,
|
||||||
|
bold: false,
|
||||||
|
heavy: false,
|
||||||
|
black: false,
|
||||||
|
//custon for text color
|
||||||
|
primaryColor: false,
|
||||||
|
darkPrimaryColor: false,
|
||||||
|
lightPrimaryColor: false,
|
||||||
|
accentColor: false,
|
||||||
|
grayColor: false,
|
||||||
|
dividerColor: false,
|
||||||
|
whiteColor: false,
|
||||||
|
fieldColor: false,
|
||||||
|
//numberOfLines
|
||||||
|
numberOfLines: 10,
|
||||||
|
textAlign: 'left',
|
||||||
|
//custom style
|
||||||
|
style: {},
|
||||||
|
children: '',
|
||||||
|
};
|
||||||
|
|
@ -1,45 +1,53 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { TextInput, View } from 'react-native';
|
import {Platform, TextInput, View} from 'react-native';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Color } from '../../config/Color';
|
import {Color} from '../../config/Color';
|
||||||
|
import Text from '../Text';
|
||||||
|
|
||||||
export default function Index(props) {
|
export default function Index(props) {
|
||||||
const cardColor = Color.cardBackgroundColor;
|
const cardColor = Color.cardBackgroundColor;
|
||||||
const {
|
const {
|
||||||
style,
|
style,
|
||||||
onChangeText,
|
onChangeText,
|
||||||
onFocus,
|
onFocus,
|
||||||
placeholder,
|
placeholder,
|
||||||
value,
|
value,
|
||||||
success,
|
success,
|
||||||
secureTextEntry,
|
secureTextEntry,
|
||||||
keyboardType,
|
keyboardType,
|
||||||
multiline,
|
multiline,
|
||||||
textAlignVertical,
|
textAlignVertical,
|
||||||
icon,
|
icon,
|
||||||
onSubmitEditing,
|
onSubmitEditing,
|
||||||
} = props;
|
error,
|
||||||
return (
|
...rest
|
||||||
<View style={[{
|
} = props;
|
||||||
textInput: {
|
return (
|
||||||
height: 46,
|
<View>
|
||||||
borderRadius: 5,
|
<View style={[{
|
||||||
paddingHorizontal: 10,
|
height: 46,
|
||||||
width: '100%',
|
borderRadius: 5,
|
||||||
justifyContent: 'space-between',
|
paddingHorizontal: 10,
|
||||||
alignItems: 'center',
|
width: '100%',
|
||||||
flexDirection: 'row',
|
justifyContent: 'space-between',
|
||||||
}, backgroundColor: cardColor
|
alignItems: 'center',
|
||||||
}, style]}>
|
flexDirection: 'row',
|
||||||
<TextInput
|
backgroundColor: cardColor
|
||||||
|
}, style]}>
|
||||||
|
{React.Children.map(icon, child =>
|
||||||
|
React.cloneElement(child, {
|
||||||
|
color: success ? Color.primaryColor : Color.accentColor,
|
||||||
|
style: {marginRight: Platform.OS === 'ios' ? 10 : 5}
|
||||||
|
}),
|
||||||
|
)}
|
||||||
|
<TextInput
|
||||||
style={{
|
style={{
|
||||||
fontFamily: 'Raleway',
|
fontFamily: 'Raleway',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
height: '100%',
|
height: '100%',
|
||||||
color: colors.text,
|
color: Color.textColor,
|
||||||
paddingTop: 5,
|
paddingTop: 5,
|
||||||
paddingBottom: 5,
|
paddingBottom: 5,
|
||||||
}}
|
}}
|
||||||
onChangeText={text => onChangeText(text)}
|
onChangeText={text => onChangeText(text)}
|
||||||
onFocus={() => onFocus()}
|
onFocus={() => onFocus()}
|
||||||
|
|
@ -53,38 +61,54 @@ export default function Index(props) {
|
||||||
multiline={multiline}
|
multiline={multiline}
|
||||||
textAlignVertical={textAlignVertical}
|
textAlignVertical={textAlignVertical}
|
||||||
onSubmitEditing={onSubmitEditing}
|
onSubmitEditing={onSubmitEditing}
|
||||||
/>
|
{...rest}
|
||||||
{icon}
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
{error !== '' && !success && (
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
alignSelf: 'flex-start',
|
||||||
|
justifyContent: 'flex-start',
|
||||||
|
marginTop: 5,
|
||||||
|
}}>
|
||||||
|
<Text caption2 accentColor>
|
||||||
|
{`${error} `}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Index.propTypes = {
|
Index.propTypes = {
|
||||||
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
||||||
onChangeText: PropTypes.func,
|
onChangeText: PropTypes.func,
|
||||||
onFocus: PropTypes.func,
|
onFocus: PropTypes.func,
|
||||||
placeholder: PropTypes.string,
|
placeholder: PropTypes.string,
|
||||||
value: PropTypes.string,
|
value: PropTypes.string,
|
||||||
success: PropTypes.bool,
|
success: PropTypes.bool,
|
||||||
secureTextEntry: PropTypes.bool,
|
secureTextEntry: PropTypes.bool,
|
||||||
keyboardType: PropTypes.string,
|
keyboardType: PropTypes.string,
|
||||||
multiline: PropTypes.bool,
|
multiline: PropTypes.bool,
|
||||||
textAlignVertical: PropTypes.string,
|
textAlignVertical: PropTypes.string,
|
||||||
icon: PropTypes.node,
|
icon: PropTypes.node,
|
||||||
onSubmitEditing: PropTypes.func,
|
onSubmitEditing: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
Index.defaultProps = {
|
Index.defaultProps = {
|
||||||
style: {},
|
style: {},
|
||||||
onChangeText: text => { },
|
onChangeText: text => {
|
||||||
onFocus: () => { },
|
},
|
||||||
placeholder: 'Placeholder',
|
onFocus: () => {
|
||||||
value: '',
|
},
|
||||||
success: true,
|
placeholder: 'Placeholder',
|
||||||
secureTextEntry: false,
|
value: '',
|
||||||
keyboardType: 'default',
|
success: true,
|
||||||
multiline: false,
|
secureTextEntry: false,
|
||||||
textAlignVertical: 'center',
|
keyboardType: 'default',
|
||||||
icon: null,
|
multiline: false,
|
||||||
onSubmitEditing: () => { },
|
textAlignVertical: 'center',
|
||||||
|
icon: null,
|
||||||
|
onSubmitEditing: () => {
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
/**
|
||||||
|
* Project iLinkWorld
|
||||||
|
* File BaseStyle
|
||||||
|
* Path config
|
||||||
|
* Created by BRICE ZELE
|
||||||
|
* Date: 18/10/2021
|
||||||
|
*/
|
||||||
|
import {StyleSheet} from 'react-native';
|
||||||
|
import {Color} from "./Color";
|
||||||
|
|
||||||
|
export const BaseStyle = StyleSheet.create({
|
||||||
|
textInput: {
|
||||||
|
height: 46,
|
||||||
|
borderRadius: 5,
|
||||||
|
paddingHorizontal: 10,
|
||||||
|
width: '100%',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
flexDirection: 'row',
|
||||||
|
},
|
||||||
|
safeAreaView: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: Color.containerBackgroundColor
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
@ -19,10 +19,8 @@ export const Color = {
|
||||||
orangeColor: '#E5634D',
|
orangeColor: '#E5634D',
|
||||||
blueColor: '#5DADE2',
|
blueColor: '#5DADE2',
|
||||||
pinkColor: '#A569BD',
|
pinkColor: '#A569BD',
|
||||||
greenColor: '#58D68D',
|
|
||||||
yellowColor: '#FDC60A',
|
|
||||||
textColor: '#212121',
|
textColor: '#212121',
|
||||||
borderColor: '#c7c7cc',
|
borderColor: '#c7c7cc',
|
||||||
redColor: 'red',
|
redColor: 'red',
|
||||||
greenColor: 'green'
|
greenColor: 'green'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 213 KiB After Width: | Height: | Size: 213 KiB |
|
Before Width: | Height: | Size: 1000 B After Width: | Height: | Size: 1000 B |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 925 B After Width: | Height: | Size: 925 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 367 KiB After Width: | Height: | Size: 367 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |