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.
- package/lib/module/components/Icon.js +97 -0
- package/lib/module/components/Icon.js.map +1 -1
- package/lib/module/screens/QbankScreen.js +251 -99
- package/lib/module/screens/QbankScreen.js.map +1 -1
- package/lib/module/screens/QuestionScreen.js +219 -179
- package/lib/module/screens/QuestionScreen.js.map +1 -1
- package/lib/module/screens/QuizStartScreen.js +134 -131
- package/lib/module/screens/QuizStartScreen.js.map +1 -1
- package/lib/module/screens/ResultScreen.js +407 -85
- package/lib/module/screens/ResultScreen.js.map +1 -1
- package/lib/module/screens/TopicListScreen.js +284 -135
- package/lib/module/screens/TopicListScreen.js.map +1 -1
- package/lib/typescript/src/components/Icon.d.ts +1 -1
- package/lib/typescript/src/components/Icon.d.ts.map +1 -1
- package/lib/typescript/src/screens/QbankScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/QuestionScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/QuizStartScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/ResultScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/TopicListScreen.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +4 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Icon.tsx +125 -1
- package/src/screens/QbankScreen.tsx +191 -67
- package/src/screens/QuestionScreen.tsx +179 -176
- package/src/screens/QuizStartScreen.tsx +118 -112
- package/src/screens/ResultScreen.tsx +382 -76
- package/src/screens/TopicListScreen.tsx +262 -111
- 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
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
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="
|
|
57
|
-
|
|
56
|
+
<Typography variant="h2" bold style={styles.headerTitle}>
|
|
57
|
+
QBank
|
|
58
58
|
</Typography>
|
|
59
|
-
<
|
|
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
|
-
{/*
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{
|
|
84
|
-
|
|
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
|
-
{/*
|
|
89
|
-
<View style={styles.
|
|
90
|
-
<Typography variant="h2" bold style={styles.
|
|
91
|
-
|
|
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.
|
|
95
|
-
{
|
|
96
|
-
<View key={idx} style={styles.
|
|
97
|
-
<View style={styles.
|
|
98
|
-
|
|
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:
|
|
136
|
+
paddingHorizontal: 16,
|
|
134
137
|
paddingVertical: 12,
|
|
135
138
|
},
|
|
136
139
|
backButton: {
|
|
137
|
-
|
|
138
|
-
height: 40,
|
|
139
|
-
borderRadius: 20,
|
|
140
|
-
borderWidth: 1,
|
|
141
|
-
justifyContent: 'center',
|
|
142
|
-
alignItems: 'center',
|
|
140
|
+
padding: 6,
|
|
143
141
|
},
|
|
144
142
|
headerTitle: {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
marginHorizontal: 12,
|
|
143
|
+
fontSize: 18,
|
|
144
|
+
fontWeight: '700',
|
|
148
145
|
},
|
|
149
|
-
|
|
150
|
-
|
|
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:
|
|
154
|
+
paddingHorizontal: 16,
|
|
159
155
|
paddingTop: 12,
|
|
160
156
|
},
|
|
161
|
-
|
|
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
|
-
|
|
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
|
-
|
|
171
|
+
marginBottom: 16,
|
|
185
172
|
},
|
|
186
|
-
|
|
187
|
-
|
|
173
|
+
iconCircle: {
|
|
174
|
+
width: 44,
|
|
175
|
+
height: 44,
|
|
176
|
+
borderRadius: 22,
|
|
177
|
+
justifyContent: 'center',
|
|
178
|
+
alignItems: 'center',
|
|
179
|
+
marginRight: 12,
|
|
188
180
|
},
|
|
189
|
-
|
|
190
|
-
|
|
181
|
+
topicHeaderDetails: {
|
|
182
|
+
flex: 1,
|
|
191
183
|
},
|
|
192
|
-
|
|
193
|
-
|
|
184
|
+
topicMainTitle: {
|
|
185
|
+
fontSize: 15,
|
|
186
|
+
lineHeight: 19,
|
|
187
|
+
marginBottom: 2,
|
|
194
188
|
},
|
|
195
|
-
|
|
196
|
-
|
|
189
|
+
startButton: {
|
|
190
|
+
width: '100%',
|
|
191
|
+
height: 46,
|
|
192
|
+
justifyContent: 'center',
|
|
193
|
+
alignItems: 'center',
|
|
194
|
+
borderRadius: 10,
|
|
197
195
|
},
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
alignItems: 'flex-start',
|
|
201
|
-
marginBottom: 14,
|
|
196
|
+
glanceSection: {
|
|
197
|
+
marginTop: 24,
|
|
202
198
|
},
|
|
203
|
-
|
|
204
|
-
|
|
199
|
+
glanceTitle: {
|
|
200
|
+
fontSize: 16,
|
|
201
|
+
marginBottom: 6,
|
|
205
202
|
},
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
flex: 1,
|
|
203
|
+
glanceSub: {
|
|
204
|
+
fontSize: 13,
|
|
209
205
|
lineHeight: 18,
|
|
206
|
+
marginBottom: 16,
|
|
210
207
|
},
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
paddingVertical: 16,
|
|
214
|
-
borderTopWidth: 1,
|
|
208
|
+
bulletList: {
|
|
209
|
+
marginTop: 4,
|
|
215
210
|
},
|
|
216
|
-
|
|
217
|
-
|
|
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
|
});
|