-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuestion.tsx
79 lines (66 loc) · 2.73 KB
/
Question.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import React, { useState } from 'react';
import { IonBackButton, IonButton, IonButtons, IonCard, IonCardContent, IonCardHeader, IonContent, IonHeader, IonItem, IonLabel, IonList, IonPage, IonRadio, IonRadioGroup, IonText, IonTitle, IonToolbar } from '@ionic/react';
import ExploreContainer from '../components/ExploreContainer';
import './Home.css';
import * as _ from 'lodash';
import data from './api.json';
import styles from "./Home.module.scss";
/* Theme variables */
import '../theme/variables.css';
import { airplaneSharp } from 'ionicons/icons';
const Question: React.FC = () => {
const [selected, setSelected] = useState<string>('biff');
const [items, setItems] = useState([{ id: 0, value: 'Question 1' }, { id: 1, value: 'Question 2' }]);
return (
<IonPage>
<IonHeader>
<IonToolbar>
<IonButtons slot="start">
<IonBackButton />
</IonButtons>
<IonTitle>PSL</IonTitle>
</IonToolbar>
</IonHeader>
<IonContent fullscreen>
<IonHeader collapse="condense">
<IonToolbar>
<IonTitle size="large">PSL</IonTitle>
</IonToolbar>
</IonHeader>
<IonCard>
<IonCardContent>
<IonCardHeader >
{items.map(item => {
return (
<IonCardHeader key={item.id}>
<IonLabel>{item.value}</IonLabel>
</IonCardHeader>
)
})}
</IonCardHeader>
<IonList>
<IonItem> {_.get(data, 'data.getAllCategories[0].questionslist[2].questionName')}</IonItem>
<IonRadioGroup value={selected} onIonChange={e => setSelected(e.detail.value)}>
<br></br>
<IonItem>
<IonLabel> {_.get(data,'data.getAllCategories[0].questionslist[2].option1')}</IonLabel>
<IonRadio value="Option A" slot="start"></IonRadio>
</IonItem>
<IonItem>
<IonLabel>{_.get(data,'data.getAllCategories[0].questionslist[2].option2')}</IonLabel>
<IonRadio value="Option B" slot="start"></IonRadio>
</IonItem>
<IonItem>
<IonLabel>{_.get(data,'data.getAllCategories[0].questionslist[2].option3')}</IonLabel>
<IonRadio value="Option C" slot="start"></IonRadio>
</IonItem>
</IonRadioGroup>
</IonList>
</IonCardContent>
</IonCard>
<IonButton href='/Question' className={styles.basicbutton}>Next</IonButton>
</IonContent>
</IonPage>
);
};
export default Question;