From e5021187e96b78b53203bd95d08d6818aea47d17 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Wed, 14 Jul 2021 15:10:31 +0200 Subject: New Ignite 7.0.6 app --- app/screens/demo/demo-list-screen.tsx | 86 +++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 app/screens/demo/demo-list-screen.tsx (limited to 'app/screens/demo/demo-list-screen.tsx') diff --git a/app/screens/demo/demo-list-screen.tsx b/app/screens/demo/demo-list-screen.tsx new file mode 100644 index 0000000..ae66307 --- /dev/null +++ b/app/screens/demo/demo-list-screen.tsx @@ -0,0 +1,86 @@ +import React, { useEffect } from "react" +import { FlatList, TextStyle, View, ViewStyle, ImageStyle } from "react-native" +import { useNavigation } from "@react-navigation/native" +import { observer } from "mobx-react-lite" +import { Header, Screen, Text, Wallpaper, AutoImage as Image } from "../../components" +import { color, spacing } from "../../theme" +import { useStores } from "../../models" + +const FULL: ViewStyle = { + flex: 1, +} +const CONTAINER: ViewStyle = { + backgroundColor: color.transparent, +} +const HEADER: TextStyle = { + paddingBottom: spacing[5] - 1, + paddingHorizontal: spacing[4], + paddingTop: spacing[3], +} +const HEADER_TITLE: TextStyle = { + fontSize: 12, + fontWeight: "bold", + letterSpacing: 1.5, + lineHeight: 15, + textAlign: "center", +} +const LIST_CONTAINER: ViewStyle = { + alignItems: "center", + flexDirection: "row", + padding: 10, +} +const IMAGE: ImageStyle = { + borderRadius: 35, + height: 65, + width: 65, +} +const LIST_TEXT: TextStyle = { + marginLeft: 10, +} +const FLAT_LIST: ViewStyle = { + paddingHorizontal: spacing[4], +} + +export const DemoListScreen = observer(function DemoListScreen() { + const navigation = useNavigation() + const goBack = () => navigation.goBack() + + const { characterStore } = useStores() + const { characters } = characterStore + + useEffect(() => { + async function fetchData() { + await characterStore.getCharacters() + } + + fetchData() + }, []) + + return ( + + + +
+ String(item.id)} + renderItem={({ item }) => ( + + + + {item.name} ({item.status}) + + + )} + /> + + + ) +}) -- cgit v1.2.3