complete home page

This commit is contained in:
Alihaghighattalab
2024-08-06 16:24:04 +03:30
parent ee1fa04d3b
commit 02bd8ba075
12 changed files with 1497 additions and 12 deletions
+3 -4
View File
@@ -3,24 +3,23 @@ import React, { FC, useState } from "react"
import { Input as InputComponent } from '@headlessui/react'
type Props = {
style?: string,
type?: React.HTMLInputTypeAttribute,
placeholder: string,
icon?: React.ReactNode,
field?: any
}
export const Input: FC<Props> = ({ placeholder, type = "text", icon, field, style }) => {
export const Input: FC<Props> = ({ placeholder, type = "text", icon, field }) => {
const [hidden, setHidden] = useState<boolean>(false)
const handleHidden = () => setHidden(prev => !prev)
return (
<div className={`relative w-full !${style}`}>
<div className={`relative w-full`}>
<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>
<InputComponent {...field} type={type === "password" && hidden ? "text" : type} placeholder={placeholder} className="input-style" />
<InputComponent {...field} type={type === "password" && hidden ? "text" : type} placeholder={placeholder} className="input-style min-w-full" />
</div>
)
}
+21
View File
@@ -0,0 +1,21 @@
import { Button } from "@headlessui/react"
import { Input } from "../common/input"
export const Imei = () => {
return (
<div className="w-full flex flex-col lg:flex-row bg-auth-form p-[30px] rounded-[40px] gap-8">
<div className="w-full h-full flex items-center justify-center">
<img src="/svgs/home/binary.svg" alt="binary" className="size-full max-w-[500px] max-h-[500px]" />
</div>
<div className="flex flex-col w-full gap-10 justify-center lg:justify-between">
<Input placeholder="کد IMEI" />
<p className="font-normal text-base text-primary-text-color text-justify lg:text-wrap">
لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز
</p>
<div className="w-full flex justify-end">
<Button className="w-full min-w-full xl:min-w-min xl:max-w-60">ثبت کد</Button>
</div>
</div>
</div>
)
}
+30
View File
@@ -0,0 +1,30 @@
import { FC } from "react"
import { StatusBoxItemInterface } from "../../types"
import { filterNumber } from "../../utility/status"
type Props = {
item: StatusBoxItemInterface
}
export const StatusBoxItem: FC<Props> = ({ item }) => {
return (
<div className="w-full bg-auth-form p-[18px] h-full rounded-[40px] flex flex-col gap-[42px]">
<div className="size-16 bg-secondary-color flex justify-center rounded-full items-center">
{item?.icon}
</div>
<div className="flex flex-col gap-3">
<p className="font-normal text-base text-secondary-text-color">{item?.title}</p>
<p className="font-medium text-[28px] text-primary-text-color">
{item?.name === "coin" && <p className="flex items-end gap-x-1">
{filterNumber(item?.value)} <p className="text-lg font-normal">تومان</p>
</p>}
{item?.name === "dollar" && <p className="text-lg font-normal flex items-center gap-x-1">$
<p className="font-medium text-[28px] text-primary-text-color">
{filterNumber(item?.value)}
</p>
</p>}
{item?.name !== "coin" && item?.name !== "dollar" && item?.value}
</p>
</div>
</div>
)
}
+13
View File
@@ -0,0 +1,13 @@
import { StatusBoxItemInterface } from "../../types"
import { statusBoxItems } from "../../utility/status"
import { StatusBoxItem } from "./status-box-items"
export const StatusBox = () => {
return (
<div className="grid grid-cols-1 sm:grid-cols-2 2xl:grid-cols-4 gap-6">
{statusBoxItems?.map((item: StatusBoxItemInterface) => <StatusBoxItem key={item?.name} item={item} />)}
</div>
)
}
+1 -1
View File
@@ -3,7 +3,7 @@ import { socialsList } from "../../../utility/socials"
export const Footer = () => {
return (
<footer className="w-full flex flex-row gap-x-2 justify-end items-center">
<footer className="w-full flex flex-row gap-x-2 justify-center lg:justify-end items-center py-5">
{socialsList?.map((item: SocialsInterface) => <img key={item?.name} src={item?.path} alt={item?.name} className="size-10 min-w-10 min-h-10 cursor-pointer" />)}
</footer>
)
+1 -1
View File
@@ -7,7 +7,7 @@ type Props = {
export const Header: FC<Props> = ({ setShow }) => {
return (
<header className="flex flex-row w-full justify-between items-center mb-10 xl:mb-y-[60px]">
<header className="flex flex-row w-full justify-between items-center mb-10 lg:mb-[60px]">
<div className="flex flex-row gap-x-5 lg:gap-x-3 items-center">
<img src="/svgs/header/burger-menu.svg" alt="burger menu" className="lg:hidden size-[27px]" onClick={setShow} />
<img src="/svgs/header/person.svg" alt="person" className="size-[60px]" />
+4 -3
View File
@@ -9,16 +9,17 @@ export const DashboardLayout = () => {
const [show, setShow] = useState<boolean>(false)
const handleSidebar = () => setShow(prev => !prev)
return (
<div className="w-full h-screen flex flex-col lg:flex-row">
<div className="w-full min-h-screen flex flex-col lg:flex-row">
<Sidebar />
<SidebarMobile show={show} setShow={setShow} />
<div className="w-full h-screen p-4 xl:p-[30px] flex flex-col">
<div className="w-full min-h-screen p-4 pb-0 xl:p-[30px] xl:pb-0 flex flex-col overflow-y-auto">
<Header setShow={handleSidebar} />
<div className="h-screen w-full">
<div className="flex-grow w-full">
<Outlet />
</div>
<Footer />
</div>
</div>
)
}
+1 -1
View File
@@ -7,7 +7,7 @@ export const Sidebar = () => {
return (
<div className="hidden lg:flex bg-auth-form min-w-[318px] max-w-[318px] flex-col items-center py-[42px] gap-y-20">
<img src="/svgs/logo/logo.svg" alt="logo" className="auth-logo-size" />
<div className="flex flex-col justify-between h-full">
<div className="flex flex-col justify-between h-full bg-auth-form ">
<div className="flex flex-col gap-y-3">
{sidebarItems?.map((item: SidebarInterface) => <SidebarItem key={item?.name} item={item} />)}
</div>