application-amicale/native-base-theme/components/Item.js

242 lines
6 KiB
JavaScript
Raw Normal View History

2019-06-25 22:20:24 +02:00
// @flow
2020-01-28 20:07:21 +01:00
import { Platform } from 'react-native';
2019-06-25 22:20:24 +02:00
2020-01-28 20:07:21 +01:00
import variable from './../variables/platform';
import { PLATFORM } from './../variables/commonColor';
2019-06-25 22:20:24 +02:00
2020-01-28 20:07:21 +01:00
export default (variables /* : * */ = variable) => {
2019-06-25 22:20:24 +02:00
const itemTheme = {
2020-01-28 20:07:21 +01:00
'.floatingLabel': {
'NativeBase.Input': {
2019-06-25 22:20:24 +02:00
height: 50,
top: 8,
paddingTop: 3,
paddingBottom: 7,
2020-01-28 20:07:21 +01:00
'.multiline': {
2019-06-25 22:20:24 +02:00
minHeight: variables.inputHeightBase,
2020-01-28 20:07:21 +01:00
paddingTop: Platform.OS === PLATFORM.IOS ? 10 : 3,
paddingBottom: Platform.OS === PLATFORM.IOS ? 14 : 10
2019-06-25 22:20:24 +02:00
}
},
2020-01-28 20:07:21 +01:00
'NativeBase.Label': {
2019-06-25 22:20:24 +02:00
paddingTop: 5
},
2020-01-28 20:07:21 +01:00
'NativeBase.Icon': {
2019-06-25 22:20:24 +02:00
top: 6,
paddingTop: 8
},
2020-01-28 20:07:21 +01:00
'NativeBase.IconNB': {
2019-06-25 22:20:24 +02:00
top: 6,
paddingTop: 8
}
},
2020-01-28 20:07:21 +01:00
'.fixedLabel': {
'NativeBase.Label': {
2019-06-25 22:20:24 +02:00
position: null,
top: null,
left: null,
right: null,
flex: 1,
height: null,
width: null,
fontSize: variables.inputFontSize
},
2020-01-28 20:07:21 +01:00
'NativeBase.Input': {
2019-06-25 22:20:24 +02:00
flex: 2,
fontSize: variables.inputFontSize
}
},
2020-01-28 20:07:21 +01:00
'.stackedLabel': {
'NativeBase.Label': {
2019-06-25 22:20:24 +02:00
position: null,
top: null,
left: null,
right: null,
paddingTop: 5,
2020-01-28 20:07:21 +01:00
alignSelf: 'flex-start',
2019-06-25 22:20:24 +02:00
fontSize: variables.inputFontSize - 2
},
2020-01-28 20:07:21 +01:00
'NativeBase.Icon': {
2019-06-25 22:20:24 +02:00
marginTop: 36
},
2020-01-28 20:07:21 +01:00
'NativeBase.Input': {
alignSelf: Platform.OS === PLATFORM.IOS ? 'stretch' : 'flex-start',
2019-06-25 22:20:24 +02:00
flex: 1,
2020-01-28 20:07:21 +01:00
width: Platform.OS === PLATFORM.IOS ? null : variables.deviceWidth - 25,
2019-06-25 22:20:24 +02:00
fontSize: variables.inputFontSize,
lineHeight: variables.inputLineHeight - 6,
2020-01-28 20:07:21 +01:00
'.secureTextEntry': {
fontSize: variables.inputFontSize
2019-06-25 22:20:24 +02:00
},
2020-01-28 20:07:21 +01:00
'.multiline': {
paddingTop: Platform.OS === PLATFORM.IOS ? 9 : undefined,
paddingBottom: Platform.OS === PLATFORM.IOS ? 9 : undefined
2019-06-25 22:20:24 +02:00
}
},
flexDirection: null,
minHeight: variables.inputHeightBase + 15
},
2020-01-28 20:07:21 +01:00
'.inlineLabel': {
'NativeBase.Label': {
2019-06-25 22:20:24 +02:00
position: null,
top: null,
left: null,
right: null,
paddingRight: 20,
height: null,
width: null,
fontSize: variables.inputFontSize
},
2020-01-28 20:07:21 +01:00
'NativeBase.Input': {
2019-06-25 22:20:24 +02:00
paddingLeft: 5,
fontSize: variables.inputFontSize
},
2020-01-28 20:07:21 +01:00
flexDirection: 'row'
2019-06-25 22:20:24 +02:00
},
2020-01-28 20:07:21 +01:00
'NativeBase.Label': {
2019-06-25 22:20:24 +02:00
fontSize: variables.inputFontSize,
color: variables.inputColorPlaceholder,
paddingRight: 5
},
2020-01-28 20:07:21 +01:00
'NativeBase.Icon': {
2019-06-25 22:20:24 +02:00
fontSize: 24,
paddingRight: 8
},
2020-01-28 20:07:21 +01:00
'NativeBase.IconNB': {
2019-06-25 22:20:24 +02:00
fontSize: 24,
paddingRight: 8
},
2020-01-28 20:07:21 +01:00
'NativeBase.Input': {
'.multiline': {
2019-06-25 22:20:24 +02:00
height: null
},
height: variables.inputHeightBase,
color: variables.inputColor,
flex: 1,
2020-01-28 20:07:21 +01:00
top: Platform.OS === PLATFORM.IOS ? 1.5 : undefined,
2019-06-25 22:20:24 +02:00
fontSize: variables.inputFontSize
},
2020-01-28 20:07:21 +01:00
'.underline': {
'NativeBase.Input': {
2019-06-25 22:20:24 +02:00
paddingLeft: 15
},
2020-01-28 20:07:21 +01:00
'.success': {
2019-06-25 22:20:24 +02:00
borderColor: variables.inputSuccessBorderColor
},
2020-01-28 20:07:21 +01:00
'.error': {
2019-06-25 22:20:24 +02:00
borderColor: variables.inputErrorBorderColor
},
borderWidth: variables.borderWidth * 2,
borderTopWidth: 0,
borderRightWidth: 0,
borderLeftWidth: 0,
borderColor: variables.inputBorderColor
},
2020-01-28 20:07:21 +01:00
'.regular': {
'NativeBase.Input': {
2019-06-25 22:20:24 +02:00
paddingLeft: 8
},
2020-01-28 20:07:21 +01:00
'NativeBase.Icon': {
2019-06-25 22:20:24 +02:00
paddingLeft: 10
},
2020-01-28 20:07:21 +01:00
'.success': {
2019-06-25 22:20:24 +02:00
borderColor: variables.inputSuccessBorderColor
},
2020-01-28 20:07:21 +01:00
'.error': {
2019-06-25 22:20:24 +02:00
borderColor: variables.inputErrorBorderColor
},
borderWidth: variables.borderWidth * 2,
borderColor: variables.inputBorderColor
},
2020-01-28 20:07:21 +01:00
'.rounded': {
'NativeBase.Input': {
2019-06-25 22:20:24 +02:00
paddingLeft: 8
},
2020-01-28 20:07:21 +01:00
'NativeBase.Icon': {
2019-06-25 22:20:24 +02:00
paddingLeft: 10
},
2020-01-28 20:07:21 +01:00
'.success': {
2019-06-25 22:20:24 +02:00
borderColor: variables.inputSuccessBorderColor
},
2020-01-28 20:07:21 +01:00
'.error': {
2019-06-25 22:20:24 +02:00
borderColor: variables.inputErrorBorderColor
},
borderWidth: variables.borderWidth * 2,
borderRadius: 30,
borderColor: variables.inputBorderColor
},
2020-01-28 20:07:21 +01:00
'.success': {
'NativeBase.Icon': {
2019-06-25 22:20:24 +02:00
color: variables.inputSuccessBorderColor
},
2020-01-28 20:07:21 +01:00
'NativeBase.IconNB': {
2019-06-25 22:20:24 +02:00
color: variables.inputSuccessBorderColor
},
2020-01-28 20:07:21 +01:00
'.rounded': {
2019-06-25 22:20:24 +02:00
borderRadius: 30,
borderColor: variables.inputSuccessBorderColor
},
2020-01-28 20:07:21 +01:00
'.regular': {
2019-06-25 22:20:24 +02:00
borderColor: variables.inputSuccessBorderColor
},
2020-01-28 20:07:21 +01:00
'.underline': {
2019-06-25 22:20:24 +02:00
borderWidth: variables.borderWidth * 2,
borderTopWidth: 0,
borderRightWidth: 0,
borderLeftWidth: 0,
borderColor: variables.inputSuccessBorderColor
},
borderColor: variables.inputSuccessBorderColor
},
2020-01-28 20:07:21 +01:00
'.error': {
'NativeBase.Icon': {
2019-06-25 22:20:24 +02:00
color: variables.inputErrorBorderColor
},
2020-01-28 20:07:21 +01:00
'NativeBase.IconNB': {
2019-06-25 22:20:24 +02:00
color: variables.inputErrorBorderColor
},
2020-01-28 20:07:21 +01:00
'.rounded': {
2019-06-25 22:20:24 +02:00
borderRadius: 30,
borderColor: variables.inputErrorBorderColor
},
2020-01-28 20:07:21 +01:00
'.regular': {
2019-06-25 22:20:24 +02:00
borderColor: variables.inputErrorBorderColor
},
2020-01-28 20:07:21 +01:00
'.underline': {
2019-06-25 22:20:24 +02:00
borderWidth: variables.borderWidth * 2,
borderTopWidth: 0,
borderRightWidth: 0,
borderLeftWidth: 0,
borderColor: variables.inputErrorBorderColor
},
borderColor: variables.inputErrorBorderColor
},
2020-01-28 20:07:21 +01:00
'.disabled': {
'NativeBase.Icon': {
color: '#384850'
2019-06-25 22:20:24 +02:00
},
2020-01-28 20:07:21 +01:00
'NativeBase.IconNB': {
color: '#384850'
2019-06-25 22:20:24 +02:00
}
},
2020-01-28 20:07:21 +01:00
'.picker': {
2019-06-25 22:20:24 +02:00
marginLeft: 0
},
borderWidth: variables.borderWidth * 2,
borderTopWidth: 0,
borderRightWidth: 0,
borderLeftWidth: 0,
borderColor: variables.inputBorderColor,
2020-01-28 20:07:21 +01:00
backgroundColor: 'transparent',
flexDirection: 'row',
alignItems: 'center',
2019-06-25 22:20:24 +02:00
marginLeft: 2
};
return itemTheme;
};