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