Skip to content

Commit 94fceb0

Browse files
authored
Merge pull request #31 from 4GeeksAcademy/navbar
Navbar
2 parents ed23442 + 1c318a9 commit 94fceb0

File tree

9 files changed

+120
-23
lines changed

9 files changed

+120
-23
lines changed

Diff for: migrations/versions/19d0bae16ce8_.py renamed to migrations/versions/ec9225e89728_.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
"""empty message
22
3-
Revision ID: 19d0bae16ce8
3+
Revision ID: ec9225e89728
44
Revises:
5-
Create Date: 2025-03-14 09:27:19.200938
5+
Create Date: 2025-03-15 12:37:58.090944
66
77
"""
88
from alembic import op
99
import sqlalchemy as sa
1010

1111

1212
# revision identifiers, used by Alembic.
13-
revision = '19d0bae16ce8'
13+
revision = 'ec9225e89728'
1414
down_revision = None
1515
branch_labels = None
1616
depends_on = None
@@ -24,7 +24,6 @@ def upgrade():
2424
sa.Column('email', sa.String(length=120), nullable=False),
2525
sa.Column('password', sa.String(length=500), nullable=False),
2626
sa.Column('is_active', sa.Boolean(), nullable=False),
27-
sa.Column('role', sa.Integer(), nullable=False),
2827
sa.PrimaryKeyConstraint('id'),
2928
sa.UniqueConstraint('email')
3029
)

Diff for: package-lock.json

+43
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
]
7474
},
7575
"dependencies": {
76+
"bootstrap": "^5.3.3",
7677
"lucide-react": "^0.477.0",
7778
"prop-types": "^15.6.1",
7879
"react": "^19.0.0",

Diff for: src/api/models.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class User(db.Model):
1212
email: Mapped[str] = mapped_column(String(120), unique=True, nullable=False)
1313
password: Mapped[str] = mapped_column(String(500))
1414
is_active: Mapped[bool]
15-
role: Mapped[int] = mapped_column(Integer, nullable=False)
15+
# role: Mapped[int] = mapped_column(Integer, nullable=False)
1616
notes: Mapped["Notes"] = relationship(back_populates="user")
1717
habits: Mapped["Habits"] = relationship(back_populates="user")
1818
goals: Mapped["Goals"] = relationship(back_populates="user")
@@ -25,7 +25,7 @@ def serialize(self):
2525
"name": self.name,
2626
"email": self.email,
2727
"is_active": self.is_active,
28-
"role": self.role
28+
# "role": self.role
2929
}
3030

3131
class Notes(db.Model):

Diff for: src/api/routes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def create_user():
7878
email=request_body["email"],
7979
password=hashed_password,
8080
is_active=True,
81-
role=3
81+
# role=3
8282

8383
)
8484

Diff for: src/front/js/component/navbar.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Link, useNavigate } from "react-router-dom";
33
import { Thememode } from "./Thememode"
44
import logo from "../../img/logoFinal.jpg"
55
import { Context } from "../store/appContext";
6-
6+
import "../../styles/navbar.css";
77

88
export const Navbar = () => {
99
const { store, actions } = useContext(Context);
@@ -17,7 +17,7 @@ export const Navbar = () => {
1717

1818
return (
1919
<nav className="navbar navbar-light bg-light p-0">
20-
<div className="container-fluid margintop d-flex align-items-center">
20+
<div className="container-fluid background-color margintop d-flex align-items-center">
2121
<Link to="/">
2222
<img
2323
src={logo}
@@ -27,19 +27,19 @@ export const Navbar = () => {
2727
/>
2828
</Link>
2929

30-
<ul className="navbar-nav d-flex flex-row w-75 justify-content-center gap-5 fs-5 textcolors">
30+
<ul className="navbar-nav d-flex flex-row w-75 justify-content-center gap-5 fs-5 textcolors ">
3131
<li className="nav-item ms-5 me-5 textcolors">
32-
{store.auth ? <Link className="nav-link" to="/profile">
32+
{store.auth ? <Link className="nav-link " to="/profile">
3333
Profile
3434
</Link> : null}
3535
</li>
36-
<li className="nav-item ms-5 me-5 textcolors">
36+
<li className="nav-item ms-5 me-5 ">
3737
{store.auth ? <Link className="nav-link" to="/notes">
3838
Notes
3939
</Link> : null}
4040
</li>
41-
<li className="nav-item ms-5 me-5">
42-
{store.auth ? <Link className="nav-link" to="/habit-tracker">
41+
<li className="nav-item ms-5 me-5 ">
42+
{store.auth ? <Link className="nav-link" to="/habits">
4343
Habit-Tracker
4444
</Link> : null}
4545
</li>
@@ -50,28 +50,28 @@ export const Navbar = () => {
5050
</li>
5151
</ul>
5252

53-
<div className="ms-1">
53+
<div className="ms-2">
5454
{!store.auth && ( // 🔥 Aquí se oculta el botón si el usuario está autenticado
5555
<Link to="/login">
56-
<button className="me-5 backbutton border rounded text-black p-1 w-100">
56+
<button className="me-5 backbutton border rounded text-black p-2 w-100 fs-6">
5757
Login
5858
</button>
5959
</Link>
6060
)}
6161

6262
{store.auth && (<div className="dropdown ">
63-
<button className=" me-2 backbutton border rounded text-black p-1 w-100 dropdown-toggle" aria-expanded="false" type="button" data-bs-toggle="dropdown">
63+
<button className=" me-2 backbutton border rounded text-black p-2 w-100 dropdown-toggle" aria-expanded="false" type="button" data-bs-toggle="dropdown">
6464
<i className="fa-solid fa-gear"></i>
6565
</button>
66-
<ul class="dropdown-menu dropdown-menu-end">
66+
<ul className="dropdown-menu dropdown-menu-end">
6767

68-
<li><button className="btn btn-light w-100" type="button">Tema</button></li>
69-
<li><button className="btn btn-light w-100" type="button"><Link to="/editprofile">Edit Profile</Link></button></li>
68+
<li><button className="btn btn-light w-100 p-2 margintps marbotn" type="button">Theme</button></li>
69+
<li><Link to="/editprofile"><button className=" textdecoracion btn btn-light w-100 p-2 " type="button">Edit Profile</button></Link></li>
7070
<li><button onClick={() => {
7171
localStorage.removeItem("token");
7272
actions.verifyToken();
7373
navigate("/");
74-
}} className="btn btn-light w-100 " type="button">Logout</button></li>
74+
}} className="btn btn-light w-100 p-1 marbotn text-danger border-2 border-danger " type="button">Logout</button></li>
7575
</ul>
7676
</div>)}
7777
</div>

Diff for: src/front/js/layout.js

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import { Register } from "./pages/register";
1717
import { Navbar } from "./component/navbar";
1818
import { Footer } from "./component/footer";
1919
import { Pomodoro } from "./component/pomodoro";
20+
21+
2022
//create your first component
2123
const Layout = () => {
2224
//the basename is used when your project is published in a subdirectory and not in the root of the domain

Diff for: src/front/styles/index.css

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
*/
44

55

6-
.backnavbar{
7-
background-color: #EEEEEE;
6+
html, body {
7+
height: 100%;
8+
margin: 0px;
89
}
910

1011
.backbutton{

Diff for: src/front/styles/navbar.css

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
3+
.textcolors{
4+
color: #78A0AF;
5+
}
6+
7+
.bordernav{
8+
color: #78A0AF;
9+
opacity: 1;
10+
}
11+
12+
.margintop{
13+
margin-top: -4px;
14+
}
15+
16+
.marginloginright{
17+
margin-right: 255px;
18+
}
19+
20+
.marginlogintop{
21+
22+
margin-top: 115px;
23+
}
24+
25+
.bordercolor
26+
{
27+
border-color: #78A0AF;
28+
}
29+
30+
.marginresetleft{
31+
margin-left: 85px;
32+
}
33+
34+
.navbar a {
35+
font-size: large;
36+
}
37+
38+
.marbotn{
39+
margin-bottom: -8px;
40+
}
41+
42+
.margintps
43+
{
44+
margin-top: -10px;
45+
}
46+
47+
.dropdown-menu a {
48+
text-decoration: none !important;
49+
color: inherit;
50+
}
51+

0 commit comments

Comments
 (0)