react-native-elearn-ui 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/lib/module/components/Icon.js +97 -0
  2. package/lib/module/components/Icon.js.map +1 -1
  3. package/lib/module/screens/HomeScreen.js +22 -9
  4. package/lib/module/screens/HomeScreen.js.map +1 -1
  5. package/lib/module/screens/QbankScreen.js +255 -101
  6. package/lib/module/screens/QbankScreen.js.map +1 -1
  7. package/lib/module/screens/QuestionScreen.js +222 -181
  8. package/lib/module/screens/QuestionScreen.js.map +1 -1
  9. package/lib/module/screens/QuizStartScreen.js +137 -133
  10. package/lib/module/screens/QuizStartScreen.js.map +1 -1
  11. package/lib/module/screens/ResultScreen.js +3 -2
  12. package/lib/module/screens/ResultScreen.js.map +1 -1
  13. package/lib/module/screens/TopicListScreen.js +287 -137
  14. package/lib/module/screens/TopicListScreen.js.map +1 -1
  15. package/lib/typescript/src/components/Icon.d.ts +1 -1
  16. package/lib/typescript/src/components/Icon.d.ts.map +1 -1
  17. package/lib/typescript/src/screens/HomeScreen.d.ts +1 -0
  18. package/lib/typescript/src/screens/HomeScreen.d.ts.map +1 -1
  19. package/lib/typescript/src/screens/QbankScreen.d.ts +5 -1
  20. package/lib/typescript/src/screens/QbankScreen.d.ts.map +1 -1
  21. package/lib/typescript/src/screens/QuestionScreen.d.ts +1 -0
  22. package/lib/typescript/src/screens/QuestionScreen.d.ts.map +1 -1
  23. package/lib/typescript/src/screens/QuizStartScreen.d.ts +1 -0
  24. package/lib/typescript/src/screens/QuizStartScreen.d.ts.map +1 -1
  25. package/lib/typescript/src/screens/ResultScreen.d.ts +1 -0
  26. package/lib/typescript/src/screens/ResultScreen.d.ts.map +1 -1
  27. package/lib/typescript/src/screens/TopicListScreen.d.ts +1 -0
  28. package/lib/typescript/src/screens/TopicListScreen.d.ts.map +1 -1
  29. package/lib/typescript/src/types/index.d.ts +22 -0
  30. package/lib/typescript/src/types/index.d.ts.map +1 -1
  31. package/package.json +1 -1
  32. package/src/components/Icon.tsx +125 -1
  33. package/src/screens/HomeScreen.tsx +77 -51
  34. package/src/screens/QbankScreen.tsx +209 -79
  35. package/src/screens/QuestionScreen.tsx +185 -178
  36. package/src/screens/QuizStartScreen.tsx +127 -117
  37. package/src/screens/ResultScreen.tsx +13 -9
  38. package/src/screens/TopicListScreen.tsx +271 -116
  39. package/src/types/index.ts +10 -0
@@ -15,14 +15,15 @@ interface QuizStartScreenProps {
15
15
  course: Course;
16
16
  topic: Topic;
17
17
  onBack: () => void;
18
+ hideHeader?: boolean;
18
19
  }
19
20
 
20
21
  export const QuizStartScreen: React.FC<QuizStartScreenProps> = ({
21
- course,
22
22
  topic,
23
23
  onBack,
24
+ hideHeader = false,
24
25
  }) => {
25
- const { callbacks, getString } = useElearnConfig();
26
+ const { callbacks } = useElearnConfig();
26
27
  const theme = useTheme();
27
28
 
28
29
  const handleStart = () => {
@@ -31,11 +32,15 @@ export const QuizStartScreen: React.FC<QuizStartScreenProps> = ({
31
32
  }
32
33
  };
33
34
 
34
- const infoItems = [
35
- 'Immediate explanation display',
36
- 'Interactive choice evaluation',
37
- 'Self-paced learning structure',
38
- 'Detailed performance scorecard',
35
+ // Mock list of glance topics matching mockup 3
36
+ const glanceTopics = [
37
+ 'Cerebral Cortex',
38
+ 'Cranial Nerves',
39
+ 'Spinal Cord Tracts',
40
+ 'Brainstem Anatomy',
41
+ 'Basal Ganglia',
42
+ 'Thalamus and Hypothalamus',
43
+ 'Visual and Auditory Pathways',
39
44
  ];
40
45
 
41
46
  return (
@@ -43,75 +48,77 @@ export const QuizStartScreen: React.FC<QuizStartScreenProps> = ({
43
48
  <StatusBar barStyle="dark-content" />
44
49
 
45
50
  {/* Header */}
46
- <View style={styles.header}>
47
- <TouchableOpacity
48
- onPress={onBack}
49
- style={[styles.backButton, { borderColor: theme.border }]}
50
- >
51
- <Icon name="arrow-left" size={20} color={theme.textPrimary} />
52
- </TouchableOpacity>
53
- <Typography variant="h3" bold style={styles.headerTitle} numberOfLines={1}>
54
- {course.title}
55
- </Typography>
56
- <View style={styles.headerRightPlaceholder} />
57
- </View>
51
+ {!hideHeader && (
52
+ <View style={styles.header}>
53
+ <TouchableOpacity onPress={onBack} style={styles.backButton}>
54
+ <Icon name="arrow-left" size={20} color={theme.textPrimary} />
55
+ </TouchableOpacity>
56
+ <Typography variant="h2" bold style={styles.headerTitle}>
57
+ QBank
58
+ </Typography>
59
+ <TouchableOpacity style={styles.shareButton}>
60
+ <Icon name="share" size={20} color={theme.textPrimary} />
61
+ </TouchableOpacity>
62
+ </View>
63
+ )}
58
64
 
59
65
  <View style={styles.container}>
60
66
  <View style={styles.content}>
61
67
 
62
- {/* Main Info Card */}
63
- <Card bordered style={styles.mainCard}>
64
- <View style={[styles.badge, { backgroundColor: theme.secondary }]}>
65
- <Typography variant="caption" color={theme.primary} bold>
66
- {course.title.toUpperCase()}
67
- </Typography>
68
- </View>
69
- <Typography variant="h1" bold style={styles.title}>
70
- {topic.title}
71
- </Typography>
72
- <Typography variant="body" color={theme.textSecondary} style={styles.desc}>
73
- Practice questions to master this topic. Dynamic evaluation will track your correctness and accuracy instantly.
74
- </Typography>
75
-
76
- <View style={styles.questionsStatsRow}>
77
- <Icon name="book-open" size={20} color={theme.primary} />
78
- <Typography variant="body" bold style={styles.statsText}>
79
- {topic.totalQuestions} Questions Available
80
- </Typography>
68
+ {/* Section Category Title */}
69
+ <Typography variant="h1" bold color={theme.textPrimary} style={styles.categoryTitle}>
70
+ {topic.category || 'Neuro Anatomy'}
71
+ </Typography>
72
+
73
+ {/* Main Info Box */}
74
+ <Card bordered style={styles.infoCard}>
75
+ <View style={styles.topicHeaderRow}>
76
+ {/* Left Circle Icon */}
77
+ <View style={[styles.iconCircle, { backgroundColor: 'rgba(59, 130, 246, 0.1)' }]}>
78
+ <Icon name="file-text" size={20} color="#3B82F6" />
79
+ </View>
80
+ {/* Right details */}
81
+ <View style={styles.topicHeaderDetails}>
82
+ <Typography variant="h2" bold color={theme.textPrimary} style={styles.topicMainTitle}>
83
+ {topic.title}
84
+ </Typography>
85
+ <Typography variant="caption" color={theme.textSecondary}>
86
+ {topic.totalQuestions} Questions
87
+ </Typography>
88
+ </View>
81
89
  </View>
90
+
91
+ {/* Launch Button inside the card box */}
92
+ <Button
93
+ title="Start QBank"
94
+ onPress={handleStart}
95
+ variant="primary"
96
+ style={[styles.startButton, { backgroundColor: theme.primary }]}
97
+ disabled={!topic.questions || topic.questions.length === 0}
98
+ />
82
99
  </Card>
83
100
 
84
- {/* Guidelines / Info Section */}
85
- <View style={styles.infoSection}>
86
- <Typography variant="h2" bold style={styles.infoTitle}>
87
- {getString('topicsAndItemsLabel')}
101
+ {/* Glance Topics list */}
102
+ <View style={styles.glanceSection}>
103
+ <Typography variant="h2" bold color={theme.textPrimary} style={styles.glanceTitle}>
104
+ Topics at a Glance
105
+ </Typography>
106
+ <Typography variant="body" color={theme.textSecondary} style={styles.glanceSub}>
107
+ It's recommended that you thoroughly study these topics prior to attempting the QBank.
88
108
  </Typography>
89
-
90
- <View style={styles.guidelinesList}>
91
- {infoItems.map((item, idx) => (
92
- <View key={idx} style={styles.infoItemRow}>
93
- <View style={styles.bulletContainer}>
94
- <Icon name="check-circle" size={18} color={theme.primary} />
95
- </View>
96
- <Typography variant="body" color={theme.textSecondary} style={styles.infoItemText}>
109
+
110
+ <View style={styles.bulletList}>
111
+ {glanceTopics.map((item, idx) => (
112
+ <View key={idx} style={styles.bulletRow}>
113
+ <View style={[styles.bulletDot, { backgroundColor: theme.primary }]} />
114
+ <Typography variant="body" color={theme.textPrimary} style={styles.bulletText}>
97
115
  {item}
98
116
  </Typography>
99
117
  </View>
100
118
  ))}
101
119
  </View>
102
120
  </View>
103
-
104
- </View>
105
121
 
106
- {/* Footer Launch Button */}
107
- <View style={[styles.footer, { backgroundColor: theme.cardBackground, borderTopColor: theme.border }]}>
108
- <Button
109
- title={getString('startQuizButton')}
110
- onPress={handleStart}
111
- variant="primary"
112
- style={styles.startButton}
113
- disabled={!topic.questions || topic.questions.length === 0}
114
- />
115
122
  </View>
116
123
  </View>
117
124
  </SafeAreaView>
@@ -126,90 +133,93 @@ const styles = StyleSheet.create({
126
133
  flexDirection: 'row',
127
134
  justifyContent: 'space-between',
128
135
  alignItems: 'center',
129
- paddingHorizontal: 20,
136
+ paddingHorizontal: 16,
130
137
  paddingVertical: 12,
131
138
  },
132
139
  backButton: {
133
- width: 40,
134
- height: 40,
135
- borderRadius: 20,
136
- borderWidth: 1,
137
- justifyContent: 'center',
138
- alignItems: 'center',
140
+ padding: 6,
139
141
  },
140
142
  headerTitle: {
141
- flex: 1,
142
- textAlign: 'center',
143
- marginHorizontal: 12,
143
+ fontSize: 18,
144
+ fontWeight: '700',
144
145
  },
145
- headerRightPlaceholder: {
146
- width: 40,
146
+ shareButton: {
147
+ padding: 6,
147
148
  },
148
149
  container: {
149
150
  flex: 1,
150
- justifyContent: 'space-between',
151
151
  },
152
152
  content: {
153
153
  flex: 1,
154
- paddingHorizontal: 20,
154
+ paddingHorizontal: 16,
155
155
  paddingTop: 12,
156
156
  },
157
- mainCard: {
158
- padding: 24,
159
- borderRadius: 20,
160
- },
161
- badge: {
162
- alignSelf: 'flex-start',
163
- paddingHorizontal: 10,
164
- paddingVertical: 4,
165
- borderRadius: 8,
166
- marginBottom: 12,
167
- },
168
- title: {
157
+ categoryTitle: {
169
158
  fontSize: 22,
170
- lineHeight: 28,
171
- marginBottom: 8,
172
- },
173
- desc: {
174
- lineHeight: 20,
175
159
  marginBottom: 16,
176
160
  },
177
- questionsStatsRow: {
161
+ infoCard: {
162
+ padding: 16,
163
+ borderRadius: 16,
164
+ backgroundColor: '#FFFFFF',
165
+ borderWidth: 1,
166
+ borderColor: '#E2E8F0',
167
+ },
168
+ topicHeaderRow: {
178
169
  flexDirection: 'row',
179
170
  alignItems: 'center',
180
- marginTop: 8,
171
+ marginBottom: 16,
181
172
  },
182
- statsText: {
183
- marginLeft: 8,
173
+ iconCircle: {
174
+ width: 44,
175
+ height: 44,
176
+ borderRadius: 22,
177
+ justifyContent: 'center',
178
+ alignItems: 'center',
179
+ marginRight: 12,
184
180
  },
185
- infoSection: {
186
- marginTop: 28,
181
+ topicHeaderDetails: {
182
+ flex: 1,
187
183
  },
188
- infoTitle: {
189
- marginBottom: 16,
184
+ topicMainTitle: {
185
+ fontSize: 15,
186
+ lineHeight: 19,
187
+ marginBottom: 2,
190
188
  },
191
- guidelinesList: {
192
- marginTop: 4,
189
+ startButton: {
190
+ width: '100%',
191
+ height: 46,
192
+ justifyContent: 'center',
193
+ alignItems: 'center',
194
+ borderRadius: 10,
193
195
  },
194
- infoItemRow: {
195
- flexDirection: 'row',
196
- alignItems: 'flex-start',
197
- marginBottom: 14,
196
+ glanceSection: {
197
+ marginTop: 24,
198
198
  },
199
- bulletContainer: {
200
- marginTop: 1,
199
+ glanceTitle: {
200
+ fontSize: 16,
201
+ marginBottom: 6,
201
202
  },
202
- infoItemText: {
203
- marginLeft: 12,
204
- flex: 1,
203
+ glanceSub: {
204
+ fontSize: 13,
205
205
  lineHeight: 18,
206
+ marginBottom: 16,
206
207
  },
207
- footer: {
208
- paddingHorizontal: 20,
209
- paddingVertical: 16,
210
- borderTopWidth: 1,
208
+ bulletList: {
209
+ marginTop: 4,
211
210
  },
212
- startButton: {
213
- width: '100%',
211
+ bulletRow: {
212
+ flexDirection: 'row',
213
+ alignItems: 'center',
214
+ marginBottom: 12,
215
+ },
216
+ bulletDot: {
217
+ width: 6,
218
+ height: 6,
219
+ borderRadius: 3,
220
+ marginRight: 12,
221
+ },
222
+ bulletText: {
223
+ fontSize: 14,
214
224
  },
215
225
  });
@@ -17,6 +17,7 @@ interface ResultScreenProps {
17
17
  questions: Question[];
18
18
  onClose: () => void;
19
19
  onReviewAnswers?: () => void;
20
+ hideHeader?: boolean;
20
21
  }
21
22
 
22
23
  export const ResultScreen: React.FC<ResultScreenProps> = ({
@@ -24,6 +25,7 @@ export const ResultScreen: React.FC<ResultScreenProps> = ({
24
25
  questions,
25
26
  onClose,
26
27
  onReviewAnswers,
28
+ hideHeader = false,
27
29
  }) => {
28
30
  const { getString } = useElearnConfig();
29
31
  const theme = useTheme();
@@ -42,15 +44,17 @@ export const ResultScreen: React.FC<ResultScreenProps> = ({
42
44
  <StatusBar barStyle="dark-content" />
43
45
 
44
46
  {/* Header */}
45
- <View style={styles.header}>
46
- <View style={styles.headerLeftPlaceholder} />
47
- <Typography variant="h2" bold>
48
- {getString('resultsTitle')}
49
- </Typography>
50
- <TouchableOpacity onPress={onClose} style={styles.closeButton}>
51
- <Icon name="x-circle" size={24} color={theme.textSecondary} />
52
- </TouchableOpacity>
53
- </View>
47
+ {!hideHeader && (
48
+ <View style={styles.header}>
49
+ <View style={styles.headerLeftPlaceholder} />
50
+ <Typography variant="h2" bold>
51
+ {getString('resultsTitle')}
52
+ </Typography>
53
+ <TouchableOpacity onPress={onClose} style={styles.closeButton}>
54
+ <Icon name="x-circle" size={24} color={theme.textSecondary} />
55
+ </TouchableOpacity>
56
+ </View>
57
+ )}
54
58
 
55
59
  <ScrollView contentContainerStyle={styles.scrollContent} showsVerticalScrollIndicator={false}>
56
60