Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/**
* The height of the selected item
*/
itemHeight: PropTypes.number,
/**
* The color of the wheel picker (hex only)
*/
color: PropTypes.string,
/**
* pass custom style for the picker item
*/
itemStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), //eslint-disable-line
};
static defaultProps = {
labelStyle: {fontSize: Typography.text70.fontSize, fontFamily: Typography.text70.fontFamily},
color: Colors.blue30
};
constructor(props) {
super(props);
this.onValueChange = this.onValueChange.bind(this); //eslint-disable-line
this.getItems();
DeviceEventEmitter.addListener('log', this.onLogReceived); // TODO: consider moving to a more generic place (base class?)
}
state = {
items: this.getItems(),
};
onLogReceived = (event) => {
console[event.LogType](event.TAG, event.text);
backgroundColor: ThemeManager.primaryColor, // for Android
},
layout: {
backgroundColor: Colors.white,
orientation: ['portrait'],
},
topBar: {
visible: true,
noBorder: true, // for iOS
elevation: 0, // for Android
background: {
color: ThemeManager.primaryColor,
},
title: {
color: Colors.white,
fontSize: Typography.text70.fontSize,
fontFamily: Constants.isAndroid ? 'sans-serif-bold' : '.SFUIText-Heavy',
alignment: 'center',
},
subtitle: {
color: Colors.white,
fontSize: Typography.text80.fontSize,
fontFamily: Constants.isAndroid ? Typography.text80.fontFamily : '.SFUIText-Medium',
},
backButton: {
// visible: true,
color: Colors.white,
showTitle: Constants.isIOS ? false : undefined,
testID: 'pop',
},
leftButtonColor: Colors.white,
leftButtonDisabledColor: Colors.rgba(Colors.white, 0.6),
getTypography() {
return this.extractTypographyValue() || Typography.text70;
}
async setItemWidth(item) {
if (item && !item.width && !_.isEmpty(item.text)) {
const horizontalPadding = 12;
const typography = Typography.text70;
const width = await Typography.measureWidth(item.text, typography);
const itemCopy = item;
itemCopy.width = width + horizontalPadding * 2;
return itemCopy;
}
}
backgroundColor: Colors.dark80
},
rowContent: {
flexDirection: 'row',
alignItems: 'center',
backgroundColor: Colors.dark80
},
rowIcon: {
width: 38,
height: 38,
borderRadius: 19,
backgroundColor: Colors.violet40,
margin: 20
},
rowTitle: {
...Typography.text70,
fontWeight: 'bold',
color: Colors.dark20
},
rowSubtitle: {
...Typography.text80,
color: Colors.dark30
},
rowButtonContainer: {
flex: 1,
alignItems: 'flex-end',
padding: 10
}
});
export default gestureHandlerRootHOC(DrawerScreen);
},
scrollContainer: {
paddingHorizontal: Spacings.s5,
flex: 1,
justifyContent: 'center'
},
inputContainer: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
padding: Spacings.s5
},
textInput: {
flex: 1,
padding: Spacings.s2,
...Typography.text70
},
closeButton: {
padding: Spacings.s2
},
keyboardContainer: {
backgroundColor: Colors.white,
borderWidth: 1,
borderColor: Colors.dark60
},
keyboardModesContainer: {
flexDirection: 'row'
},
modeButton: {
padding: 5
}
});
text70
containerStyle={{marginBottom: INPUT_SPACING}}
title="title"
placeholder="Character counter & error"
maxLength={3}
showCharacterCounter
onChangeText={this.onChangeText}
error={this.state.error}
useTopErrors={this.state.topError}
/>