1import Slider from '@react-native-community/slider';
2import * as React from 'react';
3import { Text } from 'react-native';
4
5import { Page, Section } from '../components/Page';
6import Colors from '../constants/Colors';
7
8export default function SliderScreen() {
9  const [value, setValue] = React.useState(0.5);
10
11  return (
12    <Page>
13      <Section title="Standard">
14        <Text>Value: {value && +value.toFixed(3)}</Text>
15        <Slider onValueChange={setValue} />
16      </Section>
17      <Section title="Custom Color">
18        <Text>Value: {value && +value.toFixed(3)}</Text>
19        <Slider
20          minimumTrackTintColor="red"
21          maximumTrackTintColor={Colors.tintColor}
22          onValueChange={setValue}
23          thumbTintColor="gold"
24        />
25      </Section>
26    </Page>
27  );
28}
29
30SliderScreen.navigationOptions = {
31  title: 'Slider',
32};
33