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

40 lines
1 KiB
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 badgeTheme = {
2020-01-28 20:07:21 +01:00
'.primary': {
backgroundColor: variables.buttonPrimaryBg
2019-06-25 22:20:24 +02:00
},
2020-01-28 20:07:21 +01:00
'.warning': {
backgroundColor: variables.buttonWarningBg
2019-06-25 22:20:24 +02:00
},
2020-01-28 20:07:21 +01:00
'.info': {
backgroundColor: variables.buttonInfoBg
2019-06-25 22:20:24 +02:00
},
2020-01-28 20:07:21 +01:00
'.success': {
backgroundColor: variables.buttonSuccessBg
2019-06-25 22:20:24 +02:00
},
2020-01-28 20:07:21 +01:00
'.danger': {
backgroundColor: variables.buttonDangerBg
2019-06-25 22:20:24 +02:00
},
2020-01-28 20:07:21 +01:00
'NativeBase.Text': {
2019-06-25 22:20:24 +02:00
color: variables.badgeColor,
fontSize: variables.fontSizeBase,
lineHeight: variables.lineHeight - 1,
2020-01-28 20:07:21 +01:00
textAlign: 'center',
2019-06-25 22:20:24 +02:00
paddingHorizontal: 3
},
backgroundColor: variables.badgeBg,
padding: variables.badgePadding,
paddingHorizontal: 6,
2020-01-28 20:07:21 +01:00
alignSelf: 'flex-start',
justifyContent: variables.platform === PLATFORM.IOS ? 'center' : undefined,
2019-06-25 22:20:24 +02:00
borderRadius: 13.5,
height: 27
};
return badgeTheme;
};