Skip to content

Commit ed657fc

Browse files
Merge pull request #11 from 4GeeksAcademy/register
Register
2 parents 47b9e22 + 32cd90b commit ed657fc

File tree

5 files changed

+174
-28
lines changed

5 files changed

+174
-28
lines changed

migrations/versions/6efe7eff7787_.py

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""empty message
2+
3+
Revision ID: 6efe7eff7787
4+
Revises:
5+
Create Date: 2025-02-28 10:59:53.645004
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
11+
12+
# revision identifiers, used by Alembic.
13+
revision = '6efe7eff7787'
14+
down_revision = None
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.create_table('user',
22+
sa.Column('id', sa.Integer(), nullable=False),
23+
sa.Column('email', sa.String(length=120), nullable=False),
24+
sa.Column('password', sa.String(length=80), nullable=False),
25+
sa.Column('is_active', sa.Boolean(), nullable=False),
26+
sa.PrimaryKeyConstraint('id'),
27+
sa.UniqueConstraint('email')
28+
)
29+
# ### end Alembic commands ###
30+
31+
32+
def downgrade():
33+
# ### commands auto generated by Alembic - please adjust! ###
34+
op.drop_table('user')
35+
# ### end Alembic commands ###

package-lock.json

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

package.json

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

src/front/js/component/footer.js

+28-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
import React, { Component } from "react";
22

3-
export const Footer = () => (
4-
<footer className="footer mt-auto py-3 text-center">
5-
<p>
6-
Made with <i className="fa fa-heart text-danger" /> by{" "}
7-
<a href="http://www.4geeksacademy.com">Onmine Team</a>
8-
</p>
9-
</footer>
10-
);
3+
export const Footer = () => {
4+
return (
5+
<footer className="bg-[#5B7185] text-white py-4 px-6 flex items-center">
6+
<div className="flex items-center space-x-4 ml-4">
7+
{/* Social Icons */}
8+
<div className="flex items-center space-x-3">
9+
<a href="#" className="opacity-75 hover:opacity-100">
10+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-instagram" viewBox="0 0 16 16">
11+
<path d="M8 0C5.829 0 5.556.01 4.703.048 3.85.088 3.269.222 2.76.42a3.9 3.9 0 0 0-1.417.923A3.9 3.9 0 0 0 .42 2.76C.222 3.268.087 3.85.048 4.7.01 5.555 0 5.827 0 8.001c0 2.172.01 2.444.048 3.297.04.852.174 1.433.372 1.942.205.526.478.972.923 1.417.444.445.89.719 1.416.923.51.198 1.09.333 1.942.372C5.555 15.99 5.827 16 8 16s2.444-.01 3.298-.048c.851-.04 1.434-.174 1.943-.372a3.9 3.9 0 0 0 1.416-.923c.445-.445.718-.891.923-1.417.197-.509.332-1.09.372-1.942C15.99 10.445 16 10.173 16 8s-.01-2.445-.048-3.299c-.04-.851-.175-1.433-.372-1.941a3.9 3.9 0 0 0-.923-1.417A3.9 3.9 0 0 0 13.24.42c-.51-.198-1.092-.333-1.943-.372C10.443.01 10.172 0 7.998 0zm-.717 1.442h.718c2.136 0 2.389.007 3.232.046.78.035 1.204.166 1.486.275.373.145.64.319.92.599s.453.546.598.92c.11.281.24.705.275 1.485.039.843.047 1.096.047 3.231s-.008 2.389-.047 3.232c-.035.78-.166 1.203-.275 1.485a2.5 2.5 0 0 1-.599.919c-.28.28-.546.453-.92.598-.28.11-.704.24-1.485.276-.843.038-1.096.047-3.232.047s-2.39-.009-3.233-.047c-.78-.036-1.203-.166-1.485-.276a2.5 2.5 0 0 1-.92-.598 2.5 2.5 0 0 1-.6-.92c-.109-.281-.24-.705-.275-1.485-.038-.843-.046-1.096-.046-3.233s.008-2.388.046-3.231c.036-.78.166-1.204.276-1.486.145-.373.319-.64.599-.92s.546-.453.92-.598c.282-.11.705-.24 1.485-.276.738-.034 1.024-.044 2.515-.045zm4.988 1.328a.96.96 0 1 0 0 1.92.96.96 0 0 0 0-1.92m-4.27 1.122a4.109 4.109 0 1 0 0 8.217 4.109 4.109 0 0 0 0-8.217m0 1.441a2.667 2.667 0 1 1 0 5.334 2.667 2.667 0 0 1 0-5.334"/>
12+
</svg>
13+
</a>
14+
<a href="#" className="opacity-75 hover:opacity-100">
15+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-facebook" viewBox="0 0 16 16">
16+
<path d="M16 8.049c0-4.446-3.582-8.05-8-8.05C3.58 0-.002 3.603-.002 8.05c0 4.017 2.926 7.347 6.75 7.951v-5.625h-2.03V8.05H6.75V6.275c0-2.017 1.195-3.131 3.022-3.131.876 0 1.791.157 1.791.157v1.98h-1.009c-.993 0-1.303.621-1.303 1.258v1.51h2.218l-.354 2.326H9.25V16c3.824-.604 6.75-3.934 6.75-7.951"/>
17+
</svg>
18+
</a>
19+
</div>
20+
21+
{/* Navigation Links */}
22+
<nav className="flex space-x-4 ml-6">
23+
<a href="#" className="text-white text-sm opacity-75 hover:opacity-100">Navigate</a>
24+
<a href="#" className="text-white text-sm opacity-75 hover:opacity-100">Contact us</a>
25+
<a href="#" className="text-white text-sm opacity-75 hover:opacity-100">Log in</a>
26+
</nav>
27+
</div>
28+
</footer>
29+
);
30+
};

src/front/js/pages/home.js

+94-20
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,104 @@
1-
import React, { useContext } from "react";
1+
import React, { useContext, useState } from 'react';
22
import { Context } from "../store/appContext";
3-
import rigoImageUrl from "../../img/rigo-baby.jpg";
4-
import "../../styles/home.css";
53
import { Link } from "react-router-dom";
6-
4+
import { Eye, EyeOff } from 'lucide-react';
75

86

97
export const Home = () => {
108
const { store, actions } = useContext(Context);
11-
9+
const [showPassword, setShowPassword] = useState(false);
10+
const [formData, setFormData] = useState({
11+
name: '',
12+
email: '',
13+
password: '',
14+
confirmPassword: ''
15+
});
16+
const handleInputChange = (e) => {
17+
const { name, value } = e.target;
18+
setFormData(prevState => ({
19+
...prevState,
20+
[name]: value
21+
}));
22+
};
23+
const handleSubmit = (e) => {
24+
e.preventDefault();
25+
// Add signup logic here
26+
console.log('Signup data:', formData);
27+
};
1228
return (
13-
<div className="text-center mt-5">
14-
<h1>Hello Rigo!!</h1>
15-
<p>
16-
<img src={rigoImageUrl} />
17-
</p>
18-
<div className="alert alert-info">
19-
{store.message || "Loading message from the backend (make sure your python backend is running)..."}
20-
</div>
21-
<p>
22-
This boilerplate comes with lots of documentation:{" "}
23-
<a href="https://start.4geeksacademy.com/starters/react-flask">
24-
Read documentation
25-
</a>
26-
<Link to= "/profile"> <span> PROFILE-VIEW </span></Link>
29+
<div className="min-h-screen flex items-center justify-center bg-white p-4">
30+
<div className="w-full max-w-4xl bg-white shadow-md rounded-lg overflow-hidden flex">
31+
{/* Left Side - Description */}
32+
<div className="w-1/2 bg-[#E6EDF3] p-8 flex flex-col justify-center">
33+
<h2 className="text-2xl font-bold text-[#24292F] mb-4">Become a member</h2>
34+
<p className="text-[#57606A]">
35+
Onmino helps you organize your ideas, tasks, and projects simply and efficiently. Start today!
2736
</p>
37+
</div>
38+
39+
{/* Right Side - Signup Form */}
40+
<div className="w-1/2 p-8 bg-white">
41+
<form onSubmit={handleSubmit}>
42+
<div className="mb-4">
43+
<input
44+
type="text"
45+
name="name"
46+
placeholder="Name"
47+
value={formData.name}
48+
onChange={handleInputChange}
49+
className="w-full px-3 py-2 border border-[#D0D7DE] rounded-md focus:outline-none focus:ring-2 focus:ring-[#1F6FEB]"
50+
required
51+
/>
52+
</div>
53+
<div className="mb-4">
54+
<input
55+
type="email"
56+
name="email"
57+
placeholder="Email"
58+
value={formData.email}
59+
onChange={handleInputChange}
60+
className="w-full px-3 py-2 border border-[#D0D7DE] rounded-md focus:outline-none focus:ring-2 focus:ring-[#1F6FEB]"
61+
required
62+
/>
63+
</div>
64+
<div className="mb-4 relative">
65+
<input
66+
type={showPassword ? "text" : "password"}
67+
name="password"
68+
placeholder="Password"
69+
value={formData.password}
70+
onChange={handleInputChange}
71+
className="w-full px-3 py-2 border border-[#D0D7DE] rounded-md focus:outline-none focus:ring-2 focus:ring-[#1F6FEB]"
72+
required
73+
/>
74+
<button
75+
type="button"
76+
onClick={() => setShowPassword(!showPassword)}
77+
className="absolute right-3 top-1/2 transform -translate-y-1/2 text-[#57606A]"
78+
>
79+
{showPassword ? <EyeOff size={20} /> : <Eye size={20} />}
80+
</button>
81+
</div>
82+
<div className="mb-4 relative">
83+
<input
84+
type={showPassword ? "text" : "password"}
85+
name="confirmPassword"
86+
placeholder="Confirm Password"
87+
value={formData.confirmPassword}
88+
onChange={handleInputChange}
89+
className="w-full px-3 py-2 border border-[#D0D7DE] rounded-md focus:outline-none focus:ring-2 focus:ring-[#1F6FEB]"
90+
required
91+
/>
92+
</div>
93+
<button
94+
type="submit"
95+
className="w-full bg-[#1F6FEB] text-white py-2 rounded-md hover:bg-[#1160D3] transition duration-300"
96+
>
97+
Register
98+
</button>
99+
</form>
100+
</div>
28101
</div>
102+
</div>
29103
);
30-
};
104+
};

0 commit comments

Comments
 (0)