79 lines
1.6 KiB
JavaScript
79 lines
1.6 KiB
JavaScript
import React, {useState} from 'react';
|
|
import {
|
|
SafeAreaView,
|
|
StyleSheet,
|
|
Text,
|
|
View,
|
|
useColorScheme,
|
|
} from 'react-native';
|
|
import {
|
|
Button,
|
|
MD3Colors,
|
|
ProgressBar,
|
|
Searchbar,
|
|
Snackbar,
|
|
Switch,
|
|
TextInput,
|
|
} from 'react-native-paper';
|
|
import {Colors} from 'react-native/Libraries/NewAppScreen';
|
|
|
|
function App() {
|
|
const [text, setText] = useState('');
|
|
|
|
const [visible, setVisible] = useState(false);
|
|
|
|
const [isSwitchOn, setIsSwitchOn] = React.useState(false);
|
|
|
|
const onToggleSwitch = () => setIsSwitchOn(!isSwitchOn);
|
|
|
|
const isDarkMode = useColorScheme() === 'dark';
|
|
|
|
const [searchQuery, setSearchQuery] = React.useState('');
|
|
|
|
const onChangeSearch = query => setSearchQuery(query);
|
|
|
|
const backgroundStyle = {
|
|
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
|
|
};
|
|
|
|
return (
|
|
<SafeAreaView>
|
|
<Button mode="contained-tonal" onPress={() => console.log('Pressed')}>
|
|
Press
|
|
</Button>
|
|
<ProgressBar progress={0.3} color={MD3Colors.error50} />
|
|
|
|
<TextInput label="Email" />
|
|
|
|
<Switch value={isSwitchOn} onValueChange={onToggleSwitch} />
|
|
|
|
<Searchbar
|
|
placeholder="Search"
|
|
onChangeText={onChangeSearch}
|
|
value={searchQuery}
|
|
/>
|
|
</SafeAreaView>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
sectionContainer: {
|
|
marginTop: 32,
|
|
paddingHorizontal: 24,
|
|
},
|
|
sectionTitle: {
|
|
fontSize: 24,
|
|
fontWeight: '600',
|
|
},
|
|
sectionDescription: {
|
|
marginTop: 8,
|
|
fontSize: 18,
|
|
fontWeight: '400',
|
|
},
|
|
highlight: {
|
|
fontWeight: '700',
|
|
},
|
|
});
|
|
|
|
export default App;
|