react-native-elearn-ui 0.1.5 → 0.1.7

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 (29) 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/QbankScreen.js +251 -99
  4. package/lib/module/screens/QbankScreen.js.map +1 -1
  5. package/lib/module/screens/QuestionScreen.js +219 -179
  6. package/lib/module/screens/QuestionScreen.js.map +1 -1
  7. package/lib/module/screens/QuizStartScreen.js +134 -131
  8. package/lib/module/screens/QuizStartScreen.js.map +1 -1
  9. package/lib/module/screens/ResultScreen.js +407 -85
  10. package/lib/module/screens/ResultScreen.js.map +1 -1
  11. package/lib/module/screens/TopicListScreen.js +284 -135
  12. package/lib/module/screens/TopicListScreen.js.map +1 -1
  13. package/lib/typescript/src/components/Icon.d.ts +1 -1
  14. package/lib/typescript/src/components/Icon.d.ts.map +1 -1
  15. package/lib/typescript/src/screens/QbankScreen.d.ts.map +1 -1
  16. package/lib/typescript/src/screens/QuestionScreen.d.ts.map +1 -1
  17. package/lib/typescript/src/screens/QuizStartScreen.d.ts.map +1 -1
  18. package/lib/typescript/src/screens/ResultScreen.d.ts.map +1 -1
  19. package/lib/typescript/src/screens/TopicListScreen.d.ts.map +1 -1
  20. package/lib/typescript/src/types/index.d.ts +4 -0
  21. package/lib/typescript/src/types/index.d.ts.map +1 -1
  22. package/package.json +1 -1
  23. package/src/components/Icon.tsx +125 -1
  24. package/src/screens/QbankScreen.tsx +191 -67
  25. package/src/screens/QuestionScreen.tsx +179 -176
  26. package/src/screens/QuizStartScreen.tsx +118 -112
  27. package/src/screens/ResultScreen.tsx +382 -76
  28. package/src/screens/TopicListScreen.tsx +262 -111
  29. package/src/types/index.ts +4 -0
@@ -19,12 +19,11 @@ interface QuizStartScreenProps {
19
19
  }
20
20
 
21
21
  export const QuizStartScreen: React.FC<QuizStartScreenProps> = ({
22
- course,
23
22
  topic,
24
23
  onBack,
25
24
  hideHeader = false,
26
25
  }) => {
27
- const { callbacks, getString } = useElearnConfig();
26
+ const { callbacks } = useElearnConfig();
28
27
  const theme = useTheme();
29
28
 
30
29
  const handleStart = () => {
@@ -33,11 +32,15 @@ export const QuizStartScreen: React.FC<QuizStartScreenProps> = ({
33
32
  }
34
33
  };
35
34
 
36
- const infoItems = [
37
- 'Immediate explanation display',
38
- 'Interactive choice evaluation',
39
- 'Self-paced learning structure',
40
- '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',
41
44
  ];
42
45
 
43
46
  return (
@@ -47,75 +50,75 @@ export const QuizStartScreen: React.FC<QuizStartScreenProps> = ({
47
50
  {/* Header */}
48
51
  {!hideHeader && (
49
52
  <View style={styles.header}>
50
- <TouchableOpacity
51
- onPress={onBack}
52
- style={[styles.backButton, { borderColor: theme.border }]}
53
- >
53
+ <TouchableOpacity onPress={onBack} style={styles.backButton}>
54
54
  <Icon name="arrow-left" size={20} color={theme.textPrimary} />
55
55
  </TouchableOpacity>
56
- <Typography variant="h3" bold style={styles.headerTitle} numberOfLines={1}>
57
- {course.title}
56
+ <Typography variant="h2" bold style={styles.headerTitle}>
57
+ QBank
58
58
  </Typography>
59
- <View style={styles.headerRightPlaceholder} />
59
+ <TouchableOpacity style={styles.shareButton}>
60
+ <Icon name="share" size={20} color={theme.textPrimary} />
61
+ </TouchableOpacity>
60
62
  </View>
61
63
  )}
62
64
 
63
65
  <View style={styles.container}>
64
66
  <View style={styles.content}>
65
67
 
66
- {/* Main Info Card */}
67
- <Card bordered style={styles.mainCard}>
68
- <View style={[styles.badge, { backgroundColor: theme.secondary }]}>
69
- <Typography variant="caption" color={theme.primary} bold>
70
- {course.title.toUpperCase()}
71
- </Typography>
72
- </View>
73
- <Typography variant="h1" bold style={styles.title}>
74
- {topic.title}
75
- </Typography>
76
- <Typography variant="body" color={theme.textSecondary} style={styles.desc}>
77
- Practice questions to master this topic. Dynamic evaluation will track your correctness and accuracy instantly.
78
- </Typography>
79
-
80
- <View style={styles.questionsStatsRow}>
81
- <Icon name="book-open" size={20} color={theme.primary} />
82
- <Typography variant="body" bold style={styles.statsText}>
83
- {topic.totalQuestions} Questions Available
84
- </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>
85
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
+ />
86
99
  </Card>
87
100
 
88
- {/* Guidelines / Info Section */}
89
- <View style={styles.infoSection}>
90
- <Typography variant="h2" bold style={styles.infoTitle}>
91
- {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.
92
108
  </Typography>
93
-
94
- <View style={styles.guidelinesList}>
95
- {infoItems.map((item, idx) => (
96
- <View key={idx} style={styles.infoItemRow}>
97
- <View style={styles.bulletContainer}>
98
- <Icon name="check-circle" size={18} color={theme.primary} />
99
- </View>
100
- <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}>
101
115
  {item}
102
116
  </Typography>
103
117
  </View>
104
118
  ))}
105
119
  </View>
106
120
  </View>
107
-
108
- </View>
109
121
 
110
- {/* Footer Launch Button */}
111
- <View style={[styles.footer, { backgroundColor: theme.cardBackground, borderTopColor: theme.border }]}>
112
- <Button
113
- title={getString('startQuizButton')}
114
- onPress={handleStart}
115
- variant="primary"
116
- style={styles.startButton}
117
- disabled={!topic.questions || topic.questions.length === 0}
118
- />
119
122
  </View>
120
123
  </View>
121
124
  </SafeAreaView>
@@ -130,90 +133,93 @@ const styles = StyleSheet.create({
130
133
  flexDirection: 'row',
131
134
  justifyContent: 'space-between',
132
135
  alignItems: 'center',
133
- paddingHorizontal: 20,
136
+ paddingHorizontal: 16,
134
137
  paddingVertical: 12,
135
138
  },
136
139
  backButton: {
137
- width: 40,
138
- height: 40,
139
- borderRadius: 20,
140
- borderWidth: 1,
141
- justifyContent: 'center',
142
- alignItems: 'center',
140
+ padding: 6,
143
141
  },
144
142
  headerTitle: {
145
- flex: 1,
146
- textAlign: 'center',
147
- marginHorizontal: 12,
143
+ fontSize: 18,
144
+ fontWeight: '700',
148
145
  },
149
- headerRightPlaceholder: {
150
- width: 40,
146
+ shareButton: {
147
+ padding: 6,
151
148
  },
152
149
  container: {
153
150
  flex: 1,
154
- justifyContent: 'space-between',
155
151
  },
156
152
  content: {
157
153
  flex: 1,
158
- paddingHorizontal: 20,
154
+ paddingHorizontal: 16,
159
155
  paddingTop: 12,
160
156
  },
161
- mainCard: {
162
- padding: 24,
163
- borderRadius: 20,
164
- },
165
- badge: {
166
- alignSelf: 'flex-start',
167
- paddingHorizontal: 10,
168
- paddingVertical: 4,
169
- borderRadius: 8,
170
- marginBottom: 12,
171
- },
172
- title: {
157
+ categoryTitle: {
173
158
  fontSize: 22,
174
- lineHeight: 28,
175
- marginBottom: 8,
176
- },
177
- desc: {
178
- lineHeight: 20,
179
159
  marginBottom: 16,
180
160
  },
181
- questionsStatsRow: {
161
+ infoCard: {
162
+ padding: 16,
163
+ borderRadius: 16,
164
+ backgroundColor: '#FFFFFF',
165
+ borderWidth: 1,
166
+ borderColor: '#E2E8F0',
167
+ },
168
+ topicHeaderRow: {
182
169
  flexDirection: 'row',
183
170
  alignItems: 'center',
184
- marginTop: 8,
171
+ marginBottom: 16,
185
172
  },
186
- statsText: {
187
- marginLeft: 8,
173
+ iconCircle: {
174
+ width: 44,
175
+ height: 44,
176
+ borderRadius: 22,
177
+ justifyContent: 'center',
178
+ alignItems: 'center',
179
+ marginRight: 12,
188
180
  },
189
- infoSection: {
190
- marginTop: 28,
181
+ topicHeaderDetails: {
182
+ flex: 1,
191
183
  },
192
- infoTitle: {
193
- marginBottom: 16,
184
+ topicMainTitle: {
185
+ fontSize: 15,
186
+ lineHeight: 19,
187
+ marginBottom: 2,
194
188
  },
195
- guidelinesList: {
196
- marginTop: 4,
189
+ startButton: {
190
+ width: '100%',
191
+ height: 46,
192
+ justifyContent: 'center',
193
+ alignItems: 'center',
194
+ borderRadius: 10,
197
195
  },
198
- infoItemRow: {
199
- flexDirection: 'row',
200
- alignItems: 'flex-start',
201
- marginBottom: 14,
196
+ glanceSection: {
197
+ marginTop: 24,
202
198
  },
203
- bulletContainer: {
204
- marginTop: 1,
199
+ glanceTitle: {
200
+ fontSize: 16,
201
+ marginBottom: 6,
205
202
  },
206
- infoItemText: {
207
- marginLeft: 12,
208
- flex: 1,
203
+ glanceSub: {
204
+ fontSize: 13,
209
205
  lineHeight: 18,
206
+ marginBottom: 16,
210
207
  },
211
- footer: {
212
- paddingHorizontal: 20,
213
- paddingVertical: 16,
214
- borderTopWidth: 1,
208
+ bulletList: {
209
+ marginTop: 4,
215
210
  },
216
- startButton: {
217
- 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,
218
224
  },
219
225
  });