Skip to content

Commit 7004683

Browse files
committed
modify navbar,footer, back for button
1 parent c104976 commit 7004683

File tree

3 files changed

+30
-47
lines changed

3 files changed

+30
-47
lines changed

src/App.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import Navbar from './components/Navbar';
2121
import CourseDetail from './components/CourseDetail';
2222
import Dashboard from './components/dashboard';
2323
import courses from './components/courseData';
24+
import Footer from './components/Footer';
2425

2526
function App() {
2627
const [user, setUser] = useState(null);
@@ -52,6 +53,7 @@ function App() {
5253
<Navbar loggedin={user ? 'true' : 'false'} />
5354
<div className="auth-wrapper">
5455
<div className="auth-inner">
56+
5557
<Routes>
5658
{/* Redirect to profile if the user is logged in */}
5759
<Route path="/" element={user ? <Navigate to="/profile" /> : <Login />} />
@@ -74,6 +76,7 @@ function App() {
7476
</div>
7577
</div>
7678
</div>
79+
<Footer />
7780
</Router>
7881
);
7982
}

src/components/Footer.jsx

Lines changed: 26 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,29 @@
1+
import React from 'react';
2+
import { useNavigate } from 'react-router-dom';
3+
14
export default function Footer() {
2-
return (
3-
<footer className="bg-body-tertiary text-center text-lg-start align-items-center">
4-
{/* Grid container */}
5-
<div className="container p-4 pb-0">
6-
<form action="">
7-
{/* Grid row */}
8-
<div className="row">
9-
{/* Grid column */}
10-
<div className="col-auto mb-4 mb-md-0">
11-
<p className="pt-2">
12-
<strong>Sign up for our newsletter</strong>
13-
</p>
14-
</div>
15-
{/* Grid column */}
16-
17-
{/* Grid column */}
18-
<div className="col-md-5 col-12 mb-4 mb-md-0">
19-
{/* Email input */}
20-
<div data-mdb-input-init className="form-outline mb-4">
21-
<input type="email" id="form5Example22" className="form-control" placeholder="Email Address"/>
22-
</div>
23-
</div>
24-
{/* Grid column */}
25-
26-
{/* Grid column */}
27-
<div className="col-auto mb-4 mb-md-0">
28-
{/* Submit button */}
29-
<button data-mdb-ripple-init type="button" className="btn btn-primary mb-4">
30-
Subscribe
31-
</button>
32-
</div>
33-
{/* Grid column */}
34-
</div>
35-
{/* Grid row */}
36-
</form>
37-
</div>
38-
{/* Grid container */}
39-
40-
{/* Copyright */}
5+
const navigate = useNavigate();
6+
7+
return (
8+
<footer className="bg-body-tertiary text-center text-lg-start align-items-center fixed-bottom">
9+
{/* Back and Forward Buttons */}
10+
<div className="d-flex justify-content-between p-3">
11+
{/* Back Button - Left Side */}
12+
<button className="btn btn-secondary" onClick={() => navigate(-1)}>
13+
<i className="fa-solid fa-circle-left"></i> back
14+
</button>
4115
<div className="text-center p-3" style={{ backgroundColor: 'rgba(0, 0, 0, 0.05)' }}>
42-
©
43-
<a className="text-body" href="https://krimsonsquad.tech/">Krimsonsquad.tech</a> 2024
16+
© <a className="text-body" href="https://krimsonsquad.tech/">Krimsonsquad.tech</a> 2024
4417
</div>
45-
{/* Copyright */}
46-
</footer>
47-
);
48-
}
49-
18+
{/* Forward Button - Right Side */}
19+
<button className="btn btn-secondary" onClick={() => navigate(1)}>
20+
<i className="fa-solid fa-circle-right"></i> forward
21+
</button>
22+
</div>
23+
24+
{/* Copyright */}
25+
26+
{/* Copyright */}
27+
</footer>
28+
);
29+
}

src/components/Navbar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function Navbar({ loggedin }) {
4343
};
4444

4545
return (
46-
<nav className="navbar navbar-expand-lg">
46+
<nav className="navbar navbar-expand-lg sticky-top">
4747
<div className="container-fluid">
4848
<button className="navbar-toggler" type="button" data-bs-toggle="collapse"
4949
data-bs-target="#navbarExample" aria-controls="navbarExample" aria-expanded="false" aria-label="Toggle navigation">

0 commit comments

Comments
 (0)