diff --git a/App.js b/App.js index 4dcda0b..d8f34a8 100644 --- a/App.js +++ b/App.js @@ -1,5 +1,5 @@ -import { NavigationContainer } from "@react-navigation/native"; -import { createNativeStackNavigator } from "@react-navigation/native-stack"; +import {NavigationContainer} from "@react-navigation/native"; +import {createNativeStackNavigator} from "@react-navigation/native-stack"; import ModuleListScreen from "./src/components/screens/ModuleListScreen"; import ModuleModifyScreen from "./src/components/screens/ModuleModifyScreen"; import ModuleViewScreen from "./src/components/screens/ModuleViewScreen"; @@ -14,38 +14,38 @@ export const App = () => { // View ----------------------- return ( - - + + - + - + - + - + ); diff --git a/package-lock.json b/package-lock.json index de487a8..57d4335 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,8 @@ "expo": "^54.0.20", "expo-status-bar": "~3.0.8", "react": "19.1.0", - "react-native": "^0.81.5" + "react-native": "^0.81.5", + "react-native-fullwidth-image": "^0.1.3" } }, "node_modules/@0no-co/graphql.web": { @@ -7756,6 +7757,11 @@ } } }, + "node_modules/react-native-fullwidth-image": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/react-native-fullwidth-image/-/react-native-fullwidth-image-0.1.3.tgz", + "integrity": "sha512-nFe5EAEPlPaT1vw1abwnNmSZN9oLMzNXJAKKxeuWqPI9L7rGhXhpZH4KEBUzbqkk+58TjdT9d2bf070/GB4PGQ==" + }, "node_modules/react-native-is-edge-to-edge": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/react-native-is-edge-to-edge/-/react-native-is-edge-to-edge-1.2.1.tgz", diff --git a/package.json b/package.json index da46ec1..4ec2b31 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "expo": "^54.0.20", "expo-status-bar": "~3.0.8", "react": "19.1.0", - "react-native": "^0.81.5" + "react-native": "^0.81.5", + "react-native-fullwidth-image": "^0.1.3" }, "private": true } diff --git a/src/components/entity/modules/ModuleItem.js b/src/components/entity/modules/ModuleItem.js index 9232c8d..cd3bc33 100644 --- a/src/components/entity/modules/ModuleItem.js +++ b/src/components/entity/modules/ModuleItem.js @@ -1,12 +1,12 @@ import {StyleSheet, Text, View, Pressable} from "react-native"; -const ModuleItem = ({module, onSelect }) => { +const ModuleItem = ({module, onSelect}) => { // Initialisation ------------- // State ---------------------- // Handlers ------------------- // View ----------------------- - return( + return ( onSelect(module)}> diff --git a/src/components/entity/modules/ModuleList.js b/src/components/entity/modules/ModuleList.js index ac024ae..2245405 100644 --- a/src/components/entity/modules/ModuleList.js +++ b/src/components/entity/modules/ModuleList.js @@ -1,17 +1,17 @@ -import {StyleSheet, ScrollView } from "react-native"; +import {StyleSheet, ScrollView} from "react-native"; import ModuleItem from "./ModuleItem"; import React from "react"; -const ModuleList = ({modules, onSelect }) => { +const ModuleList = ({modules, onSelect}) => { // Initialisation ------------- // State ---------------------- // Handlers ------------------- // View ----------------------- - return( + return ( {modules.map((module) => { - return( + return ( { + // Initialisation ------------- + // State ---------------------- + // Handlers ------------------- + // View ----------------------- + + return ( + + + + View {module.ModuleCode} {module.ModuleName} + Level {module.ModuleLevel} + + {module.ModuleLeaderName} (Module Leader) + + + + ); +}; + + +const styles = StyleSheet.create({ + container: { + gap: 15, + }, infoTray: { + gap: 5, + }, image: { + borderRadius: 3, + }, text: { + fontSize: 16, + }, boldText: { + fontSize: 16, fontWeight: 'bold', + }, dimText: { + color: "grey", + } + +}); + +export default ModuleView; \ No newline at end of file diff --git a/src/components/layout/Screen.js b/src/components/layout/Screen.js index cb30888..cb4683e 100644 --- a/src/components/layout/Screen.js +++ b/src/components/layout/Screen.js @@ -1,5 +1,5 @@ -import { StatusBar } from "expo-status-bar"; -import { StyleSheet, View } from "react-native"; +import {StatusBar} from "expo-status-bar"; +import {StyleSheet, View} from "react-native"; const Screen = ({children}) => { // Initialisation ------------- @@ -9,7 +9,7 @@ const Screen = ({children}) => { return ( {children} - + ); }; diff --git a/src/components/screens/ModuleAddScreen.js b/src/components/screens/ModuleAddScreen.js index ebd9ebf..73adf8f 100644 --- a/src/components/screens/ModuleAddScreen.js +++ b/src/components/screens/ModuleAddScreen.js @@ -1,4 +1,4 @@ -import { StyleSheet, Text } from "react-native"; +import {StyleSheet, Text} from "react-native"; import Screen from "../layout/Screen"; export const ModuleAddScreen = () => { @@ -6,11 +6,11 @@ export const ModuleAddScreen = () => { // State ---------------------- // Handlers ------------------- // View ----------------------- - return ( - - Add - - ); + return ( + + Add + + ); }; const styles = StyleSheet.create({}); diff --git a/src/components/screens/ModuleListScreen.js b/src/components/screens/ModuleListScreen.js index c801654..2b3f3bf 100644 --- a/src/components/screens/ModuleListScreen.js +++ b/src/components/screens/ModuleListScreen.js @@ -1,17 +1,16 @@ -import { useState } from "react"; -import { StyleSheet } from "react-native"; +import {useState} from "react"; +import {StyleSheet} from "react-native"; import Screen from "../layout/Screen"; import ModuleList from "../entity/modules/ModuleList"; import initialModules from "../../data/modules.js"; import RenderCount from "../UI/RenderCount"; -import ModuleViewScreen from "./ModuleViewScreen"; const ModuleListScreen = ({navigation}) => { // Initialisation ------------- // let modules = initialModules; // State ---------------------- - const [ modules, setModules] = useState(initialModules); + const [modules, setModules] = useState(initialModules); // Handlers ------------------- @@ -19,15 +18,15 @@ const ModuleListScreen = ({navigation}) => { const handleDelete = (module) => setModules(modules.filter((item) => item.ModuleID !== module.ModuleID)); - const handleSelect = (module) => navigation.navigate('ModuleViewScreen', { module }); + const handleSelect = (module) => navigation.navigate('ModuleViewScreen', {module}); // View ----------------------- - return ( - - - - - ); + return ( + + + + + ); }; const styles = StyleSheet.create({}); diff --git a/src/components/screens/ModuleModifyScreen.js b/src/components/screens/ModuleModifyScreen.js index 6f1e973..ae2ccec 100644 --- a/src/components/screens/ModuleModifyScreen.js +++ b/src/components/screens/ModuleModifyScreen.js @@ -1,4 +1,4 @@ -import { StyleSheet, Text } from "react-native"; +import {StyleSheet, Text} from "react-native"; import Screen from "../layout/Screen"; export const ModuleModifyScreen = () => { @@ -6,11 +6,11 @@ export const ModuleModifyScreen = () => { // State ---------------------- // Handlers ------------------- // View ----------------------- - return ( - - Modify - - ); + return ( + + Modify + + ); }; const styles = StyleSheet.create({}); diff --git a/src/components/screens/ModuleViewScreen.js b/src/components/screens/ModuleViewScreen.js index 558bc56..6cd2918 100644 --- a/src/components/screens/ModuleViewScreen.js +++ b/src/components/screens/ModuleViewScreen.js @@ -1,21 +1,19 @@ -import { StyleSheet, Text } from "react-native"; +import {StyleSheet} from "react-native"; import Screen from "../layout/Screen"; +import ModuleView from "../entity/modules/ModuleView"; -export const ModuleViewScreen = ({Navigate, route}) => { + +export const ModuleViewScreen = ({ route }) => { // Initialisation ------------- - const { module } = route.params; + const {module} = route.params; // State ---------------------- // Handlers ------------------- // View ----------------------- - return ( - - - View {module.ModuleCode} {module.ModuleName} - - - ); + return ( + + ); }; const styles = StyleSheet.create({});