Skip to content
Snippets Groups Projects
Commit 8c8fbe7f authored by GOEPP THOMAS's avatar GOEPP THOMAS
Browse files

:twisted_rightwards_arrows: merge refactor: show good values

Merge branch 'feature/131-show-good-values-of-community-quizzes' into 'develop'
parents a102bc9f dd179b6a
Branches
2 merge requests!132V4.0,!126refactor: show good values
Pipeline #324082 passed with stages
in 15 seconds
......@@ -41,11 +41,14 @@ interface Props {
onQuizPressed:(quiz: Quiz) => void;
}
export default function QuizList({ quizList, isLoadingData, nextPage, onQuizPressed }: Props) {
if (quizList) {
console.log(quizList[0]);
}
const renderQuizItem = ({ item }: { item: Quiz }) => (
<TouchableOpacity style={styles.quizItem} onPress={() => onQuizPressed(item)}>
<Text style={styles.quizTitle}>{item.id}</Text>
<Text style={styles.quizTitle}>{item.name}</Text>
<Text style={styles.quizDetails}>
{item.questionCount} QUESTIONS | {item.category ? item.category.name.toUpperCase() : ""}
{item.questionCount} QUESTIONS | {item.difficulty.name} | {item.author.username}
</Text>
</TouchableOpacity>
);
......
......@@ -13,6 +13,12 @@ export interface Category {
name: string;
}
interface Author {
id: number;
username: string;
}
export interface Quiz {
id: string;
name: string;
......@@ -22,6 +28,7 @@ export interface Quiz {
questionCount: number;
categoryId: number;
difficultyId: number;
author: Author,
authorId: number,
category?: Category,
difficulty: Difficulty,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment