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.
- package/lib/module/components/Icon.js +97 -0
- package/lib/module/components/Icon.js.map +1 -1
- package/lib/module/screens/HomeScreen.js +22 -9
- package/lib/module/screens/HomeScreen.js.map +1 -1
- package/lib/module/screens/QbankScreen.js +255 -101
- package/lib/module/screens/QbankScreen.js.map +1 -1
- package/lib/module/screens/QuestionScreen.js +222 -181
- package/lib/module/screens/QuestionScreen.js.map +1 -1
- package/lib/module/screens/QuizStartScreen.js +137 -133
- package/lib/module/screens/QuizStartScreen.js.map +1 -1
- package/lib/module/screens/ResultScreen.js +3 -2
- package/lib/module/screens/ResultScreen.js.map +1 -1
- package/lib/module/screens/TopicListScreen.js +287 -137
- 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/HomeScreen.d.ts +1 -0
- package/lib/typescript/src/screens/HomeScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/QbankScreen.d.ts +5 -1
- package/lib/typescript/src/screens/QbankScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/QuestionScreen.d.ts +1 -0
- package/lib/typescript/src/screens/QuestionScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/QuizStartScreen.d.ts +1 -0
- package/lib/typescript/src/screens/QuizStartScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/ResultScreen.d.ts +1 -0
- package/lib/typescript/src/screens/ResultScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/TopicListScreen.d.ts +1 -0
- package/lib/typescript/src/screens/TopicListScreen.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +22 -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/HomeScreen.tsx +77 -51
- package/src/screens/QbankScreen.tsx +209 -79
- package/src/screens/QuestionScreen.tsx +185 -178
- package/src/screens/QuizStartScreen.tsx +127 -117
- package/src/screens/ResultScreen.tsx +13 -9
- package/src/screens/TopicListScreen.tsx +271 -116
- 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
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
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
|
-
|
|
47
|
-
<
|
|
48
|
-
onPress={onBack}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
{/*
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<
|
|
70
|
-
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
|
|
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
|
-
{/*
|
|
85
|
-
<View style={styles.
|
|
86
|
-
<Typography variant="h2" bold style={styles.
|
|
87
|
-
|
|
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.
|
|
91
|
-
{
|
|
92
|
-
<View key={idx} style={styles.
|
|
93
|
-
<View style={styles.
|
|
94
|
-
|
|
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:
|
|
136
|
+
paddingHorizontal: 16,
|
|
130
137
|
paddingVertical: 12,
|
|
131
138
|
},
|
|
132
139
|
backButton: {
|
|
133
|
-
|
|
134
|
-
height: 40,
|
|
135
|
-
borderRadius: 20,
|
|
136
|
-
borderWidth: 1,
|
|
137
|
-
justifyContent: 'center',
|
|
138
|
-
alignItems: 'center',
|
|
140
|
+
padding: 6,
|
|
139
141
|
},
|
|
140
142
|
headerTitle: {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
marginHorizontal: 12,
|
|
143
|
+
fontSize: 18,
|
|
144
|
+
fontWeight: '700',
|
|
144
145
|
},
|
|
145
|
-
|
|
146
|
-
|
|
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:
|
|
154
|
+
paddingHorizontal: 16,
|
|
155
155
|
paddingTop: 12,
|
|
156
156
|
},
|
|
157
|
-
|
|
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
|
-
|
|
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
|
-
|
|
171
|
+
marginBottom: 16,
|
|
181
172
|
},
|
|
182
|
-
|
|
183
|
-
|
|
173
|
+
iconCircle: {
|
|
174
|
+
width: 44,
|
|
175
|
+
height: 44,
|
|
176
|
+
borderRadius: 22,
|
|
177
|
+
justifyContent: 'center',
|
|
178
|
+
alignItems: 'center',
|
|
179
|
+
marginRight: 12,
|
|
184
180
|
},
|
|
185
|
-
|
|
186
|
-
|
|
181
|
+
topicHeaderDetails: {
|
|
182
|
+
flex: 1,
|
|
187
183
|
},
|
|
188
|
-
|
|
189
|
-
|
|
184
|
+
topicMainTitle: {
|
|
185
|
+
fontSize: 15,
|
|
186
|
+
lineHeight: 19,
|
|
187
|
+
marginBottom: 2,
|
|
190
188
|
},
|
|
191
|
-
|
|
192
|
-
|
|
189
|
+
startButton: {
|
|
190
|
+
width: '100%',
|
|
191
|
+
height: 46,
|
|
192
|
+
justifyContent: 'center',
|
|
193
|
+
alignItems: 'center',
|
|
194
|
+
borderRadius: 10,
|
|
193
195
|
},
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
alignItems: 'flex-start',
|
|
197
|
-
marginBottom: 14,
|
|
196
|
+
glanceSection: {
|
|
197
|
+
marginTop: 24,
|
|
198
198
|
},
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
glanceTitle: {
|
|
200
|
+
fontSize: 16,
|
|
201
|
+
marginBottom: 6,
|
|
201
202
|
},
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
flex: 1,
|
|
203
|
+
glanceSub: {
|
|
204
|
+
fontSize: 13,
|
|
205
205
|
lineHeight: 18,
|
|
206
|
+
marginBottom: 16,
|
|
206
207
|
},
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
paddingVertical: 16,
|
|
210
|
-
borderTopWidth: 1,
|
|
208
|
+
bulletList: {
|
|
209
|
+
marginTop: 4,
|
|
211
210
|
},
|
|
212
|
-
|
|
213
|
-
|
|
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
|
-
|
|
46
|
-
<View style={styles.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
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
|
|