Segment.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // @flow
  2. import variable from './../variables/platform';
  3. import { PLATFORM } from './../variables/commonColor';
  4. export default (variables /* : * */ = variable) => {
  5. const platform = variables.platform;
  6. const segmentTheme = {
  7. height: 45,
  8. borderColor: variables.segmentBorderColorMain,
  9. flexDirection: 'row',
  10. justifyContent: 'center',
  11. backgroundColor: variables.segmentBackgroundColor,
  12. 'NativeBase.Button': {
  13. alignSelf: 'center',
  14. borderRadius: 0,
  15. paddingTop: 3,
  16. paddingBottom: 3,
  17. height: 30,
  18. backgroundColor: 'transparent',
  19. borderWidth: 1,
  20. borderLeftWidth: 0,
  21. borderColor: variables.segmentBorderColor,
  22. elevation: 0,
  23. '.active': {
  24. backgroundColor: variables.segmentActiveBackgroundColor,
  25. 'NativeBase.Text': {
  26. color: variables.segmentActiveTextColor
  27. },
  28. 'NativeBase.Icon': {
  29. color: variables.segmentActiveTextColor
  30. }
  31. },
  32. '.first': {
  33. borderTopLeftRadius: platform === PLATFORM.IOS ? 5 : undefined,
  34. borderBottomLeftRadius: platform === PLATFORM.IOS ? 5 : undefined,
  35. borderLeftWidth: 1
  36. },
  37. '.last': {
  38. borderTopRightRadius: platform === PLATFORM.IOS ? 5 : undefined,
  39. borderBottomRightRadius: platform === PLATFORM.IOS ? 5 : undefined
  40. },
  41. 'NativeBase.Text': {
  42. color: variables.segmentTextColor,
  43. fontSize: 14
  44. },
  45. 'NativeBase.Icon': {
  46. fontSize: 22,
  47. paddingTop: 0,
  48. color: variables.segmentTextColor
  49. }
  50. }
  51. };
  52. return segmentTheme;
  53. };