complete login forgot signup page - init project
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
function App() {
|
||||
return (
|
||||
<div className="text-green-900">
|
||||
Hello World
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Menu, MenuButton } from '@headlessui/react'
|
||||
import { ArrowDown2 } from 'iconsax-react'
|
||||
import { FC } from 'react'
|
||||
|
||||
type Props = {
|
||||
title: string
|
||||
}
|
||||
|
||||
export const DropDown: FC<Props> = ({ title }) => {
|
||||
return (
|
||||
|
||||
<Menu as="div" className="w-full">
|
||||
<MenuButton className="input-style flex flex-row justify-between items-center p-[18px]">
|
||||
<p className='text-secondary-text-color/70 text-base font-normal'>{title}</p>
|
||||
<ArrowDown2 className="size-5 text-secondary-text-color/70" />
|
||||
</MenuButton>
|
||||
</Menu>
|
||||
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Eye, EyeSlash } from "iconsax-react"
|
||||
import { FC, useState } from "react"
|
||||
|
||||
type Props = {
|
||||
style?: string,
|
||||
type?: React.HTMLInputTypeAttribute,
|
||||
placeholder: string,
|
||||
icon?: React.ReactNode
|
||||
}
|
||||
|
||||
export const Input: FC<Props> = ({ placeholder, type = "text", icon }) => {
|
||||
const [hidden, setHidden] = useState<boolean>(false)
|
||||
const handleHidden = () => setHidden(prev => !prev)
|
||||
return (
|
||||
<div className="w-full min-w-[250px] sm:min-w-[400px]">
|
||||
<div className="relative w-full min-w-[200px]">
|
||||
<div className="absolute top-[18.5px] left-5 grid h-5 w-5 place-items-center text-blue-gray-500">
|
||||
{type === "password" ?
|
||||
!hidden ? <Eye size="23" color="#777577" onClick={handleHidden} /> : <EyeSlash size="23" color="#777577" onClick={handleHidden} />
|
||||
: icon}
|
||||
</div>
|
||||
<input type={type === "password" && hidden ? "text" : type} className="input-style" placeholder={placeholder} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Input } from "../common/input"
|
||||
|
||||
export const ForgotPasswordForm = () => {
|
||||
return (
|
||||
<div
|
||||
className="w-fit xl:w-1/2 xl:p-0 p-10 flex flex-col bg-auth-form justify-center items-center gap-y-[42px] rounded-3xl">
|
||||
<img src="/svgs/logo/logo.svg" alt="logo" className="auth-logo-size" />
|
||||
<div className="flex flex-col xl:-mr-24">
|
||||
<div className="flex flex-col gap-y-5">
|
||||
<span className="font-medium text-lg md:text-2xl xl:text-3xl text-primary-text-color">فراموشی رمز عبور</span>
|
||||
<div className="flex flex-row gap-x-0.5 items-center">
|
||||
<p className="text-secondary-text-color font-normal text-xs md:text-sm">لطفا شماره موبایل خود را وارد کنید</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-9 mb-[42px]">
|
||||
<Input type="number" placeholder="شماره موبایل" />
|
||||
</div>
|
||||
<div className="flex flex-col gap-y-[27px] items-center">
|
||||
<button>دریافت کد تایید</button>
|
||||
<p className="font-medium text-base text-primary-color">بازگشت</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { Link } from "react-router-dom"
|
||||
import { Input } from "../common/input"
|
||||
|
||||
export const LoginForm = () => {
|
||||
return (
|
||||
<div
|
||||
className="w-fit sm:min-w-[500px] xl:w-1/2 xl:p-0 p-10 flex flex-col bg-auth-form justify-center items-center gap-y-[42px] rounded-3xl">
|
||||
<img src="/svgs/logo/logo.svg" alt="logo" className="auth-logo-size" />
|
||||
<div className="flex flex-col xl:-mr-24">
|
||||
<div className="flex flex-col gap-y-5">
|
||||
<span className="font-medium text-lg md:text-2xl xl:text-3xl text-primary-text-color">وارد حساب کاربری شوید</span>
|
||||
<div className="flex flex-row gap-x-0.5 items-center">
|
||||
<p className="text-secondary-text-color font-normal text-xs md:text-sm">حساب کاربری ندارید؟</p>
|
||||
<Link to="/auth/register">
|
||||
<p className="text-primary-color font-bold text-xs md:text-sm cursor-pointer">ثبت نام کنید</p>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-y-[25px] mt-9 mb-[42px]">
|
||||
<Input type="number" placeholder="شماره تماس" />
|
||||
<Input type="password" placeholder="رمز عبور" />
|
||||
<p className="font-medium text-sm text-secondary-text-color cursor-pointer">فراموشی رمز عبور</p>
|
||||
</div>
|
||||
<div className="flex flex-col gap-y-[27px] items-center">
|
||||
<button>ثبت</button>
|
||||
<p className="font-medium text-base text-primary-color">ورود با رمز یکبار مصرف</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { Link } from "react-router-dom"
|
||||
import { DropDown } from "../common/drop-down"
|
||||
import { Input } from "../common/input"
|
||||
|
||||
export const RegisterForm = () => {
|
||||
return (
|
||||
<div
|
||||
className="w-fit sm:min-w-[500px] max-h-full overflow-y-auto xl:w-1/2 xl:p-0 xl:py-5 p-10 flex flex-col bg-auth-form items-center gap-y-[42px] rounded-3x rounded-3xl">
|
||||
<img src="/svgs/logo/logo.svg" alt="logo" className="auth-logo-size" />
|
||||
<div className="flex flex-col">
|
||||
<div className="flex flex-col gap-y-5">
|
||||
<span className="font-medium text-lg md:text-2xl xl:text-3xl text-primary-text-color">حساب کاربری خود را ایجاد کنید</span>
|
||||
<div className="flex flex-row gap-x-0.5 items-center">
|
||||
<p className="text-secondary-text-color font-normal text-xs md:text-sm">از قبل یک حساب کاربری دارید؟</p>
|
||||
<Link to="/auth/login">
|
||||
<p className="text-primary-color font-bold text-xs md:text-sm cursor-pointer">وارد شوید</p>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-1 gap-y-5 mb-[42px] mt-9">
|
||||
<Input type="text" placeholder="نام و نام خانوادگی" />
|
||||
<div className="flex flex-col lg:flex-row gap-y-5 gap-x-4 w-full">
|
||||
<DropDown title="استان" />
|
||||
<DropDown title="شهر" />
|
||||
</div>
|
||||
<Input type="text" placeholder="نام فروشگاه" />
|
||||
<Input type="number" placeholder="شماره موبایل" />
|
||||
<Input type="password" placeholder="رمز عبور" />
|
||||
<Input type="password" placeholder="تکرار رمز عبور" />
|
||||
</div>
|
||||
<button>ثبت نام</button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Outlet } from "react-router-dom"
|
||||
|
||||
export const AuthLayout = () => {
|
||||
return (
|
||||
<section
|
||||
className="flex flex-row h-screen p-5 justify-center items-center xl:justify-stretch xl:items-stretch max-h-[750px]">
|
||||
<Outlet />
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
@font-face {
|
||||
font-family: "vazirmatn";
|
||||
src: url("../public/fonts/Vazir.woff") format('woff');
|
||||
}
|
||||
|
||||
@layer base {
|
||||
html {
|
||||
font-family: 'vazirmatn';
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
input[type=number]::-webkit-outer-spin-button,
|
||||
input[type=number]::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
input[type=number] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
button{
|
||||
@apply text-base font-medium flex w-full justify-center bg-primary-color max-w-[442px] max-h-[55px] rounded-[20px] p-[18px] text-white
|
||||
}
|
||||
}
|
||||
|
||||
@layer components {
|
||||
.auth-image-desktop {
|
||||
@apply size-[550px] max-w-[550px]
|
||||
}
|
||||
|
||||
.input-style {
|
||||
@apply w-full bg-white rounded-[60px] p-[18px] max-w-[442px] shadow-sm focus:outline-none
|
||||
}
|
||||
|
||||
.auth-logo-size {
|
||||
@apply w-full max-w-[198px] h-auto
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import { RouterProvider } from 'react-router-dom';
|
||||
import { router } from './router';
|
||||
import './index.css'
|
||||
|
||||
|
||||
const root = ReactDOM.createRoot(
|
||||
document.getElementById('root') as HTMLElement
|
||||
);
|
||||
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<RouterProvider router={router} />
|
||||
</React.StrictMode>
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
@@ -0,0 +1,12 @@
|
||||
import { ForgotPasswordForm } from "../../components/forms/forgot-password-form"
|
||||
|
||||
export const ForgotPassword = () => {
|
||||
return (
|
||||
<>
|
||||
<ForgotPasswordForm />
|
||||
<div className="hidden xl:flex w-1/2 h-full justify-center items-center">
|
||||
<img src="/svgs/auth/forgot-password.svg" alt="forgot password" className="auth-image-desktop" />
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
import { LoginForm } from "../../components/forms/login-form"
|
||||
|
||||
export const Login = () => {
|
||||
return (
|
||||
<>
|
||||
<LoginForm />
|
||||
<div className="hidden xl:flex w-1/2 h-full justify-center items-center">
|
||||
<img src="/svgs/auth/login.svg" alt="login" className="auth-image-desktop" />
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { RegisterForm } from "../../components/forms/register-form"
|
||||
|
||||
export const Register = () => {
|
||||
return (
|
||||
<>
|
||||
<RegisterForm />
|
||||
<div className="hidden xl:flex w-1/2 h-full justify-center items-center">
|
||||
<img src="/svgs/auth/register.svg" alt="register" className="auth-image-desktop" />
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { createBrowserRouter } from "react-router-dom";
|
||||
import { AuthLayout } from "../components/ui/auth/layout";
|
||||
import App from "../App";
|
||||
import { Login } from "../pages/auth/login";
|
||||
import { ForgotPassword } from "../pages/auth/forgot-password";
|
||||
import { Register } from "../pages/auth/register";
|
||||
|
||||
export const router = createBrowserRouter([
|
||||
{
|
||||
path: "/",
|
||||
element: <App />
|
||||
},
|
||||
{
|
||||
element: <AuthLayout />,
|
||||
path: "/auth",
|
||||
children: [
|
||||
{
|
||||
path: "login",
|
||||
element: <Login />
|
||||
},
|
||||
{
|
||||
path: "forgot-password",
|
||||
element: <ForgotPassword />
|
||||
},
|
||||
{
|
||||
path: "register",
|
||||
element: <Register />
|
||||
}
|
||||
]
|
||||
}
|
||||
])
|
||||
Reference in New Issue
Block a user