Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. import React from 'react';
  2.  
  3. import {
  4. StyleSheet,
  5. Text,
  6. View,
  7. StatusBar,
  8. TouchableOpacity,
  9. Keyboard,
  10. TouchableWithoutFeedback,
  11. } from 'react-native';
  12.  
  13. import {MultiSliderProps} from 'react-native-multi-slider'
  14.  
  15. import Slider from 'react-native-slider';
  16. import { Header, Icon, Button, Avatar, Input } from 'react-native-elements';
  17.  
  18.  
  19. const DismissKeyboard = ({ children }) => (
  20. <TouchableWithoutFeedback onPress={() => Keyboard.dismiss()}>
  21. {children}
  22. </TouchableWithoutFeedback>
  23. );
  24.  
  25. export default class App extends React.Component {
  26. state = {
  27. value1: 500,
  28. value2: 1000,
  29. };
  30.  
  31. render() {
  32. return (
  33. <DismissKeyboard>
  34. <View style={styles.container}>
  35. <Header />
  36.  
  37. <View
  38. style={{
  39. backgroundColor: '#FFF',
  40. marginHorizontal: 10,
  41. borderRadius: 8,
  42. flex: 0.23,
  43. flexDirection: 'column',
  44. alignItems: 'stretch',
  45. justifyContent: 'flex-start',
  46. }}>
  47.  
  48. <Text style = {{
  49. color: '#E41D32',
  50. fontfamily: 'Roboto',
  51. fontstyle: 'normal',
  52. fontweight: '',
  53. lineheight: 16,
  54. marginTop: 20,
  55. marginLeft: 15,
  56. }}>Цена</Text>
  57.  
  58. <Slider
  59. style={{ marginHorizontal: 10 }}
  60. value={this.state.value1}
  61. maximumValue={3024}
  62. step={1}
  63. thumbTintColor = '#E41D32'
  64. maximumTrackTintColor = '#E41D32'
  65. minimumTrackTintColor = '#AEAFB2'
  66. trackStyle = {{height: 2}}
  67. thumbStyle = {{}}
  68. onValueChange={value1 => this.setState({ value1 })}
  69. />
  70.  
  71. <Slider
  72. thumbTintColor = '#E41D32'
  73. maximumTrackTintColor = '#AEAFB2'
  74. minimumTrackTintColor = '#E41D32'
  75. style={{ marginTop: -10, marginHorizontal: 10 }}
  76. value={this.state.value2}
  77. trackStyle = {{height: 2}}
  78. maximumValue={3024}
  79. step={1}
  80. onValueChange={value2 => this.setState({ value2 })}
  81. />
  82.  
  83. <View
  84. style={{
  85. flexDirection: 'row',
  86. alignItems: 'flex-end',
  87. justifyContent: 'center',
  88. flex: 0.1,
  89. marginTop:10,
  90. }}>
  91. <Text>{this.state.value1} руб</Text>
  92.  
  93. <Text> - </Text>
  94.  
  95. <Text>{this.state.value2} руб</Text>
  96. </View>
  97. </View>
  98.  
  99. </View>
  100. </DismissKeyboard>
  101. );
  102. }
  103. }
  104.  
  105. const styles = StyleSheet.create({
  106. container: {
  107. flex: 1,
  108. backgroundColor: '#E5E5E5',
  109. alignItems: 'stretch',
  110. flexDirection: 'column',
  111. justifyContent: 'flex-start',
  112. },
  113. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement