forked from Winz18/Online-Learning-Mobile_app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModuleScreen.tsx
43 lines (36 loc) · 1.06 KB
/
ModuleScreen.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React from "react";
import { ScrollView, StyleSheet, View } from "react-native";
import { NavigationProp } from "@react-navigation/native";
import ModuleHeader from "./components/subject-page/header/ModuleHeader";
import ModuleContent from "./components/subject-page/subject-content/ModuleContent";
import { useAuth } from "./AuthProvider.tsx";
type SectionProps = {
navigation: NavigationProp<any, any>;
route: any;
};
function ModuleScreen({ route, navigation }: SectionProps): React.JSX.Element {
const { user } = useAuth();
const { article } = route.params;
const backToCourse = () => {
navigation.goBack();
};
const goToTest = () => {
navigation.navigate("Quiz", {article})
};
return (
<View style={styles.container}>
<ScrollView>
<View>
<ModuleHeader goBack={backToCourse} goToTest={goToTest} article={article} />
<ModuleContent article={article} />
</View>
</ScrollView>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1
}
});
export default ModuleScreen;