diff --git a/public/favicon.ico b/public/favicon.ico index a11777c..5603007 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html index 2b0023c..afc8263 100644 --- a/public/index.html +++ b/public/index.html @@ -1,45 +1,41 @@ - - - - - - - - - - - - دانوین - - -
- - - + + + + + + + + + + + + + دانوین + + + +
+ + + + \ No newline at end of file diff --git a/public/logo192.png b/public/logo192.png index fc44b0a..108171b 100644 Binary files a/public/logo192.png and b/public/logo192.png differ diff --git a/public/logo512.png b/public/logo512.png index a4e47a6..3216536 100644 Binary files a/public/logo512.png and b/public/logo512.png differ diff --git a/public/manifest.json b/public/manifest.json index 972e6e0..93d3576 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,6 +1,6 @@ { "short_name": "دانوین", - "name": "فروشگاه کتاب دانوین", + "name": " دانوین", "icons": [ { "src": "favicon.ico", @@ -25,4 +25,4 @@ "display": "standalone", "theme_color": "#000000", "background_color": "#ffffff" -} +} \ No newline at end of file diff --git a/src/AppRouter.js b/src/AppRouter.js index dd5ab02..f8061e0 100644 --- a/src/AppRouter.js +++ b/src/AppRouter.js @@ -60,7 +60,7 @@ class AppRouter extends Component { } componentDidMount() { - this.props.getUserProductList(); + //sthis.props.getUserProductList(); } render() { diff --git a/src/views/AR/index.js b/src/views/AR/index.js index ff9428c..ee449a5 100644 --- a/src/views/AR/index.js +++ b/src/views/AR/index.js @@ -1,6 +1,6 @@ import React, { Component } from "react"; import { connect } from "react-redux"; -import { publicApi } from "~/Redux/actions"; +import { userProduct } from "~/Redux/actions"; import Navbar from "../Home/Navbar/index"; import Footer from "../Home/Footer/index"; @@ -22,7 +22,7 @@ const fontSize = { class AR extends Component { componentDidMount() { window.scrollTo(0, 0); - this.props.getArList(); + // this.props.getArList({ type: 3 }); } render() { @@ -75,9 +75,9 @@ class AR extends Component { export default connect( (state) => ({ - arList: state.publicApi.arList, + arList: state.userProduct.list, }), { - getArList: publicApi.getArList, + getArList: userProduct.list, } )(AR); diff --git a/src/views/Auth/Login/Cellphone/index.scss b/src/views/Auth/Login/Cellphone/index.scss index c92dad0..8836867 100644 --- a/src/views/Auth/Login/Cellphone/index.scss +++ b/src/views/Auth/Login/Cellphone/index.scss @@ -32,10 +32,12 @@ text-align: right; position: absolute; left: 108px; - top: 23px; + top: 19px; + height: 43px; direction: ltr; color: #a5a5a5; font-family: numeralLight; + display: block; } input { font-family: numeralLight; @@ -47,7 +49,7 @@ text-align: left; background-color: #f2f2f2; border: none; - padding: 8px 5px 8px 80px; + padding: 8px 5px 8px 85px; border-radius: 5px; &:focus { outline: 0px; diff --git a/src/views/Auth/Profile/Birthdate/index.js b/src/views/Auth/Profile/Birthdate/index.js index e9e60a5..5d1720f 100644 --- a/src/views/Auth/Profile/Birthdate/index.js +++ b/src/views/Auth/Profile/Birthdate/index.js @@ -5,10 +5,11 @@ import "./index.scss"; import moment from "jalali-moment"; export default function Birthdate(props) { const { defaultValue, parent, name } = props; - const momentDate = moment(defaultValue[name]); - const day = momentDate.format("jDD"), - month = momentDate.format("jMM"), - year = momentDate.format("jYYYY"); + 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 }; diff --git a/src/views/Auth/Profile/Document/index.js b/src/views/Auth/Profile/Document/index.js index 8155384..646863c 100644 --- a/src/views/Auth/Profile/Document/index.js +++ b/src/views/Auth/Profile/Document/index.js @@ -21,7 +21,7 @@ export default function Document(props) { <> {window.innerWidth < 1000 ? (
- {parent.state.docFileIds === "" ? ( + {parent.state[name] === "" ? ( <> - - {parent.state.docFileIds.name} + + {parent.state[name].name || + "گواهی تدریس ثبت شده و درحال بررسی می باشد"} - {/* {"کاربر"} */} )}
) : null} {window.innerWidth > 1000 ? ( -
- {parent.state.file === null ? ( +
+ {parent.state[name] === "" ? ( <> parent.onChange(e.target.name, e.target.value)} - name={props.name} - defaultValue="" type="file" + // parent.onChange(e.target.name, e.target.value) + name={name} + onChange={(e) => + parent.onChange(e.target.name, e.target.files[0]) + } /> - + > + گواهی تدریس خود را آپلود کنید. + ) : ( <> parent.onChange(e.target.name, e.target.value)} + onChange={(e) => + parent.onChange(e.target.name, e.target.files[0]) + } name={props.name} defaultValue="" type="file" /> + + {parent.state[name].name || + "گواهی تدریس ثبت شده و درحال بررسی می باشد"} + )}
diff --git a/src/views/Auth/Profile/Select/index.js b/src/views/Auth/Profile/Select/index.js index a00de7d..9adf5b0 100644 --- a/src/views/Auth/Profile/Select/index.js +++ b/src/views/Auth/Profile/Select/index.js @@ -34,8 +34,8 @@ export default function CustomizedSelects(props) { > {/* 09366858119 */} {props.options.map((item, i) => ( - ))} @@ -65,8 +65,8 @@ export default function CustomizedSelects(props) { > {/* 09366858119 */} {props.options.map((item, i) => ( - ))} diff --git a/src/views/Auth/Profile/index.js b/src/views/Auth/Profile/index.js index 1647f0e..e649713 100644 --- a/src/views/Auth/Profile/index.js +++ b/src/views/Auth/Profile/index.js @@ -1,6 +1,6 @@ import React, { Component } from "react"; import onInput from "~/util/onInput"; -import { user, file } from "~/Redux/actions"; +import { user, file, publicApi } from "~/Redux/actions"; import { connect } from "react-redux"; import Select from "./Select/index"; @@ -14,8 +14,8 @@ import Loader from "~/components/Loader/index"; import Document from "./Document/index"; import logo from "../../../assets/icons/logo.png"; import pic from "../../../assets/images/pic.png"; -import { useHistory } from "react-router-dom"; import "./index.scss"; +import { useHistory } from "react-router-dom"; function Navigate({ path }) { let history = useHistory(); return <>{history.push(path)}; @@ -47,7 +47,8 @@ class Profile extends Component { file: this.props.uploads["file"] || this.props.profile.picFileId || null, picFileId: this.props.uploads["file"] || this.props.profile.picFileId || null, - docFileIds: "", + docFileIds: + this.props.uploads["docFileIds"] || this.props.profile.docFileIds || "", firstName: "", lastName: "", password: "", @@ -58,13 +59,15 @@ class Profile extends Component { gender: this.props.profile.gender || 1, status: this.props.profile.status || 1, nationalId: "", - provinceId: "", + phone: "", - cityId: "", + zoneId: "", schoolId: "", postalCode: "", gradeIds: this.props.profile.gradeIds, + provinceId: this.props.profile.provinceId, + cityId: this.props.profile.cityId, validation: { firstName: "", @@ -78,20 +81,28 @@ class Profile extends Component { }; componentDidMount() { + this.props.getProvince(); + this.props.getCity({ provinceId: this.props.profile.provinceId }); // this.props.getProfile(); } onChange = (name, value) => { - // if (name === "gradeIds" && this.state.status == 2) { - // this.setState((prevState) => ({ - // gradeIds: [...prevState.gradeIds.split(","), value], - // })); - // } else - if (name === "status") { + if (name === "provinceId") { + this.props.getCity({ provinceId: value }); + this.setState({ + cityId: null, + [name]: value, + }); + } else if (name === "status") { this.setState((prevState) => ({ gradeIds: prevState.gradeIds.slice(0, 1) || [], [name]: value, })); + } else if (name === "docFileIds") { + this.props.upload({ file: value, target: name }); + this.setState({ + [name]: value, + }); } else if (name === "file") { this.props.upload({ file: value, target: name }); this.setState({ @@ -122,6 +133,9 @@ class Profile extends Component { schools, gradeIds, status, + provinceId, + cityId, + docFileIds, } = this.state; const { profile, setProfile } = this.props; const data = { @@ -143,6 +157,11 @@ class Profile extends Component { schools: schools || profile.schools, gradeIds: String(gradeIds || profile.gradeIds), status: status || profile.status, + provinceId: provinceId || profile.provinceId, + cityId: cityId || profile.cityId, + docFileIds: String( + this.props.uploads["docFileIds"] || docFileIds || profile.docFileIds + ), }; await setProfile(data); }; @@ -294,21 +313,23 @@ class Profile extends Component { />
) : null} - + {console.log(this.props.province)}
{/*
@@ -319,7 +340,7 @@ class Profile extends Component { label={"شهر/روستا"} />
*/} - {this.state.status === "دانش آموز" ? ( + {this.state.status == 1 ? (
) : null} - {this.state.status === "معلم" ? ( + {this.state.status == 2 ? (
) : null} + {this.state.status == 2 ? ( + + ) : null}
) : null} - {this.state.status === "دانش آموز" && - Number(this.state.gradeIds) > 9 ? ( + {this.state.status == 1 && Number(this.state.gradeIds) > 9 ? ( {/* ) : null} - {this.state.status === "معلم" ? ( + {this.state.status == 2 ? ( ) : null} - {this.state.status === "معلم" ? ( + {this.state.status == 2 ? ( ) : null}
{" "} @@ -557,11 +581,15 @@ export default connect( loading: state.user.loading, uploading: state.file.loading, uploads: state.file.uploads, + provinceList: state.publicApi.province, + cityList: state.publicApi.city, }), { getProfile: user.getProfile, setProfile: user.setProfile, upload: file.upload, + getProvince: publicApi.getProvince, + getCity: publicApi.getCity, } )(Profile); diff --git a/src/views/Contact/Input/index.js b/src/views/Contact/Input/index.js index 7377b93..f3b0b0a 100644 --- a/src/views/Contact/Input/index.js +++ b/src/views/Contact/Input/index.js @@ -6,7 +6,7 @@ const useStyles = makeStyles((theme) => ({ root: { "& .MuiTextField-root": { width: "100%", - maxWidth: "400px", + // maxWidth: "400px", position: "relative", marginTop: 20, }, diff --git a/src/views/Contact/Select/index.js b/src/views/Contact/Select/index.js index 298de5c..8de8982 100644 --- a/src/views/Contact/Select/index.js +++ b/src/views/Contact/Select/index.js @@ -12,8 +12,9 @@ const BootstrapInput = withStyles((theme) => ({ }, }, input: { - width: "calc(100vw - 20px) !important", - maxWidth: "400px !important", + width: "100%", + // width: "calc(100vw - 20px) !important", + // maxWidth: "400px !important", borderRadius: 4, position: "relative", backgroundColor: theme.palette.background.paper, @@ -37,8 +38,8 @@ export default function CustomizedSelects(props) { const [age, setAge] = React.useState(""); return ( -
- +
+ diff --git a/src/views/Contact/index.js b/src/views/Contact/index.js index 47ed3c3..3adc968 100644 --- a/src/views/Contact/index.js +++ b/src/views/Contact/index.js @@ -79,7 +79,7 @@ class Contact extends Component {
آدرس

- {contactData.address} + {contactData?.address || ""}

- {contactData.cellphone} + {contactData?.cellphone || ""} تماس
- {contactData.email} + {contactData?.email || ""} خانه
diff --git a/src/views/Contact/index.scss b/src/views/Contact/index.scss index 323fae3..9d12274 100644 --- a/src/views/Contact/index.scss +++ b/src/views/Contact/index.scss @@ -89,7 +89,7 @@ } textarea { - width: 350px; + // width: 350px; font-family: numeralLight; border-radius: 10px; font-size: calc(100vw / 90); diff --git a/src/views/Home/HomeSlider/Header/index.scss b/src/views/Home/HomeSlider/Header/index.scss index 50cd155..d958ef0 100644 --- a/src/views/Home/HomeSlider/Header/index.scss +++ b/src/views/Home/HomeSlider/Header/index.scss @@ -1,95 +1,93 @@ -.slider-header{ - width : 100%; +.slider-header { + width: 100%; justify-content: flex-end; - &__right{ + &__right { width: 60%; height: 100%; - & img{ - + & img { } } - &__left{ + &__left { width: 40%; height: 100%; - justify-content : center; + justify-content: center; align-items: flex-end; padding-left: 70px; - - h1{ + + h1 { font-size: calc(100vw / 55); color: white; font-family: numeralBold; letter-spacing: -1px; } - h2{ + h2 { margin-top: 5px; font-size: calc(100vw / 78); color: white; font-family: numeralBold; } - a{ + a { text-decoration: none; color: white; margin-top: 10px; font-size: calc(100vw / 90); padding: 6px 10px; - border : 1px solid white; + border: 1px solid white; border-radius: 5px; font-family: numeralMedium; - &:hover{ + &:hover { color: white; } } } } - -.mobile-slider-header{ - width : 100%; +.mobile-slider-header { + width: 100%; justify-content: flex-end; - &__right{ - width: 50%; + &__right { + width: 0%; height: 100%; - justify-content : center; + justify-content: center; align-items: center; - & img{ + & img { position: relative; - width: 200%; + // width: 200%; height: 110%; - right: 40px; + // right: 40px; bottom: 10px; } } - &__left{ + &__left { width: 50%; height: 100%; - justify-content : center; + justify-content: center; align-items: flex-end; padding-left: 30px; - - h1{ + + h1 { font-size: calc(100vw / 37); color: white; font-family: numeralBold; } - h2{ + h2 { margin-top: 5px; font-size: calc(100vw / 48); color: white; font-family: numeralBold; } - a{ + a { text-decoration: none; color: white; margin-top: 10px; font-size: calc(100vw / 55); padding: 6px 10px; - border : 1px solid white; + border: 1px solid white; border-radius: 5px; font-family: numeralMedium; - &:hover{ + &:hover { color: white; } } } -} \ No newline at end of file +} diff --git a/src/views/Home/Navbar/Laptop/index.js b/src/views/Home/Navbar/Laptop/index.js index c747544..e563b55 100644 --- a/src/views/Home/Navbar/Laptop/index.js +++ b/src/views/Home/Navbar/Laptop/index.js @@ -7,7 +7,11 @@ import logo from "~/assets/icons/logo.png"; import basket from "~/assets/icons/basket.png"; import "./index.scss"; - +import { useHistory } from "react-router-dom"; +function Navigate({ path }) { + let history = useHistory(); + return <>{history.push(path)}; +} const maxDesktopSize = 1250; const fontSize = { @@ -18,7 +22,9 @@ const fontSize = { }; export default class LaptopNavbar extends Component { + state = {}; render() { + if (this.state.navigatePath) return ; const { links } = this.props; return (