From 805f233bb55cf3c0668e4cf2a82784ca72beffa8 Mon Sep 17 00:00:00 2001 From: Goel Biju Date: Tue, 26 Jan 2021 02:04:24 +0000 Subject: [PATCH] Add list of home items (#3) --- App.js | 13 +++++ screens/HomeScreen.js | 109 ++++++++++++++++++++++++++++++++++++++-- screens/MoreScreen.js | 2 +- screens/NewsScreen.js | 2 +- screens/SearchScreen.js | 2 +- 5 files changed, 120 insertions(+), 8 deletions(-) diff --git a/App.js b/App.js index e0891c6..bcc0af4 100644 --- a/App.js +++ b/App.js @@ -2,6 +2,7 @@ import Ionicons from "@expo/vector-icons/Ionicons"; import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; import { NavigationContainer } from "@react-navigation/native"; import React from "react"; +import { Image, StatusBar, View } from "react-native"; import HomeScreen from "./screens/HomeScreen"; import MoreScreen from "./screens/MoreScreen"; import NewsScreen from "./screens/NewsScreen"; @@ -12,6 +13,18 @@ const Tab = createBottomTabNavigator(); export default function App() { return ( + {/* Move to NavBar/Header component */} + + + + + ({ tabBarIcon: ({ focused, color, size }) => { diff --git a/screens/HomeScreen.js b/screens/HomeScreen.js index c791c34..d4330e1 100644 --- a/screens/HomeScreen.js +++ b/screens/HomeScreen.js @@ -1,16 +1,94 @@ -import { StatusBar } from "expo-status-bar"; import React from "react"; -import { StyleSheet, Text, View } from "react-native"; +import { + FlatList, + Image, + ScrollView, + SectionList, + StyleSheet, + Text, + View, +} from "react-native"; + +const data = [ + { + title: "Continue Learning", + data: "Test", + }, + { + title: "My Learning List", + data: "Test", + }, + { + title: "Sunday School Lessons", + data: "Test", + }, + { + title: "Prayers - Audio/Video", + data: "Test", + }, + { + title: "Evangelical Messages", + data: "Test", + }, + { + title: "Popular", + data: "Test", + }, + { + title: "Devotional Hymns - Audio/Video", + data: "Test", + }, + { + title: "Qurbana Songs - Audio/Video", + data: "Test", + }, + { + title: "Christmas Carols - Audio/Video", + data: "Test", + }, + { + title: "Sunday School Class Activities", + data: "Test", + }, + { + title: "Holy Qurbana Text", + data: "Test", + }, + { + title: "Evening Prayers Text", + data: "Test", + }, + { + title: "Devotional Hymns - Lyrics", + data: "Test", + }, + { + title: "Qurbana Songs - Lyrics", + data: "Test", + }, + { + title: "Christmas Carols - Lyrics", + data: "Test", + }, +]; const styles = StyleSheet.create({ container: { flex: 1, - backgroundColor: "black", + backgroundColor: "#191919", alignItems: "center", justifyContent: "center", }, }); +const ListItem = ({ item }) => { + return ( + + {item} + + ); +}; + function HomeScreen() { return ( - - Home UI + + + No content} + sections={data} + keyExtractor={(item, index) => item + index} + renderSectionHeader={({ section }) => ( + <> + + {section.title} + + + item + index} + data={section.data} + renderItem={({ item, index }) => } + > + + )} + renderItem={({ item }) => null} + /> + ); } diff --git a/screens/MoreScreen.js b/screens/MoreScreen.js index 7605d6d..ce61eae 100644 --- a/screens/MoreScreen.js +++ b/screens/MoreScreen.js @@ -4,7 +4,7 @@ import { StyleSheet, Text, View } from "react-native"; const styles = StyleSheet.create({ container: { flex: 1, - backgroundColor: "black", + backgroundColor: "#191919", alignItems: "center", justifyContent: "center", }, diff --git a/screens/NewsScreen.js b/screens/NewsScreen.js index d8cb6a1..a456b02 100644 --- a/screens/NewsScreen.js +++ b/screens/NewsScreen.js @@ -4,7 +4,7 @@ import { StyleSheet, Text, View } from "react-native"; const styles = StyleSheet.create({ container: { flex: 1, - backgroundColor: "black", + backgroundColor: "#191919", alignItems: "center", justifyContent: "center", }, diff --git a/screens/SearchScreen.js b/screens/SearchScreen.js index c574399..9b63f5b 100644 --- a/screens/SearchScreen.js +++ b/screens/SearchScreen.js @@ -4,7 +4,7 @@ import { StyleSheet, Text, View } from "react-native"; const styles = StyleSheet.create({ container: { flex: 1, - backgroundColor: "black", + backgroundColor: "#191919", alignItems: "center", justifyContent: "center", },