BottomView.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. import React from 'react'
  2. import { View, ViewStyle, Image, TouchableOpacity, StyleSheet, } from 'react-native'
  3. import c from '../../color/colors'
  4. import t from '../../translator/translator'
  5. import { MyText, } from '../../components/texts'
  6. type Props = {
  7. containerViewStyle: ViewStyle,
  8. secondsText: String,
  9. isRecording: Boolean,
  10. onPressTakePhoto: () => void,
  11. onPressPauseResume: () => void,
  12. }
  13. export default BottomView = (props: Props) =>
  14. {
  15. return (
  16. <View style={ styles.container }>
  17. <View style={ styles.btnsView }>
  18. <View style={ styles.leftSideView }>
  19. </View>
  20. <View style={ styles.centerSideView }>
  21. <View style={ styles.takePhotoBtnView }>
  22. {
  23. props.isRecording ?
  24. <TouchableOpacity
  25. style = { styles.takePhotoSquareBtn }
  26. onPress = { props.onPressTakePhoto }
  27. hitSlop = { {
  28. top: 10,
  29. left: 10,
  30. right: 10,
  31. bottom: 10,
  32. } }
  33. />
  34. :
  35. <TouchableOpacity
  36. style = { styles.takePhotoBtn }
  37. onPress = { props.onPressTakePhoto }
  38. hitSlop = { {
  39. top: 10,
  40. left: 10,
  41. right: 10,
  42. bottom: 10,
  43. } }
  44. />
  45. }
  46. </View>
  47. </View>
  48. <View style={ styles.rightSideView }>
  49. <View style={ styles.pauseResumeBtnView }>
  50. <TouchableOpacity
  51. style = { styles.pauseResumeBtn }
  52. onPress = { props.onPressPauseResume }
  53. hitSlop = { {
  54. top: 20,
  55. left: 20,
  56. right: 20,
  57. bottom: 20,
  58. } }
  59. >
  60. <Image
  61. style = { styles.changeCameraImg }
  62. source = { require('../../../assets/icons/common/camera_pause_icon.png') }
  63. />
  64. </TouchableOpacity>
  65. </View>
  66. </View>
  67. </View>
  68. </View>
  69. )
  70. }
  71. BottomView.defaultProps = {
  72. isRecording: false,
  73. }
  74. const styles = StyleSheet.create({
  75. container: {
  76. paddingBottom: 50,
  77. },
  78. btnsView: {
  79. marginTop: 20,
  80. paddingHorizontal: 20,
  81. flexDirection: 'row',
  82. alignItems: 'center',
  83. },
  84. leftSideView: {
  85. flex: 1,
  86. alignItems: 'flex-start',
  87. },
  88. centerSideView: {
  89. flex: 1,
  90. alignItems: 'center',
  91. },
  92. rightSideView: {
  93. flex: 1,
  94. alignItems: 'flex-end',
  95. },
  96. takePhotoBtnView: {
  97. height: 70,
  98. aspectRatio: 1,
  99. borderWidth: 5,
  100. borderColor: c().main_white,
  101. borderRadius: 50,
  102. },
  103. takePhotoBtn: {
  104. margin: 2,
  105. flex: 1,
  106. backgroundColor: c().main_white,
  107. borderRadius: 50,
  108. },
  109. takePhotoSquareBtn: {
  110. margin: 15,
  111. flex: 1,
  112. backgroundColor: c().main_red,
  113. borderRadius: 5,
  114. },
  115. pauseResumeBtnView: {
  116. height: 52,
  117. alignItems: 'center',
  118. justifyContent: 'center',
  119. aspectRatio: 1,
  120. borderColor: c().main_white,
  121. borderWidth: 3,
  122. borderRadius: 50,
  123. },
  124. pauseResumeBtn: {
  125. },
  126. })