|
1 |
| -import React, { useState, useEffect } from "react"; |
| 1 | +import React, { useState } from "react"; |
2 | 2 | import "./HomePage.css";
|
3 | 3 | import "bootstrap/dist/css/bootstrap.min.css";
|
4 |
| -import { Link, useNavigate } from "react-router-dom"; |
5 |
| -import { |
6 |
| - Question, |
7 |
| - initializeData, |
8 |
| - QuestionData, |
9 |
| -} from "../AddQuestionPage/QuestionData"; |
| 4 | +import { useNavigate } from "react-router-dom"; |
| 5 | +import { Question, initializeData } from "../AddQuestionPage/QuestionData"; |
10 | 6 |
|
11 | 7 | function HomePage() {
|
12 | 8 | let history = useNavigate();
|
@@ -79,89 +75,7 @@ function HomePage() {
|
79 | 75 | setFilteredData(filtered);
|
80 | 76 | };
|
81 | 77 |
|
82 |
| - return ( |
83 |
| - <div className="homepage"> |
84 |
| - <div className="background" /> |
85 |
| - |
86 |
| - <div className="navbar"> |
87 |
| - <div className="title">Peer Prep</div> |
88 |
| - </div> |
89 |
| - |
90 |
| - <div className="content-container"> |
91 |
| - <input |
92 |
| - type="text" |
93 |
| - className="search-bar" |
94 |
| - placeholder="Search questions" |
95 |
| - value={searchQuery} |
96 |
| - onChange={handleSearchInputChange} |
97 |
| - /> |
98 |
| - <div className="add-question-button"> |
99 |
| - <Link to="/create" className="add-question-text"> |
100 |
| - Add Question |
101 |
| - </Link> |
102 |
| - </div> |
103 |
| - </div> |
104 |
| - |
105 |
| - <table className="question-table"> |
106 |
| - <thead> |
107 |
| - <tr> |
108 |
| - <th>Question Id</th> |
109 |
| - <th>Question Title</th> |
110 |
| - <th>Question Description</th> |
111 |
| - <th>Question Category</th> |
112 |
| - <th>Question Complexity</th> |
113 |
| - <th>Delete</th> |
114 |
| - </tr> |
115 |
| - </thead> |
116 |
| - <tbody> |
117 |
| - {filteredData.map((item: Question) => ( |
118 |
| - <tr key={item.id}> |
119 |
| - <td>{item.id}</td> |
120 |
| - <td>{item.title}</td> |
121 |
| - <td>{item.description}</td> |
122 |
| - <td>{item.category}</td> |
123 |
| - <td> |
124 |
| - <div |
125 |
| - style={{ |
126 |
| - display: "flex", |
127 |
| - justifyContent: "center", // Horizontally center the box |
128 |
| - alignItems: "center", // Vertically center the box |
129 |
| - }} |
130 |
| - > |
131 |
| - <div |
132 |
| - style={{ |
133 |
| - backgroundColor: |
134 |
| - item.complexity === "1" |
135 |
| - ? "rgba(0, 255, 0, 0.3)" |
136 |
| - : item.complexity === "2" |
137 |
| - ? "rgba(255, 255, 0, 0.3)" |
138 |
| - : "rgba(255, 0, 0, 0.3)", |
139 |
| - padding: "4px", |
140 |
| - borderRadius: "5px", |
141 |
| - width: "30px", // Set the width here |
142 |
| - textAlign: "center", |
143 |
| - fontWeight: "bold", |
144 |
| - color: "white", |
145 |
| - }} |
146 |
| - > |
147 |
| - {item.complexity} |
148 |
| - </div> |
149 |
| - </div> |
150 |
| - </td> |
151 |
| - <td> |
152 |
| - <button |
153 |
| - className="delete-button" |
154 |
| - onClick={() => handleDelete(item.id)} |
155 |
| - > |
156 |
| - <i className="trash-icon"></i> |
157 |
| - </button> |
158 |
| - </td> |
159 |
| - </tr> |
160 |
| - ))} |
161 |
| - </tbody> |
162 |
| - </table> |
163 |
| - </div> |
164 |
| - ); |
| 78 | + return <></>; |
165 | 79 | }
|
166 | 80 |
|
167 | 81 | export default HomePage;
|
0 commit comments