/* eslint-disable react-native/no-inline-styles */ /** * Sample React Native App * https://github.com/facebook/react-native * * Generated with the TypeScript template * https://github.com/react-native-community/react-native-template-typescript * * @format */ import * as React from 'react'; import {StyleSheet, Text, TouchableOpacity, View} from 'react-native'; import lorem from './src/lorem.json'; import {DemoScrollViewIndicator} from './src/demo/DemoScrollViewIndicator'; import {DemoFlatListIndicator} from './src/demo/DemoFlatListIndicator'; const App = () => { const [hori, setHori] = React.useState(false); const [posi, setPosi] = React.useState('right'); const [ind, setInd] = React.useState('Normal'); const [comp, setComp] = React.useState('ScrollView'); const posiTypesHori = ['left', 'right', 20, 50, 80]; const posiTypeVert = ['top', 'bottom', 20, 50, 80]; const indTypes = ['Normal', 'Crazy']; const compTypes = ['ScrollView', 'FlatList']; return ( {compTypes.map(v => ( setComp(v)} key={v}> {v} ))} { setHori(false); setPosi(''); }}> Vertical {posiTypesHori.map(v => ( setPosi(v)} disabled={hori} key={v}> {v} ))} { setHori(true); setPosi(''); }}> Horizontal {posiTypeVert.map(v => ( setPosi(v)} disabled={!hori} key={v}> {v} ))} {indTypes.map(v => ( setInd(v)} key={v}> {v} ))} {comp === 'ScrollView' ? ( ) : ( )} ); }; const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', // borderWidth: 2, // borderColor: 'red', }, buttonContainer: { flex: 0.8, justifyContent: 'flex-end', alignItems: 'flex-start', // borderWidth: 2, // borderColor: 'blue', }, buttonSubContainer: { marginVertical: 10, }, minorButtonContainer: { flexDirection: 'row', }, contentContainer: { flex: 1, marginHorizontal: 30, marginVertical: 30, }, scrollViewContainer: { borderWidth: 1, borderColor: 'black', }, indStyleNormal: {backgroundColor: 'grey', width: 5, borderRadius: 3}, indStyleCrazy: {backgroundColor: 'red', width: 60, borderRadius: 50}, majorButton: { borderWidth: 1, borderColor: 'black', borderRadius: 5, alignItems: 'center', padding: 5, width: 100, marginHorizontal: 5, marginVertical: 5, }, minorButton: { borderWidth: 1, borderRadius: 5, alignItems: 'center', padding: 5, width: 60, marginHorizontal: 5, }, }); export default App;