Added Deleting modules functionality and removed modules import on module list that was stopping the screen from updating as it was using imported attribute rather than what was pasased onto it.

This commit is contained in:
bobbert committed 2025-10-25 22:04:16 +01:00
1 parent 0439b7ab33
commit 54e73d32e0
3 files changed
+21 -15

No files matched your search

+2 -2
View File
@@ -22,10 +22,10 @@ const styles = StyleSheet.create({
modulesItem: {
paddingVertical: 15,
borderBottomWidth: 1,
borderBottomColor: "light grey",
borderBottomColor: "lightgray",
},
text: {
// fontSize: 16,
fontSize: 18,
},
});
+7 -6
View File
@@ -1,9 +1,8 @@
import {StyleSheet, ScrollView } from "react-native";
import modules from "../../../data/modules";
import ModuleItem from "./ModuleItem";
import React from "react";
const ModuleList = ({module, onSelect }) => {
const ModuleList = ({modules, onSelect }) => {
// Initialisation -------------
// State ----------------------
// Handlers -------------------
@@ -13,7 +12,11 @@ const ModuleList = ({module, onSelect }) => {
<ScrollView style={styles.modulesContainer}>
{modules.map((module) => {
return(
<ModuleItem module={module} key={module.ModuleCode} onSelect={onSelect} />
<ModuleItem
module={module}
key={module.ModuleCode}
onSelect={onSelect}
/>
)
})
}
@@ -23,9 +26,7 @@ const ModuleList = ({module, onSelect }) => {
const styles = StyleSheet.create({
modulesContainer: {
},
modulesContainer: {},
});
export default ModuleList;