Skip to content

Commit 7e4d538

Browse files
authored
Merge pull request #13 from CS3219-AY2324S1/homepage
Homepage
2 parents 613615e + b18878e commit 7e4d538

File tree

5 files changed

+56
-3
lines changed

5 files changed

+56
-3
lines changed

public/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<head>
44
<meta charset="utf-8" />
55
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<link rel="preconnect" href="https://fonts.googleapis.com">
7+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
8+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400&display=swap" rel="stylesheet">
69
<meta name="viewport" content="width=device-width, initial-scale=1" />
710
<meta name="theme-color" content="#000000" />
811
<meta

src/App.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
body {
2+
font-family: 'Roboto', sans-serif;
3+
font-weight: 400
4+
}

src/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from "react";
22
import { Container, Stack } from "@mui/material";
33
import Navbar from "./components/Navbar";
4+
import Home from "./components/Home";
5+
import './App.css';
46
import Titlebar from "./components/Questions/Titlebar";
57

68
export default function App() {
@@ -9,6 +11,7 @@ export default function App() {
911
<Stack gap={5}>
1012
<Navbar />
1113
<Titlebar />
14+
<Home/>
1215
<Container>hello world!</Container>
1316
</Stack>
1417
</>

src/components/Home.tsx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import React, { useState, useEffect } from 'react';
2+
3+
function Home() {
4+
// Sample data for practice questions (you can replace this with actual data)
5+
const practiceQuestions = [
6+
{ difficulty: 'Easy', count: 10 },
7+
{ difficulty: 'Medium', count: 20 },
8+
{ difficulty: 'Hard', count: 15 },
9+
];
10+
11+
// State to hold the practice questions data
12+
const [questionsData, setQuestionsData] = useState(practiceQuestions);
13+
14+
// You can fetch the actual data from your API using useEffect
15+
16+
useEffect(() => {
17+
// Fetch practice questions data from your API here and update the state
18+
// Example API call:
19+
// fetch('/api/practice-questions')
20+
// .then((response) => response.json())
21+
// .then((data) => setQuestionsData(data));
22+
}, []);
23+
24+
return (
25+
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'center' }}>
26+
<div>
27+
<h1>Welcome to the Technical Interview Preparation Portal</h1>
28+
<div>
29+
<h2>Practice Questions</h2>
30+
<ul>
31+
{questionsData.map((question, index) => (
32+
<li key={index}>
33+
{question.difficulty}: {question.count} questions
34+
</li>
35+
))}
36+
</ul>
37+
</div>
38+
</div>
39+
</div>
40+
);
41+
}
42+
43+
export default Home;

src/components/Navbar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function Navbar() {
4242
<AppBar position="static">
4343
<Container maxWidth="xl">
4444
<Toolbar disableGutters>
45-
<AdbIcon sx={{ display: { xs: "none", md: "flex" }, mr: 1 }} />
45+
<AdbIcon sx={{ display: { xs: "none", md: "flex" }, mr: 1}} />
4646
<Typography
4747
variant="h6"
4848
noWrap
@@ -51,7 +51,7 @@ function Navbar() {
5151
sx={{
5252
mr: 2,
5353
display: { xs: "none", md: "flex" },
54-
fontFamily: "monospace",
54+
fontFamily: "Roboto",
5555
fontWeight: 700,
5656
letterSpacing: ".3rem",
5757
color: "inherit",
@@ -61,7 +61,7 @@ function Navbar() {
6161
LOGO
6262
</Typography>
6363

64-
<Box sx={{ flexGrow: 1, display: { xs: "flex", md: "none" } }}>
64+
<Box sx={{ flexGrow: 1, display: { xs: "flex", md: "none" }, }}>
6565
<IconButton
6666
size="large"
6767
aria-label="account of current user"

0 commit comments

Comments
 (0)