Browse Source

Eliminacion de los titulos en el header, imagenes correspondientes en pagina de Quiz

ryanbarreto1 1 year ago
parent
commit
51f2b2d455

+ 10
- 1
src/data/BioInfo.ts View File

@@ -16,4 +16,13 @@ export interface BioInfo {
16 16
 
17 17
 export const getMessages = () => ListBio;
18 18
 
19
-export const getMessage = (id: number) => ListBio.find(m => m.id === id);
19
+export const getMessage = (id: number) => ListBio.find(m => m.id === id);
20
+
21
+export function getBioInfoPhoto (id: number) {
22
+    const bio = ListBio.find(bio => bio.id === id);
23
+
24
+    if (bio) {
25
+        return bio.photo;
26
+    }
27
+    return undefined;
28
+}

+ 2
- 2
src/data/Biograph.json View File

@@ -1,7 +1,7 @@
1 1
 [
2 2
     {
3 3
         "id": 1,
4
-        "title": "Roberto Clemente",
4
+        "title": "Roberto Clemente Walker",
5 5
         "tags": "Pelotero, Filántropo",
6 6
         "birth": "Nació: 1934",
7 7
         "place": "Lugar: San Antón, Carolina",
@@ -118,7 +118,7 @@
118 118
     },
119 119
     {
120 120
         "id": 10,
121
-        "title": "Marian Villaronga Toro",
121
+        "title": "Mariano Villaronga Toro",
122 122
         "tags": "Educador, Funcionario público",
123 123
         "birth": "Nació: ",
124 124
         "place": "Lugar: ",

+ 22
- 1
src/data/Quizzes.json View File

@@ -1,7 +1,7 @@
1 1
 [
2 2
     {
3 3
         "id": 1,
4
-        "title": "Roberto Clemente",
4
+        "title": "Roberto Clemente Walker",
5 5
 
6 6
         "pregunta1": "¿En que año nació Roberto Clemente?",
7 7
         "res1":["1934","1950","1943","2022"],
@@ -189,4 +189,25 @@
189 189
         "res4": ["41","42","43","44"],
190 190
         "correcta4":"44"
191 191
     }
192
+    ,
193
+    {
194
+        "id":10,
195
+        "title": "Mariano Villaronga Toro",
196
+
197
+        "pregunta1": "Mariano1",
198
+        "res1": ["11","12","13","14"],
199
+        "correcta1":"11",
200
+
201
+        "pregunta2": "Mariano2",
202
+        "res2": ["21","22","23","24"],
203
+        "correcta2":"22",
204
+
205
+        "pregunta3": "Mariano3",
206
+        "res3": ["31","32","33","34"],
207
+        "correcta3":"33",
208
+
209
+        "pregunta4": "Mariano4",
210
+        "res4": ["41","42","43","44"],
211
+        "correcta4":"44"
212
+    }
192 213
 ]

+ 1
- 2
src/pages/AboutUs.tsx View File

@@ -2,7 +2,6 @@ import {
2 2
   IonImg,
3 3
   IonContent,
4 4
   IonHeader,
5
-  IonTitle,
6 5
   IonPage,
7 6
   IonToolbar,
8 7
   IonFooter,
@@ -27,7 +26,7 @@ const AboutUs: React.FC = () => {
27 26
               <IonCol></IonCol>
28 27
               <IonCol>
29 28
                 <IonImg style={{ height: 50, width: 100 }} src={EnciclopediaPR} alt='Logo'></IonImg>
30
-                <IonTitle>Más sobre nosotros</IonTitle>
29
+                
31 30
               </IonCol>
32 31
               <IonCol></IonCol>
33 32
             </IonRow>

+ 1
- 2
src/pages/Biography.tsx View File

@@ -2,7 +2,6 @@ import {
2 2
     IonPage,
3 3
     IonContent,
4 4
     IonHeader,
5
-    IonTitle,
6 5
     IonToolbar,
7 6
     IonFooter,
8 7
     IonImg,
@@ -40,7 +39,7 @@ const Biography: React.FC = () => {
40 39
                             <IonCol></IonCol>
41 40
                             <IonCol>
42 41
                                 <IonImg style={{ height: 50, width: 100 }} src={EnciclopediaPR} alt='Logo'></IonImg>
43
-                                <IonTitle>Biografía</IonTitle>
42
+                                
44 43
                             </IonCol>
45 44
                             <IonCol></IonCol>
46 45
                         </IonRow>

+ 1
- 2
src/pages/Capsule.tsx View File

@@ -2,7 +2,6 @@ import {
2 2
     IonPage,
3 3
     IonContent,
4 4
     IonHeader,
5
-    IonTitle,
6 5
     IonToolbar,
7 6
     IonFooter,
8 7
     IonImg,
@@ -41,7 +40,7 @@ const Capsule: React.FC = () => {
41 40
                             <IonCol></IonCol>
42 41
                             <IonCol>
43 42
                                 <IonImg style={{ height: 50, width: 100 }} src={EnciclopediaPR} alt='Logo'></IonImg>
44
-                                <IonTitle>Cápsula</IonTitle>
43
+                                
45 44
                             </IonCol>
46 45
                             <IonCol></IonCol>
47 46
                         </IonRow>

+ 1
- 2
src/pages/HomePage.tsx View File

@@ -2,7 +2,6 @@ import {
2 2
   IonContent,
3 3
   IonHeader,
4 4
   IonPage,
5
-  IonTitle,
6 5
   IonToolbar,
7 6
   IonCard,
8 7
   IonCardHeader,
@@ -33,7 +32,7 @@ const HomePage: React.FC = () => {
33 32
               <IonCol></IonCol>
34 33
               <IonCol>
35 34
                 <IonImg style={{ height: 50, width: 100 }} src={EnciclopediaPR} alt='Logo'></IonImg>
36
-                <IonTitle>Hogar</IonTitle>
35
+                
37 36
               </IonCol>
38 37
               <IonCol></IonCol>
39 38
             </IonRow>

+ 1
- 2
src/pages/ListBiographies.tsx View File

@@ -3,7 +3,6 @@ import {
3 3
   IonContent,
4 4
   IonHeader,
5 5
   IonPage,
6
-  IonTitle,
7 6
   IonToolbar,
8 7
   IonFooter,
9 8
   IonGrid,
@@ -26,7 +25,7 @@ const ListBiographies: React.FC = () => {
26 25
               <IonCol></IonCol>
27 26
               <IonCol>
28 27
                 <IonImg style={{ height: 50, width: 100 }} src={EnciclopediaPR} alt='Logo'></IonImg>
29
-                <IonTitle>Lista de Biografías</IonTitle>
28
+                
30 29
               </IonCol>
31 30
               <IonCol></IonCol>
32 31
             </IonRow>

+ 1
- 2
src/pages/ListCapsules.tsx View File

@@ -3,7 +3,6 @@ import {
3 3
   IonContent,
4 4
   IonHeader,
5 5
   IonPage,
6
-  IonTitle,
7 6
   IonToolbar,
8 7
   IonFooter,
9 8
   IonGrid,
@@ -26,7 +25,7 @@ const ListCapsules: React.FC = () => {
26 25
               <IonCol></IonCol>
27 26
               <IonCol>
28 27
                 <IonImg style={{ height: 50, width: 100 }} src={EnciclopediaPR} alt='Logo'></IonImg>
29
-                <IonTitle>Lista de Cápsulas de Contenido</IonTitle>
28
+                
30 29
               </IonCol>
31 30
               <IonCol></IonCol>
32 31
             </IonRow>

+ 8
- 6
src/pages/Questions.tsx View File

@@ -2,7 +2,6 @@ import {
2 2
     IonPage,
3 3
     IonContent,
4 4
     IonHeader,
5
-    IonTitle,
6 5
     IonToolbar,
7 6
     IonFooter,
8 7
     IonImg,
@@ -30,8 +29,8 @@ import { useParams } from 'react-router';
30 29
 import React, { useState } from 'react';
31 30
 import './Questions.css';
32 31
 import EnciclopediaPR from '../assets/EnciclopediaPR.png';
33
-import RobertoClemente from '../assets/RobertoClemente.jpg';
34 32
 import { QuizInfo, getQuiz } from '../data/QuizInfo';
33
+import { getBioInfoPhoto } from '../data/BioInfo';
35 34
 import { thumbsDown, thumbsUp } from 'ionicons/icons';
36 35
 
37 36
 
@@ -80,9 +79,9 @@ const Questions: React.FC = () => {
80 79
         ThumbsDowmn para seleccion incorrecta.
81 80
     */
82 81
     const verificarRes = () => {
83
-        // borrar console logs para el release
82
+        /* borrar console logs para el release
84 83
         console.log([qres1, qres2, qres3, qres4]);
85
-        console.log(countres);
84
+        console.log(countres);*/
86 85
 
87 86
         // reset a los icons, count por si hubo seleccion anterior
88 87
         let count = 0;
@@ -317,6 +316,9 @@ const Questions: React.FC = () => {
317 316
     const [quizInfo, setQuiz] = useState<QuizInfo>();
318 317
     const params = useParams<{ id: string }>();
319 318
 
319
+    // Foto a ser desplegada en el tope del quiz
320
+    const photo = getBioInfoPhoto(parseInt(params.id, 10));
321
+
320 322
     useIonViewWillEnter(() => {
321 323
         const quiz = getQuiz(parseInt(params.id, 10));
322 324
         setQuiz(quiz);
@@ -331,7 +333,7 @@ const Questions: React.FC = () => {
331 333
                             <IonCol></IonCol>
332 334
                             <IonCol>
333 335
                                 <IonImg style={{ height: 50, width: 100 }} src={EnciclopediaPR} alt='Logo'></IonImg>
334
-                                <IonTitle>Quiz</IonTitle>
336
+                                
335 337
                             </IonCol>
336 338
                             <IonCol></IonCol>
337 339
                         </IonRow>
@@ -340,7 +342,7 @@ const Questions: React.FC = () => {
340 342
             </IonHeader>
341 343
             
342 344
             <IonContent fullscreen className="ion-padding">
343
-                <IonImg style={{ height: 300, width: 600 }} src={RobertoClemente} alt='Logo'></IonImg>
345
+                <IonImg style={{ height: 300, width: 300 }} src={photo} alt='Foto de Personaje'></IonImg>
344 346
 
345 347
                 {
346 348
                     quizInfo ?