change text location all page
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
// Icons
|
||||
import ArrowBottomH from "@/components/icons/ArrowBottomH";
|
||||
import Location from "@/components/icons/Location";
|
||||
import { useProvince } from "@/context/ProvinceProvider";
|
||||
import { Button } from "@mui/material";
|
||||
|
||||
function ButtonFilter({ selected, setOpen }) {
|
||||
const handleOpen = () => setOpen(true);
|
||||
const { isProvinceInclude } = useProvince();
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -26,6 +28,8 @@ function ButtonFilter({ selected, setOpen }) {
|
||||
>
|
||||
{selected && selected.province && selected.city
|
||||
? `${selected.province} | ${selected.city}`
|
||||
: isProvinceInclude?.name
|
||||
? isProvinceInclude.name
|
||||
: "انتخاب شهر"}
|
||||
</p>
|
||||
<div className="w-[16px] h-[16px] md:w-[18px] md:h-[18px] lg:w-[20px] lg:h-[20px] grid place-items-center">
|
||||
|
||||
@@ -13,6 +13,7 @@ import { useProvince } from "@/context/ProvinceProvider";
|
||||
function ModalSearchCity({ children, selected, setSelected, open, setOpen }) {
|
||||
const provinceSelected = selected.province;
|
||||
const { isProvinceInclude } = useProvince();
|
||||
const newProvinceData = isProvinceInclude?.id === 63;
|
||||
|
||||
const [states, setStates] = useState([]);
|
||||
const [cities, setCities] = useState([]);
|
||||
@@ -89,7 +90,7 @@ function ModalSearchCity({ children, selected, setSelected, open, setOpen }) {
|
||||
handleClose={handleClose}
|
||||
filteredCities={filteredCities}
|
||||
provinceSelected={provinceSelected}
|
||||
isProvinceInclude={isProvinceInclude}
|
||||
isProvinceInclude={newProvinceData}
|
||||
/>
|
||||
</Box>
|
||||
</Modal>
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
"use client";
|
||||
|
||||
import { Button, ButtonGroup, TextField } from "@mui/material";
|
||||
import SearchD from "@/components/icons/SearchD";
|
||||
import ModalSearchCity from "./modal";
|
||||
import ModalSearchCity from "@/app/component/modalSearchCity";
|
||||
import { useState } from "react";
|
||||
import ButtonFilter from "@/app/component/modalSearchCity/ButtonFilter";
|
||||
|
||||
function SearchBar() {
|
||||
const [selected, setSelected] = useState({
|
||||
province: "",
|
||||
city: "",
|
||||
});
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<ButtonGroup
|
||||
variant="contained"
|
||||
@@ -11,7 +21,14 @@ function SearchBar() {
|
||||
!shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)]
|
||||
!h-fit !pl-1"
|
||||
>
|
||||
<ModalSearchCity />
|
||||
<ModalSearchCity
|
||||
open={open}
|
||||
setOpen={setOpen}
|
||||
selected={selected}
|
||||
setSelected={setSelected}
|
||||
>
|
||||
<ButtonFilter setOpen={setOpen} selected={selected} />
|
||||
</ModalSearchCity>
|
||||
<TextField
|
||||
variant="standard"
|
||||
InputProps={{
|
||||
|
||||
@@ -2,9 +2,11 @@ import Pageguide from "@/app/component/Pageguide";
|
||||
import clinics from "@/data/clinics.json";
|
||||
import ItemClinic from "./ItemClinic";
|
||||
import Pagination from "@/app/component/Pagination";
|
||||
import { useProvince } from "@/context/ProvinceProvider";
|
||||
|
||||
function List({ loading }) {
|
||||
const listPage = ["کلینیک ها", "اهواز"];
|
||||
const { isProvinceInclude } = useProvince();
|
||||
const listPage = ["کلینیک ها", isProvinceInclude?.name || ""];
|
||||
|
||||
return (
|
||||
<div className="padding-responsive pt-[20px]">
|
||||
|
||||
@@ -6,10 +6,12 @@ import SortList from "./sortlist";
|
||||
import ListDoctors from "./listDoctors";
|
||||
import LocationD from "../icons/LocationD";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import { useProvince } from "@/context/ProvinceProvider";
|
||||
|
||||
function DoctorsPage() {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const searchParams = useSearchParams();
|
||||
const { isProvinceInclude } = useProvince();
|
||||
const locationSelected = {
|
||||
province: searchParams.get("province"),
|
||||
city: searchParams.get("city"),
|
||||
@@ -34,7 +36,9 @@ function DoctorsPage() {
|
||||
<LocationD />
|
||||
<p className="text-[#525252] text-[16px] font-semibold">
|
||||
{" "}
|
||||
{locationSelected.province || "استان"} /{" "}
|
||||
{isProvinceInclude?.name || locationSelected.province || "استان"}
|
||||
{/* {isProvinceInclude?.name ? "" : " / "} */}
|
||||
{" / "}
|
||||
{locationSelected.city || "شهر"}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -1,24 +1,29 @@
|
||||
"use client";
|
||||
|
||||
import AText from "../icons/AText";
|
||||
import BText from "../icons/BText";
|
||||
|
||||
// Components
|
||||
import SearchBar from "./search";
|
||||
import FrequentSearches from "./FrequentSearches";
|
||||
import { useProvince } from "@/context/ProvinceProvider";
|
||||
|
||||
function HomePage() {
|
||||
const { isProvinceInclude } = useProvince();
|
||||
|
||||
return (
|
||||
<div className="bg-banner-home after:z-[2] !bg-bottom !bg-no-repeat !bg-cover md:!min-h-[115vh]">
|
||||
<div className="padding-responsive z-20 min-h-screen py-[120px] flex items-center justify-center flex-col gap-[40px]">
|
||||
<div className="z-[50]">
|
||||
<p className="text-[#F17732] text-center font-kalame text-[20px] sm:text-[24px] md:text-[28px] lg:text-[32px] font-bold">
|
||||
با نوبت724
|
||||
با {isProvinceInclude?.site_name}
|
||||
</p>
|
||||
<p
|
||||
className="text-[#525252] text-center mt-2.5 font-kalame text-[16px] sm:text-[25px] md:text-[31px] lg:text-[36px]
|
||||
font-bold flex items-center gap-1 sm:gap-3"
|
||||
>
|
||||
<BText />
|
||||
دیگه نوبت گرفتن کار سختی نیست !
|
||||
{isProvinceInclude?.slogan}
|
||||
<AText />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -7,8 +7,8 @@ const ProvinceContext = createContext();
|
||||
|
||||
export const ProvinceProvider = ({ children }) => {
|
||||
const [hostName, setHostName] = useState("");
|
||||
const isProvinceInclude = citiesData.find(
|
||||
(city) => city.domain !== "nobat724.com" && hostName.includes(city.domain)
|
||||
const isProvinceInclude = citiesData.find((city) =>
|
||||
hostName.includes(city.domain.split(".")[0])
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
+1
-1
@@ -375,7 +375,7 @@
|
||||
"id": "63",
|
||||
"type": "2",
|
||||
"province_id": "32",
|
||||
"name": "All",
|
||||
"name": "",
|
||||
"site_name": "نوبت 724",
|
||||
"slogan": "دیگه نوبت گرفتن کار سختی نیست !",
|
||||
"domain": "nobat724.com",
|
||||
|
||||
Reference in New Issue
Block a user