Skip to content

Commit

Permalink
Merge pull request #15 from emmanueposu/jbranch3
Browse files Browse the repository at this point in the history
Jbranch3
  • Loading branch information
demuthsa authored Apr 28, 2024
2 parents 84d4876 + 8134eea commit f0317b8
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 5 deletions.
Binary file modified trivia-forge/backend/__pycache__/config.cpython-310.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion trivia-forge/backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def serialize_user(user):
"email": user.get("email")
# Add more fields as needed based on your database structure
}

#random comment
@app.route("/users", methods=['GET','POST'])
def get_users():
supabase = app.config['Client']
Expand Down
6 changes: 5 additions & 1 deletion trivia-forge/frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
pointer-events: none;
}

.form-group {
margin: 20px;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
Expand Down Expand Up @@ -45,7 +49,7 @@
background-color: white;
}

footer{
footer {
position: absolute;
bottom: 0;
text-align: center;
Expand Down
4 changes: 3 additions & 1 deletion trivia-forge/frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import Navigation from "./Components/Nav";
import TriviaGenPage from './Pages/TriviaGenPage';
import TriviaReviewPage from './Pages/TriviaReviewPage';
import MyTrivia from './Pages/MyTrivia';
import SignUpPage from './Pages/SignUpPage';
import React from 'react';
import 'bootstrap/dist/css/bootstrap.min.css';

let signedIn = false;

function App() {
const [count, setCount] = useState(0)

return (

<div className="App">
Expand All @@ -29,6 +30,7 @@ function App() {
<Route path="/triviaGen" element={<TriviaGenPage />} />
<Route path="/review" element={<TriviaReviewPage />} />
<Route path="/myTrivia" element={<MyTrivia />} />
<Route path="/SignUpPage" element={<SignUpPage />} />
</Routes>

</main>
Expand Down
37 changes: 35 additions & 2 deletions trivia-forge/frontend/src/Components/Nav.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from "react";
import { Navbar } from "react-bootstrap";
import { Nav } from "react-bootstrap";
import { Nav, Button, Modal, Form } from "react-bootstrap";
import { useState } from 'react';
import { Link } from "react-router-dom"
const loginIcon = "https://yxdrsdfocuonvorowgaa.supabase.co/storage/v1/object/sign/UI%20Assets/Login%20Icon.svg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJVSSBBc3NldHMvTG9naW4gSWNvbi5zdmciLCJpYXQiOjE3MTQwNDQ1NjQsImV4cCI6NDg2NzY0NDU2NH0.-IE25tSqh2pH4EwagAEHzml4lv0mJwZgptA73XO2zpY&t=2024-04-25T11%3A29%3A24.290Z"

function Navigation() {
const [show, setShow] = useState(false);

const handleClose = () => setShow(false);
const handleShow = () => setShow(true);
return (
<>
<Navbar bg="dark" data-bs-theme="dark">
Expand All @@ -16,10 +21,38 @@ function Navigation() {
</Nav>
<Nav>
<img src={loginIcon} id="test"></img>
<Nav.Link href="#">Log In</Nav.Link>
<Button onClick={handleShow}>Log In</Button>
</Nav>

</Navbar>
<Modal show={show} onHide={handleClose}>

<Modal.Header closeButton>
<Modal.Title>Sign In</Modal.Title>
</Modal.Header>

<Modal.Body>
<Form>
<Form.Label htmlFor="inputEmail">Email</Form.Label>
<Form.Control
type="email"
id="inputEmail"
/>
<Form.Label htmlFor="inputPassword">Password</Form.Label>
<Form.Control
type="password"
id="inputPassword"
/>
</Form>
<p>Not a member? <Link onClick={handleClose} to="/SignUpPage">Sign Up</Link></p>
</Modal.Body>

<Modal.Footer>
<Button onClick={handleClose} variant="secondary">Close</Button>
<Button variant="primary">Sign In</Button>

</Modal.Footer>
</Modal>
</>
);
}
Expand Down
36 changes: 36 additions & 0 deletions trivia-forge/frontend/src/Pages/SignUpPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { useNavigate } from "react-router-dom";
import { Form, Button, Card } from "react-bootstrap";

function SignUpPage() {

return (
<>
<Card style={{ width: '35rem', margin: '0 auto', float: 'none' }}>
<Form className="form-group">
<Form.Group className="mb-3" controlId="formBasicEmail">
<Form.Label>Email address</Form.Label>
<Form.Control className="Form-Control" type="email" placeholder="Enter email" />
<Form.Text className="text-muted">
We'll never share your email with anyone else.
</Form.Text>
</Form.Group>

<Form.Group className="mb-3" controlId="formBasicPassword">
<Form.Label>Password</Form.Label>
<Form.Control type="password" placeholder="Password" />
</Form.Group>
<Form.Group className="mb-3" controlId="formBasicPassword">
<Form.Label>Confirm Password</Form.Label>
<Form.Control type="password" placeholder="Confirm Password" />
</Form.Group>
<Button variant="primary" type="submit">
Create Account
</Button>
</Form>
</Card>
</>

);

}
export default SignUpPage;

0 comments on commit f0317b8

Please sign in to comment.