forked from luyuyang6636/principleai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.jsx
95 lines (91 loc) · 2.45 KB
/
App.jsx
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import Header from "./Header";
import Desc from "./Desc";
import Button from "./Button";
import Form from "./Form";
import Testname from "./SectionName";
import { useState } from "react";
import "./App.css";
function App() {
const [pageIndex, setPageIndex] = useState(0);
const changePageIndex = (n) => {
if (n !== 0) {
setPageIndex((prevPageIndex) => prevPageIndex + n);
} else {
setPageIndex(0);
}
};
if (pageIndex === 0) {
return (
<>
<div className="header-container">
<Header />
<Desc write={"Comprehension Test"}/>
</div>
<div className="form-container">
<Form mode="transcript">
<Button name="create" onClick={() => changePageIndex(1)} />
</Form>
</div>
</>
);
} else if (pageIndex === 1) {
return (
<>
<div className="header-container">
<Header />
<Testname subjectName={"Test for History"} />
</div>
<div className="form-container">
<Form mode={"edit"}>
<div className="button-section">
<Button name="back" onClick={(e) => changePageIndex(0, e)} />
<Button
name="regenerate"
onClick={(e) => changePageIndex(1, e)}
/>
<Button name="run test" onClick={(e) => changePageIndex(1, e)} />
</div>
</Form>
</div>
</>
);
} else if (pageIndex === 2) {
return (
<>
<div className="header-container">
<Header />
<Testname text={"Test for History"} />
</div>
<div className="form-container">
<Form mode={"test"}>
<Button name="submit test" onClick={(e) => changePageIndex(1, e)} />
</Form>
</div>
</>
);
} else if (pageIndex === 3) {
return (
<>
<div className="header-container">
<Header />
<Testname text={"Analysis"} />
</div>
<div className="form-container">
<Form mode={"test"}>
<div className="button-section">
<Button
name="back to main page"
onClick={(e) => changePageIndex(0, e)}
/>
<Button
name="save to Notes"
onClick={() => console.log("Saved to notes")}
/>
</div>
</Form>
</div>
</>
);
}
}
export default App;