12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- /**
- * 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 React, {useState} from 'react';
- import {
- SafeAreaView,
- ScrollView,
- StatusBar,
- StyleSheet,
- useColorScheme,
- Text,
- Button,
- } from 'react-native';
- import {Colors, Header} from 'react-native/Libraries/NewAppScreen';
- const App = () => {
- const [title, setTitle] = useState('this is test title');
- const isDarkMode = useColorScheme() === 'dark';
- const setTitles = () => {
- setTitle('a');
- };
- const backgroundStyle = {
- backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
- };
- return (
- <SafeAreaView style={backgroundStyle}>
- <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
- <ScrollView
- contentInsetAdjustmentBehavior="automatic"
- style={backgroundStyle}>
- <Header />
- <Button onPress={setTitles} title={title} />
- </ScrollView>
- </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;
|