|
@@ -12,28 +12,18 @@ import {
|
12
|
12
|
IonImg,
|
13
|
13
|
IonGrid,
|
14
|
14
|
IonRow,
|
15
|
|
- IonCol,
|
16
|
|
- useIonViewWillEnter
|
|
15
|
+ IonCol
|
17
|
16
|
} from '@ionic/react';
|
18
|
17
|
import { arrowBack } from 'ionicons/icons';
|
19
|
|
-import React, { useState } from 'react';
|
|
18
|
+import React from 'react';
|
20
|
19
|
import './Biography.css';
|
21
|
20
|
import ListBiographies from './ListBiographies';
|
22
|
21
|
import Questions from './Questions';
|
23
|
22
|
import EnciclopediaPR from '../assets/EnciclopediaPR.png';
|
24
|
23
|
import RobertoClemente from '../assets/RobertoClemente.jpg';
|
25
|
|
-import { useParams } from 'react-router';
|
26
|
|
-import { BioInfo, getMessage } from '../data/BioInfo';
|
|
24
|
+import ListBio from '../data/Biograph.json';
|
27
|
25
|
|
28
|
26
|
const Biography: React.FC = () => {
|
29
|
|
- const [BioItem, setMessage] = useState<BioInfo>();
|
30
|
|
- const params = useParams<{ id: string }>();
|
31
|
|
-
|
32
|
|
- useIonViewWillEnter(() => {
|
33
|
|
- const msg = getMessage(parseInt(params.id, 10));
|
34
|
|
- setMessage(msg);
|
35
|
|
- });
|
36
|
|
-
|
37
|
27
|
return (
|
38
|
28
|
<IonPage>
|
39
|
29
|
<IonHeader>
|
|
@@ -51,20 +41,22 @@ const Biography: React.FC = () => {
|
51
|
41
|
</IonToolbar>
|
52
|
42
|
</IonHeader>
|
53
|
43
|
<IonContent fullscreen className="ion-padding">
|
54
|
|
- {BioItem ? (
|
55
|
|
- <>
|
56
|
|
- <IonImg style={{ height: 300, width: 600 }} src={RobertoClemente} alt='Logo'></IonImg>
|
57
|
|
- <h1>{BioItem.title}</h1>
|
|
44
|
+ {
|
|
45
|
+ ListBio && ListBio.map(listbio => {
|
|
46
|
+ return (
|
|
47
|
+ <>
|
|
48
|
+ <IonImg style={{ height: 300, width: 600 }} src={RobertoClemente} alt='Logo'></IonImg>
|
|
49
|
+ <h1>{listbio.title}</h1>
|
58
|
50
|
|
59
|
|
- <p>{BioItem.tags}</p>
|
60
|
|
- <p>{BioItem.content}</p>
|
61
|
|
- <IonNavLink routerDirection="forward" component={() => <Questions />}>
|
62
|
|
- <IonButton>Tomar quiz</IonButton>
|
63
|
|
- </IonNavLink>
|
64
|
|
- </>
|
65
|
|
- ) : (
|
66
|
|
- <div>Message not found</div>
|
67
|
|
- )}
|
|
51
|
+ <p>{listbio.tags}</p>
|
|
52
|
+ <p>{listbio.content}</p>
|
|
53
|
+ <IonNavLink routerDirection="forward" component={() => <Questions />}>
|
|
54
|
+ <IonButton>Tomar quiz</IonButton>
|
|
55
|
+ </IonNavLink>
|
|
56
|
+ </>
|
|
57
|
+ )
|
|
58
|
+ })
|
|
59
|
+ }
|
68
|
60
|
</IonContent>
|
69
|
61
|
|
70
|
62
|
<IonFooter>
|