update 13 files

master
Reza_ashrafi 2 years ago
parent 9711959824
commit f5ba1596b0
  1. 2
      src/components/Navbar/index.js
  2. 1
      src/components/Select/index.js
  3. 1
      src/components/StarRating/index.js
  4. 4
      src/views/Address/index.js
  5. 119
      src/views/Auth/Profile/Birthdate/index.js
  6. 70
      src/views/Auth/Profile/Upload/index.js
  7. 331
      src/views/Auth/Profile/index.js
  8. 7
      src/views/Dashboard/layouts/Main/index.js
  9. 1
      src/views/Home/Portrait/Private/index.js
  10. 3
      src/views/ShoppingCart/index.js

@ -61,8 +61,6 @@ function Navbar({
); );
}, [headerOptions, userFavoriteList]); }, [headerOptions, userFavoriteList]);
console.log(Boolean(isActiveBookmark));
useEffect(() => { useEffect(() => {
if (window.scrollY === 0) { if (window.scrollY === 0) {
setTop(() => true); setTop(() => true);

@ -13,7 +13,6 @@ function Select({
width = "w-1/2", width = "w-1/2",
selectProvince, selectProvince,
}) { }) {
console.log({ options });
return ( return (
<div <div
className={`inline-block ${width} relative group rounded-md overflow-hidden ${margin} bg-transparent`} className={`inline-block ${width} relative group rounded-md overflow-hidden ${margin} bg-transparent`}

@ -19,7 +19,6 @@ function StarRating({
const [rate, setRating] = React.useState(null); const [rate, setRating] = React.useState(null);
useMemo(() => { useMemo(() => {
//console.log("gl2");
// if (isLogin && !userProducts.length) getUserProducts(); // if (isLogin && !userProducts.length) getUserProducts();
}, []); }, []);

@ -48,7 +48,6 @@ export const Address = ({
const [addressFields, setAddressFields] = useState({}); const [addressFields, setAddressFields] = useState({});
const [mapAddress, setMapAddress] = useState(null); const [mapAddress, setMapAddress] = useState(null);
const navigation = useNavigate(); const navigation = useNavigate();
console.log({ provinces });
useEffect(() => { useEffect(() => {
setHeaderOptions(headerOptions); setHeaderOptions(headerOptions);
if (province.length <= 1) { if (province.length <= 1) {
@ -98,7 +97,6 @@ export const Address = ({
useEffect(() => { useEffect(() => {
if (addressFields?.provinceId) { if (addressFields?.provinceId) {
console.log({ addressFields });
getCity({ getCity({
provinceId: addressFields?.provinceId, provinceId: addressFields?.provinceId,
}); });
@ -114,7 +112,6 @@ export const Address = ({
}, [profileFields]); }, [profileFields]);
const onChange = (name, value) => { const onChange = (name, value) => {
console.log({ name, value });
setAddressFields({ ...addressFields, [name]: value }); setAddressFields({ ...addressFields, [name]: value });
}; };
@ -296,7 +293,6 @@ export const Address = ({
</div> </div>
); );
}; };
console.log({ state: location?.state });
return ( return (
<div <div

@ -1,61 +1,86 @@
import React, { useState } from "react"; import React from "react";
import onInput from "../../../../utils/onInput"; import onInput from "../../../../utils/onInput";
import Input from "../../../../components/Input/index"; import { connect } from "react-redux";
import moment from "jalali-moment"; function Birthdate({ value, name, onChange, isDesktop, ...props }) {
const [isFocused, setIsFocused] = React.useState(false);
export default function Birthdate({ defaultValue, name, ...props }) {
let momentDate = moment(defaultValue[name]);
let isvalid = momentDate.isValid();
const day = isvalid ? momentDate.format("jDD") : null,
month = isvalid ? momentDate.format("jMM") : null,
year = isvalid ? momentDate.format("jYYYY") : null;
const [state, setState] = useState({ day, month, year });
const onChange = (_name, value) => {
let _state = { ...state, [_name]: value };
setState(_state);
props.onChange(
name,
moment
.from(`${_state.year}/${_state.month}/${_state.day}`, "fa", "YYYY/M/D")
.locale("en")
);
};
return ( return (
<div className="birthdate d-flex justify-content-between align-items-center"> <div className="flex bg-background relative justify-center lg:w-full border border-solid focus:border-blueMarine dark:focus:border-blueCurious border-surfaceBorder rounded-md py-4 px-4">
<label>{window.t("تاریخ تولد")} </label> {isDesktop && (
<div className="mobile-birthdate__date d-flex align-items-center"> <label
<Input className={`text-tiny text-blueMarine bg-background dark:bg-grayDarkJungle font-4 right-4 absolute transform -translate-y-1/2 transition-all ${
variant="standard" isFocused
? "top-0 text-blueMarine text-sm dark:text-blueCurious"
: "top-1/2 text-grayBattleShip text-tiny"
}`}
onClick={() => setIsFocused(true)}
>
تاریخ تولد
</label>
)}
<div className="flex items-center">
<input
type="text"
inputMode="numeric"
name="day" name="day"
placeholder={window.t("روز")} className="w-20 text-center ltr text-sm lg:text-tiny outline-none bg-gray-50 dark:bg-opacity-10 dark:text-white"
maxLength={2} onFocus={() => setIsFocused(true)}
onInput={onInput.dayHandler} onBlur={() => setIsFocused(false)}
onChange={onChange} onChange={(e) =>
defaultValue={state} onChange(name, {
...value,
day: onInput.dayHandler(e.target.value),
})
}
placeholder="روز"
maxLength="2"
value={value?.day}
/> />
<span>/</span> <span className="mx-4 text-gray-300">/</span>
<Input <input
variant="standard" type="text"
inputMode="numeric"
name="month" name="month"
placeholder={window.t("ماه")} className="w-20 text-center text-sm ltr lg:text-tiny outline-none bg-gray-50 dark:bg-opacity-10 dark:text-white"
maxLength={2} onFocus={() => setIsFocused(true)}
onInput={onInput.monthHandler} onBlur={() => setIsFocused(false)}
onChange={onChange} onChange={(e) =>
defaultValue={state} onChange(name, {
...value,
month: onInput.monthHandler(e.target.value),
})
}
placeholder="ماه"
maxLength="2"
value={value?.month}
/> />
<span>/</span> <span className="mx-4 text-gray-300">/</span>
<Input <input
variant="standard" type="text"
inputMode="numeric"
name="year" name="year"
placeholder={window.t("سال")} className="w-20 text-center text-sm ltr lg:text-tiny outline-none bg-gray-50 dark:bg-opacity-10 dark:text-white"
maxLength={4} onFocus={() => setIsFocused(true)}
onInput={onInput.yearHandler} onBlur={() => setIsFocused(false)}
onChange={onChange} onChange={(e) =>
defaultValue={state} onChange(name, {
...value,
year: onInput.yearHandler(e.target.value),
})
}
placeholder="سال"
maxLength="4"
value={value?.year}
/> />
</div> </div>
</div> </div>
); );
} }
const mapStateToProps = (state) => ({
isDesktop: state.config.device === "desktop",
});
export default connect(mapStateToProps)(Birthdate);

@ -1,27 +1,55 @@
import React from "react"; import React, { useState, useMemo } from "react";
import { connect } from "react-redux";
//assets
export default function Upload({ name, value, onChange, label }) { const reader = new FileReader();
function Upload({ name, value: initValue, onChange }) {
const [loaded, setSelected] = useState(null);
reader.onload = (e) => setSelected(e.target.result);
const value = loaded || initValue;
useMemo(() => {
setSelected(null);
}, [initValue]);
return ( return (
<div className="profile-upload d-flex justify-content-center align-items-center mb-3"> <div className="flex justify-center bg-surface rounded-full items-center overflow-hidden relative max-w-[100px] max-h-[100px] w-[100px] h-[100px]">
<> <div
{value === null ? ( className={`h-full w-full rounded-full flex justify-center items-center ${
<></> value ? "" : "bg-surface"
) : ( }`}
<img >
src={ <img
value.name src={
? URL.createObjectURL(value) value
: window.baseURL + "file/" + value ? value?.indexOf("data") > -1
} ? value
alt={window.t("کاربر")} : "https://iranesch.com/api/v1/file/" + value
/> : "/icons/camera-white.svg"
)} }
<input alt=""
type="file" className={`rounded-full ${
name={name} value ? "w-full object-contain " : "w-2/5 object-contain"
onChange={(e) => onChange(e.target.name, e.target.files[0])} } ${isNaN(value) ? "grayscale" : ""}`}
/> />
</> </div>
{value && (
<div className="rounded-full flex justify-center bg-surface items-center absolute right-0 bottom-0 w-7 h-7 z-20">
<img src={"/icons/camera-white.svg"} alt="camera" className="w-2/3" />
</div>
)}
<input
type="file"
name={name}
className="w-full h-full opacity-0 absolute top-0 left-0"
onChange={(e) => {
reader.readAsDataURL(e.target.files[0]);
onChange(e.target.name, e.target.files[0]);
}}
/>
</div> </div>
); );
} }
const mapStateToProps = (state) => ({
});
export default connect(mapStateToProps)(Upload);

@ -3,10 +3,12 @@ import { useNavigate } from "react-router-dom";
import onInput from "../../../utils/onInput"; import onInput from "../../../utils/onInput";
import { user, file, publicApi } from "../../../redux/actions"; import { user, file, publicApi } from "../../../redux/actions";
import { connect } from "react-redux"; import { connect } from "react-redux";
import moment from "jalali-moment";
import Select from "../../../components/Select"; import Select from "../../../components/Select";
import Input from "../../../components/Input"; import Input from "../../../components/Input";
import TextArea from "../../../components/Textarea"; import TextArea from "../../../components/Textarea";
import Button from "../../../components/Button";
import Upload from "./Upload"; import Upload from "./Upload";
import Gender from "./GenderSwitch"; import Gender from "./GenderSwitch";
import Birthdate from "./Birthdate"; import Birthdate from "./Birthdate";
@ -17,52 +19,68 @@ function Profile({
isMobile, isMobile,
profile, profile,
uploads, uploads,
uploadId,
upload,
getProvince, getProvince,
getCity, getCity,
setDone, setDone,
upload,
setProfile, setProfile,
province, province,
provinceList, provinceList,
cityList, cityList,
setHeaderOptions, setHeaderOptions,
loading,
}) { }) {
let navigate = useNavigate(); let navigate = useNavigate();
const [render, setRender] = useState(false); const [formData, setFormData] = useState(null);
const [formData, setFormData] = useState({
file: uploads["file"] || profile.picFileId || null, useEffect(() => {
picFileId: uploads["file"] || profile.picFileId || null, if (user) {
docFileIds: uploads["docFileIds"] || profile.docFileIds || "", const momentDate = moment(profile?.birthDate);
firstName: profile.firstName || "", const isValid = momentDate.isValid();
lastName: profile.lastName || "", setFormData({
password: profile.password || "", file: uploads["file"] || profile.picFileId,
username: profile.username || "", picFileId: uploads["file"] || profile.picFileId,
address: profile.address || "", docFileIds: uploads["docFileIds"] || profile.docFileIds,
email: profile.email || "", firstName: profile.firstName,
birthDate: profile.birthDate || "", lastName: profile.lastName,
gender: profile.gender || 1, password: profile.password,
status: profile.status || 1, username: profile.username,
nationalId: profile.nationalId || "", address: profile.address,
phone: profile.phone || "", email: profile.email,
schools: profile.schools || null, birthDate: {
zoneId: profile.zoneId || "", day: isValid ? moment(profile?.birthDate).format("jDD") : null,
schoolId: profile.schoolId || "", month: isValid ? moment(profile?.birthDate).format("jMM") : null,
postalCode: profile.postalCode || "", year: isValid ? moment(profile?.birthDate).format("jYYYY") : null,
gradeIds: profile.gradeIds || [], },
provinceId: profile.provinceId || null, gender: profile.gender || 1,
cityId: profile.cityId || null, status: profile.status || 1,
}); nationalId: profile.nationalId || "",
phone: profile.phone || "",
schools: profile.schools || null,
zoneId: profile.zoneId || "",
schoolId: profile.schoolId || "",
postalCode: profile.postalCode || "",
gradeIds: profile.gradeIds || [],
provinceId: profile.provinceId || null,
cityId: profile.cityId || null,
});
}
}, [user]);
useEffect(() => { useEffect(() => {
setHeaderOptions({ if (!isMobile) {
logo: true, setHeaderOptions({
hamburgerMenu: true, logo: true,
qr: true, hamburgerMenu: true,
title: false, qr: true,
back: false, title: false,
shown: true, back: false,
menu: false, shown: true,
}); menu: false,
});
}
getProvince(); getProvince();
getCity({ provinceId: profile.provinceId }); getCity({ provinceId: profile.provinceId });
}, []); }, []);
@ -135,7 +153,7 @@ function Profile({
} else if (name === "status") { } else if (name === "status") {
setFormData({ setFormData({
...formData, ...formData,
gradeIds: formData.gradeIds?.slice(0, 1) || [], gradeIds: formData?.gradeIds?.slice(0, 1) || [],
[name]: value, [name]: value,
}); });
} else if (name === "docFileIds") { } else if (name === "docFileIds") {
@ -208,7 +226,7 @@ function Profile({
<div className="mobile justify-content-center"> <div className="mobile justify-content-center">
<Upload <Upload
name="file" name="file"
value={formData.file} value={formData?.file}
onChange={onChange} onChange={onChange}
label={window.t("فایل")} label={window.t("فایل")}
/> />
@ -219,7 +237,7 @@ function Profile({
<div className="mb-2 desktop justify-content-center"> <div className="mb-2 desktop justify-content-center">
<Upload <Upload
name="file" name="file"
value={formData.file} value={formData?.file}
onChange={onChange} onChange={onChange}
label={window.t("فایل")} label={window.t("فایل")}
/> />
@ -230,9 +248,11 @@ function Profile({
label={window.t("نام")} label={window.t("نام")}
align="right" align="right"
onInput={onInput.persianOnly} onInput={onInput.persianOnly}
defaultValue={formData} value={formData?.firstName}
onChange={onChange} onChange={(name, value) =>
// ref={usernameInput} setFormData({ ...formData, [name]: value })
}
regex={(val) => val}
/> />
</div> </div>
<div className="mb-2"> <div className="mb-2">
@ -240,27 +260,34 @@ function Profile({
name="lastName" name="lastName"
label={window.t("نام نام خانوادگی")} label={window.t("نام نام خانوادگی")}
align="right" align="right"
defaultValue={formData} value={formData?.lastName}
onChange={onChange} onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
onInput={onInput.persianOnly} onInput={onInput.persianOnly}
regex={(val) => val}
/> />
</div> </div>
<div className="mb-2"> <div className="mb-2">
<Input <Input
name="username" name="username"
label={window.t("نام کاربری")} label={window.t("نام کاربری")}
defaultValue={formData} value={formData?.username}
onChange={onChange} onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
align="left" align="left"
onInput={onInput.englishAndNumberWithoutSpace} regex={(val) => onInput.englishAndNumberWithoutSpace(val)}
/> />
</div> </div>
<div className="mb-2"> <div className="mb-2">
<Gender <Gender
options={[window.t("دختر"), window.t("دانش پسر")]} options={[window.t("دختر"), window.t("پسر")]}
name="gender" name="gender"
selectedOption={formData.gender} selectedOption={formData?.gender}
onChange={onChange} onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
label="" label=""
/> />
</div> </div>
@ -270,25 +297,32 @@ function Profile({
label={window.t("کد ملی/اتباع")} label={window.t("کد ملی/اتباع")}
align="left" align="left"
maxLength={13} maxLength={13}
defaultValue={formData} value={formData?.nationalId}
onChange={onChange} onChange={(name, value) =>
onInput={onInput.numberOnly} setFormData({ ...formData, [name]: value })
}
regex={(val) => onInput.numberOnly(val)}
/> />
</div> </div>
<div className="mb-2"> <div className="mb-2">
<Birthdate <Birthdate
defaultValue={formData}
name="birthDate" name="birthDate"
onChange={onChange} onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
value={formData?.birthDate}
/> />
</div> </div>
<div className="mb-2"> <div className="mb-2">
<Input <Input
name="password" name="password"
label={window.t("رمز عبور")} label={window.t("رمز عبور")}
onChange={onChange} onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
value={formData?.password}
align="left" align="left"
onInput={onInput.englishAndNumberWithoutSpace} regex={(val) => onInput.englishAndNumberWithoutSpace(val)}
/> />
</div> </div>
</div> </div>
@ -298,37 +332,41 @@ function Profile({
options={[window.t("معلم"), window.t("دانش آموز")]} options={[window.t("معلم"), window.t("دانش آموز")]}
name="status" name="status"
label={window.t("عنوان")} label={window.t("عنوان")}
selectedOption={formData.status} selectedOption={formData?.status}
onChange={onChange} onChange={onChange}
/> />
</div> </div>
{formData.status === 1 ? ( {formData?.status === 1 ? (
<div className="mb-2"> <div className="mb-2">
<Select <Select
options={grades} options={grades}
name="gradeIds" name="gradeIds"
label={window.t("پایه تحصیلی")} label={window.t("پایه تحصیلی")}
selectedOptions={formData.gradeIds} selectedOptions={formData?.gradeIds}
onChange={onChange} onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
/> />
</div> </div>
) : null} ) : null}
{formData.status === 2 ? ( {formData?.status === 2 ? (
<div className="mb-2"> <div className="mb-2">
<MultipleSelector <MultipleSelector
options={grades} options={grades}
name="gradeIds" name="gradeIds"
label={window.t("پایه تحصیلی")} label={window.t("پایه تحصیلی")}
selectedOptions={formData.gradeIds} selectedOptions={formData?.gradeIds}
onChange={onChange} onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
align="right" align="right"
defaultValue={profile} defaultValue={profile}
/> />
</div> </div>
) : null} ) : null}
{formData.status === window.t("دانش آموز") && {formData?.status === window.t("دانش آموز") &&
formData.gradeIds > 9 ? ( formData?.gradeIds > 9 ? (
<div className="mb-2"> <div className="mb-2">
<Select <Select
options={[ options={[
@ -341,8 +379,10 @@ function Profile({
]} ]}
name="field" name="field"
label={window.t("رشته تحصیلی")} label={window.t("رشته تحصیلی")}
selectedOptions={formData.gradeIds} selectedOptions={formData?.gradeIds}
onChange={onChange} onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
/> />
</div> </div>
) : null} ) : null}
@ -351,8 +391,10 @@ function Profile({
options={provinceList} options={provinceList}
name="provinceId" name="provinceId"
label={window.t("استان")} label={window.t("استان")}
selectedOptions={formData.provinceId} selectedOptions={formData?.provinceId}
onChange={onChange} onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
/> />
</div> </div>
<div className="mb-2"> <div className="mb-2">
@ -360,36 +402,42 @@ function Profile({
options={cityList} options={cityList}
name="cityId" name="cityId"
label={window.t("شهرستان")} label={window.t("شهرستان")}
selectedOptions={formData.cityId} selectedOptions={formData?.cityId}
onChange={onChange} onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
/> />
</div> </div>
{formData.status == 1 ? ( {formData?.status == 1 ? (
<div className="mb-2"> <div className="mb-2">
<Input <Input
name="schools" name="schools"
label={window.t("نام مدرسه")} label={window.t("نام مدرسه")}
defaultValue={formData} value={formData?.schoolId}
onInput={onInput.persianOnly} regex={(val) => onInput.persianOnly(val)}
onChange={onChange} onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
/> />
</div> </div>
) : null} ) : null}
{formData.status == 2 ? ( {formData?.status == 2 ? (
<div className="mb-2"> <div className="mb-2">
<Input <Input
name="schools" name="schools"
label={window.t("محل تدریس")} label={window.t("محل تدریس")}
defaultValue={formData} defaultValue={formData}
onInput={onInput.persianOnly} regex={(val) => onInput.persianOnly(val)}
onChange={onChange} onChange={onChange}
/> />
</div> </div>
) : null} ) : null}
{formData.status == 2 ? ( {formData?.status == 2 ? (
<Document <Document
onChange={onChange} onChange={(name, value) =>
defaultValue={formData} setFormData({ ...formData, [name]: value })
}
value={formData?.docFileIds}
name="docFileIds" name="docFileIds"
/> />
) : null} ) : null}
@ -401,16 +449,18 @@ function Profile({
onChange={onChange} onChange={onChange}
maxLength={10} maxLength={10}
inputMode="numeric" inputMode="numeric"
defaultValue={formData} value={formData?.postalCode}
onInput={onInput.numberOnly} regex={(val) => onInput.numberOnly(val)}
/> />
</div> </div>
<div className="mb-2"> <div className="mb-2">
<TextArea <TextArea
placeholder={window.t("آدرس محل سکونت")} placeholder={window.t("آدرس محل سکونت")}
name="address" name="address"
defaultValue={formData} value={formData?.address}
onChange={onChange} onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
/> />
</div> </div>
<div className="profile__box--form__footer d-flex justify-content-center"> <div className="profile__box--form__footer d-flex justify-content-center">
@ -421,19 +471,106 @@ function Profile({
</main> </main>
</div> </div>
) : ( ) : (
<ul className="flex flex-col flex-1"> <div
<li className="flex gap-5"> className="flex flex-col items-center gap-5 w-full pt-5"
<div className="flex flex-col w-4/12"> onSubmit={(e) => onSubmit()}
<strong>{window.t(" اطلاعات هویتی")}</strong> >
<p> <Upload
{window.t( name="file"
" لطفا نام و نام خانوادگی خود را به طور کامل وارد نمایید" value={String(uploadId || formData?.picFileId)}
)} onChange={onChange}
</p> label="فایل"
</div> />
<div className="flex w-8/12"></div> <br />
</li> <div
</ul> className={`w-full gap-5 lg:flex lg:flex-row lg:my-2 lg:items-center flex flex-col`}
>
<Input
name="firstName"
label={window.t("نام")}
align="right"
onInput={onInput.persianOnly}
value={formData?.firstName}
onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
regex={(val) => val}
/>
<Input
name="lastName"
label="نام خانوادگی"
align="right"
onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
regex={(val) => val}
padding="py-4"
value={formData?.lastName}
/>
</div>
<div
className={`w-full flex lg:flex-row flex-col gap-5 lg:my-2 lg:items-center`}
>
<Input
name="cellphone"
label="شماره تلفن همراه"
align="left"
onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
regex={onInput.numberOnly}
value={formData?.cellphone}
maxLength={11}
direction={"ltr"}
/>
<Input
name="nationalId"
label="کدملی"
align="left"
onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
regex={onInput.numberOnly}
value={formData?.nationalId}
maxLength={10}
direction={"ltr"}
/>
</div>
<div
className={`w-full flex lg:flex-row flex-col gap-5 lg:my-2 lg:items-center`}
>
<Input
name="email"
label="ایمیل"
align="left"
onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
regex={onInput.englishAndNumberWithoutSpace}
value={formData?.email}
/>
<Birthdate
name="birthDate"
onChange={(name, value) => setProfile({ name, value })}
value={formData?.birthDate}
/>
</div>
<div
className={`w-full flex lg:flex-row flex-col gap-5 lg:my-2 lg:items-center`}
>
<Gender
options={[window.t("دختر"), window.t("پسر")]}
name="gender"
selectedOption={formData?.gender}
onChange={(name, value) =>
setFormData({ ...formData, [name]: value })
}
label=""
/>
<div className="w-full"></div>
</div>
<button onClick={() => onSubmit()}>{window.t("ذخیره")}</button>
</div>
); );
} }
@ -446,7 +583,7 @@ export default connect(
uploads: state.file.uploads, uploads: state.file.uploads,
provinceList: state.publicApi.province, provinceList: state.publicApi.province,
cityList: state.publicApi.city, cityList: state.publicApi.city,
isMobile: state.publicApi.isMobile, isMobile: state.config.device === "mobile",
}), }),
{ {
getProfile: user.getProfile, getProfile: user.getProfile,

@ -9,6 +9,7 @@ import Ticket from "../../../Contact/layouts/Ticket";
import Favorites from "../../../Favorites/index"; import Favorites from "../../../Favorites/index";
import Addresses from "./Addresses"; import Addresses from "./Addresses";
import Address from "../../../Address"; import Address from "../../../Address";
import Profile from "../../../Auth/Profile";
const views = { const views = {
orders: <Orders />, orders: <Orders />,
@ -21,14 +22,10 @@ const views = {
), ),
favorites: <Favorites />, favorites: <Favorites />,
addresses: <Addresses />, addresses: <Addresses />,
profile: <Address profilePage={true} />, profile: <Profile />,
}; };
export const Main = ({ setHeaderOptions, page }) => { export const Main = ({ setHeaderOptions, page }) => {
useEffect(() => {
setHeaderOptions({ shown: true });
}, []);
return ( return (
<div <div
className="overflow-y-scroll overflow-x-hidden flex-1 flex-shrink-0 no-scrollbar pl-5 pb-10 pt-4" className="overflow-y-scroll overflow-x-hidden flex-1 flex-shrink-0 no-scrollbar pl-5 pb-10 pt-4"

@ -14,7 +14,6 @@ function Private({ getList, products, blogs, getBlogList, grades }) {
if(blogs.length === 0){ if(blogs.length === 0){
getBlogList(); getBlogList();
} }
// console.log(getBlogList());
}, []); }, []);
return ( return (
<div className="w-full flex-1 pb-24"> <div className="w-full flex-1 pb-24">

@ -77,8 +77,7 @@ function ShoppingCart({
accept: () => payFactor({ userId: user.id }), accept: () => payFactor({ userId: user.id }),
}), }),
profile: () => { profile: () => {
console.log("Set profile"); return null;
console.log("Go to shaparak");
}, },
}; };
}, [userProducts, user]); }, [userProducts, user]);

Loading…
Cancel
Save