Skip to content

Commit

Permalink
Merge pull request #11 from CMP26Projects/auth-forntend
Browse files Browse the repository at this point in the history
Auth forntend
  • Loading branch information
AhmedHamed3699 authored Dec 23, 2023
2 parents d77d9e3 + 79cd4ce commit 340141c
Show file tree
Hide file tree
Showing 12 changed files with 324 additions and 191 deletions.
12 changes: 12 additions & 0 deletions client/src/assets/styles/components/Button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
border: none;
padding: 12px 20px;
border-radius: 6px;
cursor: pointer;

a {
color: inherit;
Expand All @@ -20,5 +21,16 @@
color: var(--grey-50);
}

&--medium {
a {
font-size: 1rem;
}
}

&--success {
background-color: var(--green-400);
color: var(--grey-900);
}

// TODO: Add more button styles and maybe sizes
}
34 changes: 34 additions & 0 deletions client/src/assets/styles/components/Inputs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.input {
display: flex;
flex-direction: column;
gap: 0.5rem;
color: var(--grey-100);
font-size: 1rem;
direction: rtl;
width: 100%;

.radio-buttons {
display: flex;
flex-direction: row;
gap: 0.5rem;
width: 100%;
margin: 0.5rem 0;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="time"] {
width: 100%;
outline: none;
border-radius: 4px;
border: 1px solid var(--grey-600, #4b5563);
background: var(--grey-700, #374151);
padding: 0 4px;
line-height: 1rem;
color: var(--grey-100);
}
}
67 changes: 67 additions & 0 deletions client/src/components/common/Inputs.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import "./../../assets/styles/components/Inputs.scss";

import PropTypes from "prop-types";

function TextInput({
label,
type,
name,
value,
onChange,
placeholder,
required,
}) {
return (
<label className="input input--text">
{label}
<input
type={type}
name={name}
placeholder={placeholder}
value={value}
onChange={onChange}
required={required}
/>
</label>
);
}
TextInput.propTypes = {
label: PropTypes.string.isRequired,
type: PropTypes.string,
name: PropTypes.string,
value: PropTypes.string,
onChange: PropTypes.func,
placeholder: PropTypes.string,
required: PropTypes.bool,
};
function RadioInput({ label, name, required, valuesArr, onChange }) {
return (
<label className="input input--radio">
{label}
<div className="radio-buttons">
{valuesArr.map((value) => (
<div key={value}>
<input
type="radio"
name={name}
value={value}
onChange={onChange}
required={required}
/>
<span>{value}</span>
</div>
))}
</div>
</label>
);
}
RadioInput.propTypes = {
label: PropTypes.string.isRequired,
name: PropTypes.string,
valuesArr: PropTypes.array,
onChange: PropTypes.func,
required: PropTypes.bool,
};

export { RadioInput };
export default TextInput;
4 changes: 0 additions & 4 deletions client/src/components/landingpage/LandingPage.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Nav from "../common/nav";
import Button from "../common/Button";
import Footer from "../common/Footer";

import FancyBlobs from "./FancyBlobs";

Expand Down Expand Up @@ -50,7 +48,6 @@ const features = [
export default function LandingPage() {
return (
<div className="landing_page">
<Nav showIcons={false} />
<header className="hero">
<div className="container">
<h1>نظام إدارة الكشافة الحديث</h1>
Expand Down Expand Up @@ -79,7 +76,6 @@ export default function LandingPage() {

<FancyBlobs />
</section>
<Footer />
</div>
);
}
14 changes: 14 additions & 0 deletions client/src/components/layout/PublicLayout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Outlet } from "react-router-dom";

import Nav from "../common/nav";
import Footer from "../common/Footer";

export default function PublicLayout() {
return (
<div className="public_layout">
<Nav showIcons={false} />
<Outlet />
<Footer />
</div>
);
}
45 changes: 23 additions & 22 deletions client/src/components/login/logIn.jsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import './logIn.scss'
import Footer from '../common/Footer'
import Button from "../common/Button";
import "./logIn.scss";

export default function LogIn() {
return (
<>
<div className="hero">
<h2>تسجيل الدخول</h2>
<div className="card">
<label className="input-field">
الحساب
<input type="email" />
</label>
<label className="input-field">
الرمز السري
<input type="password" />
</label>
<button>تسجيل الدخول</button>
</div>
<div className="small no-account">ليس لديك حساب؟</div>
</div>
<Footer />
</>
)
return (
<div className="login">
<div className="hero">
<h2>تسجيل الدخول</h2>
<div className="card">
<label className="input-field">
الحساب
<input type="email" />
</label>
<label className="input-field">
الرمز السري
<input type="password" />
</label>
<Button className="Button--medium Button--success" linkTo="/signUp">
تسجيل الدخول
</Button>
</div>
<div className="small no-account">ليس لديك حساب؟</div>
</div>
</div>
);
}
61 changes: 24 additions & 37 deletions client/src/components/login/logIn.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

.hero {
.login {
.hero {
display: flex;
width: 22.5rem;
height: 40rem;
Expand All @@ -9,9 +9,9 @@
margin: auto;
padding: 1.75rem 0.25rem;
gap: 1.1875rem;
}
}

.card {
.card {
background-color: var(--grey-800);
border-radius: 1.875rem;
display: flex;
Expand All @@ -23,41 +23,28 @@
align-items: center;
gap: 0.875rem;
.input-field {
display: flex;
width: 14.16319rem;
padding: 0.125rem 0.75rem;
justify-content: flex-end;
align-items: center;
align-content: center;
gap: 0rem 9.25rem;
flex-wrap: wrap;
input {
background: var(--grey-700);
margin-block: 0.3rem;
border: 1px solid var(--grey-600);
border-radius: 0.25rem;
width: 12.66319rem;
height: 1.75rem;
flex-shrink: 0;
}
display: flex;
width: 14.16319rem;
padding: 0.125rem 0.75rem;
justify-content: flex-end;
align-items: center;
align-content: center;
gap: 0rem 9.25rem;
flex-wrap: wrap;
input {
background: var(--grey-700);
margin-block: 0.3rem;
border: 1px solid var(--grey-600);
border-radius: 0.25rem;
width: 12.66319rem;
height: 1.75rem;
flex-shrink: 0;
}
}
}
}

.no-account {
.no-account {
color: var(--Teal-500);
margin-bottom: 1rem;
}

button {
//color: var(--text-color);
background: var(--green-700);
border: 0px solid;
border-radius: 0.3125rem;
display: flex;
width: 7.25rem;
height: 1.875rem;
padding: 0.8125rem 0.625rem;
justify-content: center;
align-items: center;
gap: 1.25rem;
}
}
Loading

0 comments on commit 340141c

Please sign in to comment.