add state of page in url, add location and working_days on list in clinics page, fix update list clinic with page and limit value, hide pagination when list of clinic is empty, round image of doctor and appo in doctor item
This commit is contained in:
@@ -48,7 +48,7 @@ function ItemClinic({ setFilteredClinics, data, loading }) {
|
||||
<LocationClinic />
|
||||
<TextLoading loading={loading} width={150} height={18}>
|
||||
<p className="text-[#7E7E7E] text-[12px] font-normal">
|
||||
{data.location}
|
||||
{data.address}
|
||||
</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
@@ -56,7 +56,7 @@ function ItemClinic({ setFilteredClinics, data, loading }) {
|
||||
<ClockClinic />
|
||||
<TextLoading loading={loading} width={120} height={18}>
|
||||
<p className="text-[#7E7E7E] text-[12px] font-normal">
|
||||
ساعت کاری: {data.hours_of_work}
|
||||
ساعت کاری: {data.field_working_days}
|
||||
</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
|
||||
@@ -4,14 +4,19 @@ import { QueryForClinicsFilter } from "@/helper";
|
||||
import Pageguide from "@/app/component/Pageguide";
|
||||
import PaginationContent from "@/app/component/PaginationContent";
|
||||
import { request } from "@/services/response";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
function List({ limit, selected, clinics, pages, setFilteredClinics }) {
|
||||
const listPage = ["کلینیک ها", selected?.city?.name || ""];
|
||||
const [page, setPage] = useState(pages?.currentPage);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const router = useRouter();
|
||||
|
||||
const changePage = (_, num) => {
|
||||
setLoading(true);
|
||||
const searchParams = new URLSearchParams(window.location.search);
|
||||
searchParams.set("page", num);
|
||||
router.push(`?${searchParams.toString()}`);
|
||||
|
||||
setPage(num);
|
||||
const params = {
|
||||
|
||||
Reference in New Issue
Block a user