Add React Native app
This commit is contained in:
9
reactNative/app/_layout.tsx
Normal file
9
reactNative/app/_layout.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Stack } from "expo-router";
|
||||
|
||||
export default function RootLayout() {
|
||||
return (
|
||||
<Stack>
|
||||
<Stack.Screen name="index" options={{ title:'Hello World!'}}/>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
33
reactNative/app/index.tsx
Normal file
33
reactNative/app/index.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Text, View, Button } from "react-native";
|
||||
import React, {useState} from 'react';
|
||||
import { ThemedText } from "@/components/ThemedText"
|
||||
import Blurb, {BlurbData} from "@/components/Blurb"
|
||||
|
||||
const default_blurb: BlurbData = {
|
||||
title: "Fart Man Comes To Town!",
|
||||
blurb: "Will this controversial figure finally cause the downfall of the town? Sally Smith from town center says that she can already smell trouble brewing but other members of the town believe the imminent winds of change will revitalize the towns central business district."
|
||||
};
|
||||
|
||||
export default function Index() {
|
||||
const [blurbs, setBlurbs] = useState([default_blurb])
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
{blurbs.map((blurb, i) => (
|
||||
<Blurb key={i} {...blurb} />
|
||||
))}
|
||||
<Button
|
||||
onPress={() => {
|
||||
setBlurbs(blurbs.concat([default_blurb]));
|
||||
}}
|
||||
title="Load More"
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user