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

42 lines
921 B
JavaScript
Raw Normal View History

2019-06-25 22:20:24 +02:00
// @flow
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 platform = variables.platform;
const toastTheme = {
2020-01-28 20:07:21 +01:00
'.danger': {
2019-06-25 22:20:24 +02:00
backgroundColor: variables.brandDanger
},
2020-01-28 20:07:21 +01:00
'.warning': {
2019-06-25 22:20:24 +02:00
backgroundColor: variables.brandWarning
},
2020-01-28 20:07:21 +01:00
'.success': {
2019-06-25 22:20:24 +02:00
backgroundColor: variables.brandSuccess
},
2020-01-28 20:07:21 +01:00
backgroundColor: 'rgba(0,0,0,0.8)',
borderRadius: platform === PLATFORM.IOS ? 5 : 0,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
2019-06-25 22:20:24 +02:00
padding: 10,
minHeight: 50,
2020-01-28 20:07:21 +01:00
'NativeBase.Text': {
color: '#fff',
2019-06-25 22:20:24 +02:00
flex: 1
},
2020-01-28 20:07:21 +01:00
'NativeBase.Button': {
backgroundColor: 'transparent',
2019-06-25 22:20:24 +02:00
height: 30,
elevation: 0,
2020-01-28 20:07:21 +01:00
'NativeBase.Text': {
2019-06-25 22:20:24 +02:00
fontSize: 14
}
}
};
return toastTheme;
};