Skip to content

Commit

Permalink
Add list of home items (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
GoelBiju committed Jan 26, 2021
1 parent 2c7b676 commit 805f233
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 8 deletions.
13 changes: 13 additions & 0 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -12,6 +13,18 @@ const Tab = createBottomTabNavigator();
export default function App() {
return (
<NavigationContainer>
{/* Move to NavBar/Header component */}
<StatusBar style="light" />
<View
style={{
backgroundColor: "black",
alignItems: "center",
// justifyContent: "center",
}}
>
<Image source={require("./img/logo.png")} />
</View>

<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
Expand Down
109 changes: 104 additions & 5 deletions screens/HomeScreen.js
Original file line number Diff line number Diff line change
@@ -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 (
<View style={{ margin: 10 }}>
<Text style={{ color: "white" }}>{item}</Text>
</View>
);
};

function HomeScreen() {
return (
<View
Expand All @@ -22,8 +100,29 @@ function HomeScreen() {
// },
// }}
>
<StatusBar style="light" />
<Text style={{ color: "white" }}>Home UI</Text>
<ScrollView style={{ flex: 1 }}>
<Image source={require("../img/bible-quote-1.png")} />
<SectionList
ListEmptyComponent={<Text>No content</Text>}
sections={data}
keyExtractor={(item, index) => item + index}
renderSectionHeader={({ section }) => (
<>
<Text style={{ fontSize: 32, color: "white" }}>
{section.title}
</Text>

<FlatList
horizontal
keyExtractor={(item, index) => item + index}
data={section.data}
renderItem={({ item, index }) => <ListItem item={item} />}
></FlatList>
</>
)}
renderItem={({ item }) => null}
/>
</ScrollView>
</View>
);
}
Expand Down
2 changes: 1 addition & 1 deletion screens/MoreScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
2 changes: 1 addition & 1 deletion screens/NewsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
2 changes: 1 addition & 1 deletion screens/SearchScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down

0 comments on commit 805f233

Please sign in to comment.