Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: display students on home page #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
28 changes: 22 additions & 6 deletions thi-app/app/(drawer)/home.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import { ScrollView, View, Text, TouchableOpacity, SafeAreaView } from "react-native";
import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
import { Student } from '@/types';
import { sampleStudents } from './students';
import { StudentCard } from '@/components/StudentCard';

export const teacherName = "Jane Summers";

const homePage = () => {
const [students, setStudents] = useState<Student[]>([]);

useEffect(() => {
setStudents(sampleStudents); // Load the sample students
}, []);

return (
<SafeAreaView className="flex-1">
<ScrollView className="px-12 py-8">
Expand All @@ -30,11 +39,18 @@ const homePage = () => {

<View className="mb-5">
<Text className="text-lg font-bold mb-8">Students</Text>
<View className="p-8 h-[59px] mb-4 bg-white rounded-lg shadow-md justify-center items-center">
<Text>
There Is No Data To Currently Display
</Text>
</View>
<View className="flex-row flex-wrap justify-between gap-y-4">
{students.map((student) => (
<View
key={student.id}
style={{
width: "28%",
}}
>
<StudentCard student={student} />
</View>
))}
</View>
</View>
</ScrollView>
</SafeAreaView>
Expand Down
2 changes: 1 addition & 1 deletion thi-app/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Login from '@/components/login';
import Login from '@/components/Login';
import React from 'react';
import { View } from 'react-native';

Expand Down