Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 45 additions & 25 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
* @flow strict-local
*/

import React from 'react';
import type {Node} from 'react';
import React from "react";
import {
SafeAreaView,
ScrollView,
Expand All @@ -16,30 +15,28 @@ import {
Text,
useColorScheme,
View,
} from 'react-native';
} from "react-native";

import {
Colors,
DebugInstructions,
Header,
LearnMoreLinks,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
} from "react-native/Libraries/NewAppScreen";

const Section = ({children, title}): Node => {
const isDarkMode = useColorScheme() === 'dark';
const Section = ({children, title}) => {
const isDarkMode = useColorScheme() === "dark";
return (
<View style={styles.sectionContainer}>
<Text
style={[
styles.sectionTitle,
{
color: isDarkMode ?
Colors.white :

Colors.black,
color: isDarkMode ? Colors.white : Colors.black,
},
]}>
]}
>
{title}
</Text>
<Text
Expand All @@ -48,42 +45,65 @@ const Section = ({children, title}): Node => {
{
color: isDarkMode ? Colors.light : Colors.dark,
},
]}>
]}
>
{children}
</Text>
<Text
style={[
styles.sectionDescription,
{
color: isDarkMode ? Colors.light : Colors.dark,
},
]}
>
{children}
</Text>
<Text
style={[
styles.sectionDescription,
{
color: isDarkMode ? Colors.light : Colors.dark,
},
]}
>
{children}
</Text>
</View>
);
};

const App: () => Node = () => {
const isDarkMode = useColorScheme() === 'dark';
const App = () => {
const isDarkMode = useColorScheme() === "dark";

const backgroundStyle = {
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
};

return (
<SafeAreaView style={backgroundStyle}>
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
<StatusBar barStyle={isDarkMode ? "light-content" : "dark-content"} />
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={backgroundStyle}>
contentInsetAdjustmentBehavior='automatic'
style={backgroundStyle}
>
<Header />
<View
style={{
backgroundColor: isDarkMode ? Colors.black : Colors.white,
}}>
<Section title="Step One">
}}
>
<Section title='Step One'>
Edit <Text style={styles.highlight}>App.js</Text> to change this
screen and then come back to see your edits.
</Section>
<Section title="See Your Changes">
<Section title='See Your Changes'>
<ReloadInstructions />
</Section>
<Section title="Debug">
<Section title='Debug'>
<DebugInstructions />
</Section>
<Section title="Learn More" test="ok">
<Section title='Learn More'>
Read the docs to discover what to do next:
</Section>
<LearnMoreLinks />
Expand All @@ -100,15 +120,15 @@ const styles = StyleSheet.create({
},
sectionTitle: {
fontSize: 24,
fontWeight: '600',
fontWeight: "600",
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400',
fontWeight: "400",
},
highlight: {
fontWeight: '700',
fontWeight: "700",
},
});

Expand Down