test
parent
81bd71a3cb
commit
81138e7e0c
36
App.js
36
App.js
|
@ -1,13 +1,37 @@
|
|||
import React, {useState} from 'react';
|
||||
import {SafeAreaView, StyleSheet, Text, useColorScheme} from 'react-native';
|
||||
import {Button, MD3Colors, ProgressBar, TextInput} from 'react-native-paper';
|
||||
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,
|
||||
};
|
||||
|
@ -20,6 +44,14 @@ function App() {
|
|||
<ProgressBar progress={0.3} color={MD3Colors.error50} />
|
||||
|
||||
<TextInput label="Email" />
|
||||
|
||||
<Switch value={isSwitchOn} onValueChange={onToggleSwitch} />
|
||||
|
||||
<Searchbar
|
||||
placeholder="Search"
|
||||
onChangeText={onChangeSearch}
|
||||
value={searchQuery}
|
||||
/>
|
||||
</SafeAreaView>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue