Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created pages for home, about, scan and customsheet #130

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
44 changes: 43 additions & 1 deletion bubblescan-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion bubblescan-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"bootstrap": "^5.3.2",
"cors": "^2.8.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"react-router-dom": "^6.28.0"
},
"devDependencies": {
"@types/node": "^22.7.5",
Expand Down
96 changes: 0 additions & 96 deletions bubblescan-client/src/App.css

This file was deleted.

48 changes: 32 additions & 16 deletions bubblescan-client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import React, { useEffect, useState, useRef } from "react";
import FileUploadComponent from "./components/FileUploadComponent";
import CustomExamSheetComponent from "./components/CustomExamSheetComponent";
import config from "./utils/config";

import "./App.css";
import "./styles/App.css";

import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import Header from "./components/Header";
import Footer from "./components/Footer";
import Home from "./pages/Home";
import Customsheets from "./pages/Customsheets";
import Scan from "./pages/Scan";
import Aboutus from "./pages/AboutUs";


function App() {
const [data, setData] = useState<string>("");
const [message, setMessage] = useState<string>("");
const [response, setResponse] = useState<string>("");
const [isFormVisible, setFormVisible] = useState(false);
const [numQuestions, setNumQuestions] = useState<number>(5);
const [numOptions, setNumOptions] = useState<number>(4);
const [numQuestions, setNumQuestions] = useState<number>(5);
const [numOptions, setNumOptions] = useState<number>(4);
const [examTitle, setExamTitle] = useState('');


// Fetch initial data from Flask
useEffect(() => {
Expand All @@ -24,7 +30,7 @@ function App() {
.catch((error) => console.error("Error fetching data:", error));
}, []);


// Function to send message to Flask
const sendMessage = async () => {
console.log("Sending message to Flask...");
Expand All @@ -45,17 +51,27 @@ function App() {
}
};


return (
<div className="welcome">
<h1>Welcome to Bubble Scan</h1>
<h4>You can upload your files below</h4>
<FileUploadComponent />


<CustomExamSheetComponent />
</div>
<Router>
<div className="main-container">
<Header />
<div className="main-content">
<div className="appContent">
<div>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/Scan" element={<Scan />} />
<Route path="/customsheets" element={<Customsheets />} />
<Route path="/AboutUs" element={<Aboutus />} />
</Routes>
</div>
</div>
</div>
<Footer />
</div>
</Router>
);

};

export default App;
30 changes: 30 additions & 0 deletions bubblescan-client/src/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react';
import '../styles/Button.css';
import { useNavigate } from 'react-router-dom';

interface ButtonProps {
text: string;
dark?: boolean;
to?: string;
}

const Button: React.FC<ButtonProps> = ({ text, dark = false, to }) => {

const navigate = useNavigate();

const handleClick = () => {
if (to) {
navigate(to);
}
};

return (
<button className={`button ${dark ? 'button-dark' : 'button-light'}`}
onClick={handleClick}
>
{text}
</button>
);
};

export default Button;
Loading