react-native-elearn-ui 0.1.25 → 0.1.28
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 +30 -0
- package/lib/module/components/Icon.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/screens/index.js +1 -0
- package/lib/module/screens/index.js.map +1 -1
- package/lib/module/screens/qbank/QBankQuestionScreen.js +415 -0
- package/lib/module/screens/qbank/QBankQuestionScreen.js.map +1 -0
- package/lib/module/screens/qbank/QBankSubTopicScreen.js +20 -17
- package/lib/module/screens/qbank/QBankSubTopicScreen.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/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/index.d.ts +1 -0
- package/lib/typescript/src/screens/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/qbank/QBankQuestionScreen.d.ts +16 -0
- package/lib/typescript/src/screens/qbank/QBankQuestionScreen.d.ts.map +1 -0
- package/lib/typescript/src/screens/qbank/QBankSubTopicScreen.d.ts +1 -0
- package/lib/typescript/src/screens/qbank/QBankSubTopicScreen.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +15 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Icon.tsx +12 -2
- package/src/index.tsx +1 -0
- package/src/screens/index.ts +1 -0
- package/src/screens/qbank/QBankQuestionScreen.tsx +393 -0
- package/src/screens/qbank/QBankSubTopicScreen.tsx +15 -13
- package/src/types/index.ts +17 -0
|
@@ -19,6 +19,7 @@ interface QBankSubTopicScreenProps {
|
|
|
19
19
|
onPressModule?: (moduleId: string) => void;
|
|
20
20
|
onPressFilter?: (filter: string) => void;
|
|
21
21
|
onPressSearch?: () => void;
|
|
22
|
+
isProUser?: boolean;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export const QBankSubTopicScreen: React.FC<QBankSubTopicScreenProps> = ({
|
|
@@ -28,6 +29,7 @@ export const QBankSubTopicScreen: React.FC<QBankSubTopicScreenProps> = ({
|
|
|
28
29
|
onPressModule,
|
|
29
30
|
onPressFilter,
|
|
30
31
|
onPressSearch,
|
|
32
|
+
isProUser = false,
|
|
31
33
|
}) => {
|
|
32
34
|
const theme = useTheme();
|
|
33
35
|
const [activeFilter, setActiveFilter] = useState(params.activeFilter || params.filters[0]);
|
|
@@ -191,25 +193,27 @@ export const QBankSubTopicScreen: React.FC<QBankSubTopicScreenProps> = ({
|
|
|
191
193
|
</Typography>
|
|
192
194
|
</View>
|
|
193
195
|
)}
|
|
194
|
-
{moduleItem.status === 'locked' && (
|
|
195
|
-
<View style={styles.
|
|
196
|
-
<
|
|
196
|
+
{moduleItem.status === 'locked' && !isProUser && (
|
|
197
|
+
<View style={styles.proBadge}>
|
|
198
|
+
<Typography variant="caption" bold color="#FFFFFF" style={{fontSize: 7}}>
|
|
199
|
+
PRO
|
|
200
|
+
</Typography>
|
|
197
201
|
</View>
|
|
198
202
|
)}
|
|
199
203
|
{moduleItem.attemptStatus === 'resume' && (
|
|
200
|
-
<Typography variant="caption" bold color="#F59E0B" style={{fontSize:
|
|
204
|
+
<Typography variant="caption" bold color="#F59E0B" style={{fontSize: 9}}>
|
|
201
205
|
RESUME
|
|
202
206
|
</Typography>
|
|
203
207
|
)}
|
|
204
208
|
{moduleItem.attemptStatus === 'completed' && (
|
|
205
209
|
<View style={{ alignItems: 'flex-end' }}>
|
|
206
210
|
<View style={styles.completedBadge}>
|
|
207
|
-
<Typography variant="caption" bold color="#FFFFFF" style={{fontSize:
|
|
211
|
+
<Typography variant="caption" bold color="#FFFFFF" style={{fontSize: 7}}>
|
|
208
212
|
COMPLETED
|
|
209
213
|
</Typography>
|
|
210
214
|
</View>
|
|
211
215
|
{moduleItem.correctPercentage !== undefined && (
|
|
212
|
-
<Typography variant="caption" bold color={theme.success} style={{fontSize:
|
|
216
|
+
<Typography variant="caption" bold color={theme.success} style={{fontSize: 10, marginTop: 4}}>
|
|
213
217
|
{moduleItem.correctPercentage}% Correct
|
|
214
218
|
</Typography>
|
|
215
219
|
)}
|
|
@@ -427,13 +431,11 @@ const styles = StyleSheet.create({
|
|
|
427
431
|
borderColor: '#10B981',
|
|
428
432
|
backgroundColor: '#FFFFFF',
|
|
429
433
|
},
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
borderRadius:
|
|
434
|
-
backgroundColor: '#
|
|
435
|
-
justifyContent: 'center',
|
|
436
|
-
alignItems: 'center',
|
|
434
|
+
proBadge: {
|
|
435
|
+
paddingHorizontal: 6,
|
|
436
|
+
paddingVertical: 2,
|
|
437
|
+
borderRadius: 4,
|
|
438
|
+
backgroundColor: '#F59E0B',
|
|
437
439
|
},
|
|
438
440
|
completedBadge: {
|
|
439
441
|
paddingHorizontal: 6,
|
package/src/types/index.ts
CHANGED
|
@@ -239,6 +239,23 @@ export interface QBankSubTopicSection {
|
|
|
239
239
|
modules: QBankSubTopicModule[];
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
+
export interface QBankOption {
|
|
243
|
+
id: string;
|
|
244
|
+
text: string;
|
|
245
|
+
status: 'default' | 'correct' | 'incorrect';
|
|
246
|
+
percentage?: number; // e.g. 20 for [20%]
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export interface QBankQuestionParams {
|
|
250
|
+
headerTitle: string;
|
|
251
|
+
questionNumber: number;
|
|
252
|
+
totalQuestions: number;
|
|
253
|
+
questionText: string;
|
|
254
|
+
options: QBankOption[];
|
|
255
|
+
explanation?: string;
|
|
256
|
+
referenceId?: string;
|
|
257
|
+
}
|
|
258
|
+
|
|
242
259
|
export interface QBankSubTopicParams {
|
|
243
260
|
header: {
|
|
244
261
|
title: string;
|