responsive page user-account & add-doctor & turns & add loading to all page panel & change design page dashboard
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
function BgGray({ isActive, setIsActive }) {
|
||||
return (
|
||||
<div
|
||||
onClick={() => setIsActive(false)}
|
||||
className={`
|
||||
md:hidden ${isActive ? 'bg-[#232323] opacity-40 flex' : 'bg-transparent opacity-40 hidden'}
|
||||
absolute z-[25] cursor-pointer transition-all duration-500 left-0 top-0 w-screen h-screen
|
||||
`}
|
||||
></div>
|
||||
)
|
||||
}
|
||||
|
||||
export default BgGray
|
||||
@@ -29,16 +29,16 @@ function Links({ open }) {
|
||||
variant="text"
|
||||
className={`
|
||||
!p-[8px] !flex !items-center !justify-start !gap-[8px] !text-[16px] !rounded-[8px] !transition-all !duration-500
|
||||
${item.src === pathname ? '!bg-[#5559CE] !text-[#FAFAFA] !font-bold' : '!text-[#525252] !font-medium'}
|
||||
${item.src === pathname ? '!bg-[#5559CE]' : ''}
|
||||
`}
|
||||
>
|
||||
|
||||
<div className="p-[4px] bg-[#E5E9FF] rounded-[4px] w-fit">
|
||||
{item.icon}
|
||||
</div>
|
||||
<p className={`
|
||||
transition-all duration-500
|
||||
${open ? 'opacity-100' : 'md:opacity-0'}
|
||||
${item.src === pathname ? '!text-[#FAFAFA] !font-bold' : '!text-[#525252] !font-medium'}
|
||||
`}>{item.name}</p>
|
||||
</Button>
|
||||
</Link>
|
||||
|
||||
@@ -1,34 +1,28 @@
|
||||
import { useState } from "react";
|
||||
|
||||
import Links from "./Links";
|
||||
import HeadMd from "./HeadMd";
|
||||
import HeadSm from "./HeadSm";
|
||||
import { Button } from "@mui/material";
|
||||
import LogoutOrangeP from "@/components/icons/LogoutOrangeP";
|
||||
|
||||
function Sidebar({ active, setActive }) {
|
||||
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
function Sidebar({ active, setActive, open, setOpen }) {
|
||||
return (
|
||||
<div className={`
|
||||
transition-all duration-500 md:flex fixed md:relative z-30 w-[85%] md:w-fit
|
||||
transition-all duration-500 md:flex fixed md:relative z-30 w-[85%]
|
||||
${active ? ' right-0' : 'right-[-85%]'}
|
||||
${open ? 'min-w-[243px]' : 'min-w-[96px]'}
|
||||
${open ? 'min-w-[243px] md:w-[243px]' : 'min-w-[96px] md:w-[96px]'}
|
||||
`}>
|
||||
<aside className={`
|
||||
relative h-screen overflow-hidden
|
||||
transition-all duration-500 w-[85%] md:w-fit
|
||||
transition-all duration-500 w-[85%]
|
||||
${active ? ' right-0' : 'right-[-85%]'}
|
||||
${open ? 'w-[243px]' : 'w-[96px]'}
|
||||
`}>
|
||||
<div className={`
|
||||
z-30
|
||||
md:top-0 md:right-0 w-[85%] md:w-fit
|
||||
z-30 md:top-0 md:right-0 w-[85%]
|
||||
${active ? ' right-0' : 'right-[-85%]'}
|
||||
overflow-hidden p-[24px] h-full flex flex-col justify-between items-start fixed
|
||||
border-0 border-l border-l-[#EFEFEF] bg-[#FFF]
|
||||
transition-all duration-700
|
||||
transition-all duration-500
|
||||
${open ? 'md:w-[243px]' : 'md:w-[96px]'}
|
||||
`}>
|
||||
<div className="w-full">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import TextLoading from "@/app/component/loading/Text"
|
||||
import WarnP from "@/components/icons/WarnP"
|
||||
|
||||
function Activities({ data }) {
|
||||
function Activities({ data, loading }) {
|
||||
return (
|
||||
<div className="w-full mt-[16px] sm:mt-[24px] md:mt-[32px] lg:mt-[40px]">
|
||||
<p className="text-[#525252] text-[14px] md:text-[16px] font-bold">فعالیت های امروز</p>
|
||||
@@ -15,9 +16,13 @@ function Activities({ data }) {
|
||||
<div className="bg-[rgba(255,192,81,0.20)] p-[8px] rounded-full">
|
||||
<WarnP />
|
||||
</div>
|
||||
<p className="text-[#616161] text-[16px] font-medium">{item.text}</p>
|
||||
<TextLoading width={110} height={18} loading={loading}>
|
||||
<p className="text-[#616161] text-[16px] font-medium">{item.text}</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
<p className="text-[#7E7E7E] text-[12px] font-normal">{item.time}</p>
|
||||
<TextLoading width={55} height={18} loading={loading}>
|
||||
<p className="text-[#7E7E7E] text-[12px] font-normal">{item.time}</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
{data.todays_activities.length > idx + 1 && (
|
||||
<span className="block h-px w-full bg-transparent md:bg-[#EFEFEF] px-[13px] my-[16px] md:my-[20px] lg:my-[24px]"></span>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { DatePicker } from "jalaali-react-date-picker"
|
||||
'use client'
|
||||
|
||||
import { DatePicker } from "jalaali-react-date-picker";
|
||||
|
||||
function Date() {
|
||||
return (
|
||||
|
||||
@@ -1,32 +1,46 @@
|
||||
import CircularLoading from '@/app/component/loading/Circular'
|
||||
import TextLoading from '@/app/component/loading/Text'
|
||||
import ArrowLeftBlueP from '@/components/icons/ArrowLeftBlueP'
|
||||
import LocationP from '@/components/icons/LocationP'
|
||||
import { Button } from '@mui/material'
|
||||
import Image from 'next/image'
|
||||
import React from 'react'
|
||||
|
||||
function Head({ data }) {
|
||||
function Head({ data, loading }) {
|
||||
return (
|
||||
<div className="flex w-full flex-col items-center justify-start">
|
||||
<Image
|
||||
src={data.src}
|
||||
height={80}
|
||||
width={80}
|
||||
alt="profile"
|
||||
/>
|
||||
<p className="text-[#3B3B3B] text-[14px] font-semibold mt-[8px] mb-[4px]">{data.name}</p>
|
||||
<CircularLoading width={80} height={80} loading={loading}>
|
||||
<Image
|
||||
src={data.src}
|
||||
height={80}
|
||||
width={80}
|
||||
alt="profile"
|
||||
/>
|
||||
</CircularLoading>
|
||||
<div className={loading && 'mt-[8px] mb-[4px]'}>
|
||||
<TextLoading width={60} height={18} loading={loading}>
|
||||
<p className="text-[#3B3B3B] text-[14px] font-semibold mt-[8px] mb-[4px]">{data.name}</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
<div className="flex items-center justify-center gap-[8px]">
|
||||
<LocationP />
|
||||
<p className="text-[#7E7E7E] text-[14px] font-normal">نماینده شهر اهواز</p>
|
||||
<TextLoading width={55} height={16} loading={loading}>
|
||||
<p className="text-[#7E7E7E] text-[14px] font-normal">نماینده شهر اهواز</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
<div className="flex items-center justify-center my-[16px]">
|
||||
<div className="flex flex-col items-center justify-center">
|
||||
<p className="text-[#9B9B9B] text-[14px] font-normal">کل بیماران</p>
|
||||
<p className="text-[#3B3B3B] text-[14px] font-medium">{data.all_patients}</p>
|
||||
<TextLoading width={55} height={16} loading={loading}>
|
||||
<p className="text-[#3B3B3B] text-[14px] font-medium">{data.all_patients}</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
<span className="block h-[44px] w-px bg-[#EFEFEF] mx-[44px]"></span>
|
||||
<div className="flex flex-col items-center justify-center">
|
||||
<p className="text-[#9B9B9B] text-[14px] font-normal">کل نوبت ها</p>
|
||||
<p className="text-[#3B3B3B] text-[14px] font-medium">{data.total_turns}</p>
|
||||
<TextLoading width={55} height={16} loading={loading}>
|
||||
<p className="text-[#3B3B3B] text-[14px] font-medium">{data.total_turns}</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
|
||||
@@ -2,17 +2,17 @@ import Head from "./Head";
|
||||
import Date from "./Date";
|
||||
import Activities from "./Activities";
|
||||
|
||||
function UserDetail({ data }) {
|
||||
function UserDetail({ data, loading }) {
|
||||
return (
|
||||
<div className="hidden xl:flex min-w-[332px] h-full opacity-page">
|
||||
<div
|
||||
className="min-w-[332px] p-[24px] border-0 border-r border-r-[#EFEFEF] h-full items-start fixed top-0 left-0
|
||||
bg-[#FFF] py-[40px] px-[16px]"
|
||||
>
|
||||
<Head data={data} />
|
||||
<Head data={data} loading={loading} />
|
||||
<span className="block w-full h-px bg-[#EFEFEF] px-[22px] mt-[13px] mb-[16px]"></span>
|
||||
<Date />
|
||||
<Activities data={data} />
|
||||
<Activities data={data} loading={loading} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user