add loading all page & change bugs

This commit is contained in:
Ehsan
2024-09-05 22:20:18 +03:30
parent 087ed4a818
commit c45a161fcb
72 changed files with 1208 additions and 661 deletions
+12 -4
View File
@@ -1,5 +1,6 @@
'use client';
import { useState } from 'react';
import { useEffect, useState } from 'react';
import About from './components/about';
import Contact from './components/contact';
@@ -11,14 +12,21 @@ const listTab = ['درباره کلینیک', 'اطلاعات تماس', 'پزش
function ClinicPage({ data, doctors }) {
const [value, setValue] = useState(0);
const [loading, setLoading] = useState(true);
const handleChange = (event, newValue) => setValue(newValue);
const Components = [
<About data={data} />,
<Contact data={data} />,
<Doctors doctors={doctors} />
<About data={data} loading={loading} />,
<Contact data={data} loading={loading} />,
<Doctors doctors={doctors} loading={loading} />
];
useEffect(() => {
setTimeout(() => {
setLoading(false);
}, 2000);
}, []);
return (
<div className="pt-[40px] sm:pt-[70px] md:pt-[100px] lg:pt-[136px] mt-[40px] padding-responsive">
<Tabs