reza added home search

master
RezaAshrafi77 3 years ago
parent c00b6357c8
commit 856d027bce
  1. 12
      src/App.js
  2. 291
      src/AppRouter.js
  3. 4
      src/Redux/actions/public.js
  4. 1
      src/Redux/actions/transport.js
  5. 6
      src/Redux/actions/userFactor.js
  6. 8
      src/Redux/actions/userProduct.js
  7. 2
      src/Redux/reducers/book.js
  8. 42
      src/Redux/reducers/public.js
  9. 2
      src/Redux/reducers/transport.js
  10. 7
      src/Redux/reducers/user.js
  11. 7
      src/Redux/reducers/userFactor.js
  12. 11
      src/Redux/reducers/userProduct.js
  13. 5
      src/views/AR/index.js
  14. 4
      src/views/Activation/index.js
  15. 12
      src/views/Auth/Profile/index.js
  16. 12
      src/views/Auth/index.js
  17. 2
      src/views/Blog/index.js
  18. 1
      src/views/Blogs/index.js
  19. 12
      src/views/Callback/index.js
  20. 13
      src/views/Cart/DeliveryMethod/index.js
  21. 1
      src/views/Cart/DeliveryMethod/index.scss
  22. 15
      src/views/Cart/Discount/index.js
  23. 25
      src/views/Cart/Factor/index.js
  24. 63
      src/views/Cart/Table/index.js
  25. 73
      src/views/Cart/index.js
  26. 2
      src/views/Cart/index.scss
  27. 472
      src/views/ChatRoom/Body/Emoji/index.js
  28. 25
      src/views/ChatRoom/Body/index.js
  29. 13
      src/views/ChatRoom/Drawer/index.js
  30. 7
      src/views/Contact/index.js
  31. 6
      src/views/Faq/index.js
  32. 14
      src/views/Home/HomeSearch/Select/index.js
  33. 36
      src/views/Home/HomeSearch/index.js
  34. 6
      src/views/Home/HomeSearch/index.scss
  35. 5
      src/views/Home/Membership/index.js
  36. 1
      src/views/Home/SingleBlog/index.js
  37. 1
      src/views/Home/index.js
  38. 21
      src/views/MyBooks/index.js
  39. 6
      src/views/Product/AddToCart/index.js
  40. 2
      src/views/Product/AddToCart/index.scss
  41. 30
      src/views/Product/index.js
  42. 6
      src/views/Products/List/index.js
  43. 10
      src/views/Products/index.js
  44. 1
      src/views/QR/Image/index.js
  45. 1
      src/views/QR/index.js

@ -1,4 +1,5 @@
import React, { Component } from "react";
import { ToastContainer } from "react-toastify";
import AppRouter from "./AppRouter";
import store from "./Redux/store";
import { Provider } from "react-redux";
@ -10,6 +11,17 @@ class App extends Component {
return (
<Provider store={store}>
<AppRouter />
<ToastContainer
position="top-right"
autoClose={2000}
hideProgressBar={true}
newestOnTop={true}
closeOnClick
rtl={true}
pauseOnFocusLoss
draggable
pauseOnHover
/>
</Provider>
);
}

@ -8,6 +8,7 @@ import {
} from "react-router-dom";
import { connect } from "react-redux";
import { user } from "~/Redux/actions";
import { userProduct } from "~/Redux/actions";
import proxy from "./Redux/proxy";
import Home from "./views/Home/index";
@ -35,10 +36,33 @@ class AppRouter extends Component {
constructor(props) {
super(props);
window.router = this;
this.state = {
cartControll: false,
};
}
state = {};
componentDidUpdate(prevProps, prevState) {
if (this.props.userProductList > 0) {
if (!this.state.cartControll) {
this.setState({
cartControll: true,
});
}
} else {
if (!this.state.cartControll) {
this.setState({
cartControll: true,
});
}
}
}
componentDidMount() {
this.props.getUserProductList();
}
render() {
const mobile = window.innerWidth < 1000 ? true : false;
let home = mobile ? (
@ -70,12 +94,18 @@ class AppRouter extends Component {
) : (
<Redirect
to={{
pathname: "/auth",
pathname: "/",
}}
/>
)
) : (
) : proxy.status() ? (
<Faq />
) : (
<Redirect
to={{
pathname: "/auth",
}}
/>
)}
</Route>
<Route exact path={"/contact"}>
@ -85,7 +115,7 @@ class AppRouter extends Component {
) : (
<Redirect
to={{
pathname: "/auth",
pathname: "/",
}}
/>
)
@ -93,32 +123,126 @@ class AppRouter extends Component {
<Contact />
)}
</Route>
<Route exact path={"/callback"}>
<Callback />
</Route>
<Route exact path={"/blogs"}>
{mobile ? (
proxy.status() ? (
<Blogs />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : (
<Blogs />
)}
<Blogs />
</Route>
<Route exact path={"/blogs/:id"}>
{mobile ? (
proxy.status() ? (
<Blog />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : (
<Blog />
)}
</Route>
<Route exact path={"/about"}>
{mobile ? (
proxy.status() ? (
<About />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : (
<About />
)}
</Route>
<Route exact path={"/products"}>
{mobile ? (
proxy.status() ? (
<Products />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : (
<Products />
)}
</Route>
<Route exact path={"/newProfile"}>
{mobile ? (
proxy.status() ? (
<NewProfile />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : (
<NewProfile />
)}
</Route>
<Route exact path={"/support"}>
{mobile ? (
proxy.status() ? (
<Support />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : (
<Support />
)}
</Route>
<Route exact path={"/products/digital/:id"}>
{mobile ? (
proxy.status() ? (
<Product page="digital" />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : (
<Product page="digital" />
)}
</Route>
<Route exact path={"/products/physical/:id"}>
{mobile ? (
proxy.status() ? (
<Product page="physical" />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : (
<Product page="physical" />
)}
</Route>
<Route exact path={"/qr"}>
<QR />
@ -135,22 +259,150 @@ class AppRouter extends Component {
)}
</Route>
<Route exact path={"/profile"}>
{mobile ? (
proxy.status() ? (
<Auth page={"profile"} />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : proxy.status() ? (
<Auth page={"profile"} />
) : (
<Redirect
to={{
pathname: "/auth",
}}
/>
)}
</Route>
<Route exact path={"/qr-scan"}>
{mobile ? (
proxy.status() ? (
<QRScan />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : proxy.status() ? (
<QRScan />
) : (
<Redirect
to={{
pathname: "/auth",
}}
/>
)}
</Route>
<Route exact path={"/activation"}>
{mobile ? (
proxy.status() ? (
<Activation />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : proxy.status() ? (
<Activation />
) : (
<Redirect
to={{
pathname: "/auth",
}}
/>
)}
</Route>
<Route exact path={"/chatroom"}>
{mobile ? (
proxy.status() ? (
<ChatList />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : proxy.status() ? (
<ChatList />
) : (
<Redirect
to={{
pathname: "/auth",
}}
/>
)}
</Route>
<Route exact path={"/cart"}>
{mobile ? (
proxy.status() ? (
this.props.userProductList.length > 0 ||
!this.state.cartControll ? (
<Cart />
) : (
<Redirect
to={{
pathname: "/products",
search: "cart",
}}
/>
)
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : proxy.status() ? (
!this.state.cartControll ||
this.props.userProductList.length > 0 ? (
<Cart />
) : (
<Redirect
to={{
pathname: "/products",
search: "cart",
}}
/>
)
) : (
<Redirect
to={{
pathname: "/auth",
}}
/>
)}
</Route>
<Route exact path={"/mybooks"}>
{mobile ? (
proxy.status() ? (
<MyBooks />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : proxy.status() ? (
<MyBooks />
) : (
<Redirect
to={{
pathname: "/auth",
}}
/>
)}
</Route>
<Route exact path={"/ar"}>
{mobile ? (
@ -159,17 +411,32 @@ class AppRouter extends Component {
) : (
<Redirect
to={{
pathname: "/auth",
pathname: "/",
}}
/>
)
) : (
) : proxy.status() ? (
<AR />
) : (
<Redirect
to={{
pathname: "/auth",
}}
/>
)}
</Route>
{mobile ? (
<Route exact path={"/chatroom/:id"}>
{proxy.status() ? (
{mobile ? (
proxy.status() ? (
<Chatroom />
) : (
<Redirect
to={{
pathname: "/",
}}
/>
)
) : proxy.status() ? (
<Chatroom />
) : (
<Redirect
@ -179,7 +446,6 @@ class AppRouter extends Component {
/>
)}
</Route>
) : null}
<Route path={""}>
{proxy.status() ? (
<Redirect
@ -210,7 +476,8 @@ class AppRouter extends Component {
export default connect(
(state) => ({
profile: state.user.status,
userProductList: state.userProduct.list,
// status: state.user.status,
}),
{ getProfile: user.getProfile }
{ getProfile: user.getProfile, getUserProductList: userProduct.list }
)(AppRouter);

@ -3,7 +3,7 @@ const publicApi = {
getHomeData: (data, history) => async (dispatch) =>
await proxy.get("public/homePage", data, { history, dispatch }),
getFaqList: (data, history) => async (dispatch) =>
await proxy.get("public/faq", data, { history, dispatch }),
await proxy.get("faq/list", data, { history, dispatch }),
setFaqActive: (data) => async (dispatch) =>
await dispatch({ type: "public/faq/activate", data: data }),
searchFaq: (data) => async (dispatch) =>
@ -18,6 +18,8 @@ const publicApi = {
await proxy.get("public/blogList", data, { history, dispatch }),
getBlogInfo: (data, history) => async (dispatch) =>
await proxy.get("public/blogInfo", data, { history, dispatch }),
filterNewProducts: (data, history) => async (dispatch) =>
await dispatch({ type: "public/filter", data: data }),
};
export default publicApi;

@ -26,7 +26,6 @@ const transport = {
await proxy.post("transport/setTransport", data);
await proxy.get("userFactor/info", data3, { dispatch });
await proxy.get("transport/list", data2, { dispatch });
console.log(data);
},
del:
(data = {}, data2 = {}) =>

@ -12,7 +12,11 @@ const userFactor = {
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.put("userFactor/update", data);
await proxy.get("userFactor/list", data2, { dispatch });
},
payment:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.post("userFactor/payment", data, { dispatch });
},
add:
(data = {}, data2 = {}) =>

@ -2,8 +2,9 @@ import proxy from "../proxy";
const userProduct = {
list:
(data = {}) =>
async (dispatch) =>
await proxy.get("userProduct/list", data, { dispatch }),
async (dispatch) => {
await proxy.get("userProduct/list", data, { dispatch });
},
info:
(data = {}) =>
async (dispatch) =>
@ -15,10 +16,11 @@ const userProduct = {
await proxy.get("userProduct/list", data2, { dispatch });
},
add:
(data = {}, data2 = {}) =>
(data = {}, data2 = {}, data3 = {}) =>
async (dispatch) => {
await proxy.post("userProduct/add", data, { dispatch });
await proxy.get("userProduct/list", data2, { dispatch });
await proxy.get("userFactor/info", data3, { dispatch });
},
del:
(data = {}, data2 = {}) =>

@ -1,5 +1,5 @@
const initialState = {
loading: true,
loading: false,
error: null,
list: [],
info: null,

@ -1,8 +1,9 @@
const initialState = {
homeData: [],
newProducts: [],
levels: [],
faqList: [],
loading: true,
loading: false,
error: null,
searchResult: [],
contactData: null,
@ -50,13 +51,35 @@ export default function publicApi(state = initialState, action) {
homeData: data,
};
case "public/filter":
const realList = state.homeData.filter(
const realList =
state.newProducts.length === 0
? state.homeData.filter(
(item) => item.title === "جدیدترین کتابهای دانوین"
).data;
const level = data.level;
)[0].data
: state.newProducts;
if (state.newProducts.length === 0) {
state = {
...state,
newProducts: realList,
};
console.log("here1");
}
const level = data.levels;
const search = data.search;
if (level.length > 0 || search) {
localStorage.setItem("filter", "ON");
} else {
return {
...state,
loading: false,
error: null,
homeData: state.homeData.map((item) =>
item.title === "جدیدترین کتابهای دانوین"
? { ...item, data: state.newProducts }
: { ...item }
),
newProducts: [],
};
}
let byLevelFilter = [];
if (level.length > 0) {
@ -87,7 +110,6 @@ export default function publicApi(state = initialState, action) {
const bySearchFilter = search
? byLevelFilter.filter((item1) => item1.name.indexOf(search) !== -1)
: byLevelFilter;
// if (sort === "گران ترین") {
// finalSort = bySearchFilter.sort((item1, item2) => {
// return item1.product[0].price - item2.product[0].price;
@ -95,13 +117,18 @@ export default function publicApi(state = initialState, action) {
// } else {
// finalSort = bySearchFilter;
// }
return {
...state,
loading: false,
error: null,
filterResult: bySearchFilter,
homeData: state.homeData.map((item) =>
item.title === "جدیدترین کتابهای دانوین"
? { ...item, data: bySearchFilter }
: { ...item }
),
};
case "public/faq":
case "faq/list":
return { ...state, loading: false, error: null, faqList: data };
case "public/faq/activate":
return {
@ -115,7 +142,6 @@ export default function publicApi(state = initialState, action) {
),
};
case "public/faq/search":
console.log(data);
return {
...state,
loading: false,

@ -1,6 +1,6 @@
import { toast } from "react-toastify";
const initialState = {
loading: true,
loading: false,
error: null,
list: [],
info: null,

@ -1,5 +1,5 @@
import proxy from "../proxy";
import { ToastContainer, toast } from "react-toastify";
import { toast } from "react-toastify";
const initialState = {
status: proxy.status(),
loading: false,
@ -41,13 +41,14 @@ export default function user(state = initialState, action) {
return { ...state, loading: false, mothers: data, error: null };
case "user/setProfile":
toast.success("تغییرات اعمال شد.");
setTimeout(() => {
window.location = "/";
}, 500);
return { ...state, loading: false, error: null };
/////////////
case "loading":
return { ...state, loading: true };
case "error":
toast.error(data.message);
// toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;

@ -27,16 +27,17 @@ export default function userFactor(state = initialState, action) {
case "userFactor/update":
return { ...state, loading: false, error: null };
case "userFactor/add":
console.log(data);
toast.success("درخواست شما با موفقیت انجام شد.");
return { ...state, loading: false, error: null, sum: data.payPrice };
case "userFactor/delete":
return { ...state, loading: false, error: null };
/////////////
case "userFactor/payment":
window.location.replace(data);
return { ...state, loading: false, error: null };
case "loading":
return { ...state, loading: true };
case "error":
toast.error(data.message);
// toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;

@ -7,6 +7,7 @@ const initialState = {
info: null,
sum: null,
checkEmpty: false,
hasPhysical: false,
};
export default function userProduct(state = initialState, action) {
let { type, data, message } = action;
@ -15,28 +16,32 @@ export default function userProduct(state = initialState, action) {
const checkEmpty = data.filter(
(item) => item.condition === 2 && item.product.productType === (1 || 3)
);
const hasPhysical =
data.filter((item) => item.product.productType === 2).length > 0
? true
: false;
return {
...state,
loading: false,
list: data,
checkEmpty: checkEmpty.length > 0 ? false : true,
error: null,
hasPhysical: hasPhysical,
};
case "userProduct/info":
return { ...state, loading: false, info: data, error: null };
case "userProduct/update":
return { ...state, loading: false, error: null };
case "userProduct/add":
console.log(data);
if (window.location.pathname.indexOf("products") !== -1) {
toast.success("درخواست شما با موفقیت انجام شد.");
}
return { ...state, loading: false, error: null, sum: data.payPrice };
case "userProduct/delete":
return { ...state, loading: false, error: null };
/////////////
case "loading":
return { ...state, loading: true };
case "error":
toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;

@ -21,6 +21,7 @@ const fontSize = {
class AR extends Component {
componentDidMount() {
window.scrollTo(0, 0);
this.props.getArList();
}
@ -29,7 +30,7 @@ class AR extends Component {
return (
<>
{window.innerWidth > 1000 ? (
arList ? (
arList.length > 0 ? (
<>
<div className="ar d-flex flex-column">
<Navbar />
@ -48,7 +49,7 @@ class AR extends Component {
)
) : null}
{window.innerWidth < 1000 ? (
arList ? (
arList.length ? (
<div className="mobile-ar d-flex flex-column">
<Navbar />
<BreadCrumbs />

@ -60,7 +60,7 @@ class Activation extends Component {
</div>
<form
className="activation__form d-flex"
onSubmit={() => console.log()}
// onSubmit={() => console.log()}
>
<input
id="code"
@ -121,7 +121,7 @@ class Activation extends Component {
</div>
<form
className="mobile-activation__form d-flex flex-column"
onSubmit={() => console.log()}
// onSubmit={() => console.log()}
>
<input
id="code"

@ -1,5 +1,4 @@
import React, { Component } from "react";
import { ToastContainer } from "react-toastify";
import onInput from "~/util/onInput";
import { user } from "~/Redux/actions";
import { connect } from "react-redux";
@ -489,17 +488,6 @@ class Profile extends Component {
</div>
)
) : null}
<ToastContainer
position="bottom-right"
autoClose={1500}
hideProgressBar={true}
newestOnTop={true}
closeOnClick
rtl={true}
pauseOnFocusLoss
draggable
pauseOnHover
/>
</>
);
}

@ -1,5 +1,4 @@
import React, { Component } from "react";
import { ToastContainer } from "react-toastify";
import Profile from "./Profile/index";
import Login from "./Login/index";
@ -17,17 +16,6 @@ export default class Auth extends Component {
<div className="auth d-flex">
{this.state.page === "login" ? <Login parent={this} /> : null}
{this.state.page === "profile" ? <Profile parent={this} /> : null}
<ToastContainer
position="bottom-right"
autoClose={1500}
hideProgressBar={true}
newestOnTop={true}
closeOnClick
rtl={true}
pauseOnFocusLoss
draggable
pauseOnHover
/>
</div>
);
}

@ -16,6 +16,7 @@ const maxDesktopSize = 1250;
class Blog extends Component {
componentDidMount() {
window.scrollTo(0, 0);
this.props.getBlogInfo({
id: window.location.pathname.slice(
window.location.pathname.lastIndexOf("/") + 1,
@ -123,7 +124,6 @@ export default connect(
const Identifier = (props) => {
const { data } = props;
console.log(data);
return (
<>
{data.type === "audio" ? (

@ -15,6 +15,7 @@ import "./index.scss";
class Blogs extends Component {
componentDidMount() {
window.scrollTo(0, 0);
this.props.getBlogList();
}
render() {

@ -1,7 +1,6 @@
import React, { Component } from "react";
import { connect } from "react-redux";
import { userProduct } from "~/Redux/actions";
import { ToastContainer } from "react-toastify";
import Navbar from "../Home/Navbar/index";
import Footer from "../Home/Footer/index";
@ -261,17 +260,6 @@ class Callback extends Component {
</div>
)
) : null}
<ToastContainer
position="bottom-right"
autoClose={1500}
hideProgressBar={true}
newestOnTop={true}
closeOnClick
rtl={true}
pauseOnFocusLoss
draggable
pauseOnHover
/>
</>
);
}

@ -35,9 +35,18 @@ class DeliveryMethod extends Component {
<div
className="delivery-methods d-flex justify-content-between align-items-center"
style={{
background: data.isDe ? "#ccffcc" : "white",
background: data.id === transportId ? "#ccffcc" : "white",
}}
onClick={() => parent.setState({ selectedDelivery: data })}
onClick={() =>
setTransport(
{
factorId: factorInfo.id,
transportId: data.id,
},
{},
{ id: list[0].factorId }
)
}
>
<strong style={{ fontSize: fontSize.desktop.strong }}>
{data.name}

@ -31,6 +31,7 @@
margin-top: 10px;
flex: 1;
max-width: 45%;
cursor: pointer;
h3,
strong,
span {

@ -21,10 +21,10 @@ const fontSize = {
},
};
const DiscoutCode = ({ codeId, setCodeId }) => {
const DiscoutCode = ({ codeId, setCodeId, userId, factorId }) => {
const [value, setValue] = React.useState(codeId || "");
function setOff() {
setCodeId({ codeId: value });
setCodeId({ offCodeValue: value, userId: userId, id: factorId });
}
return (
<>
@ -75,6 +75,13 @@ const DiscoutCode = ({ codeId, setCodeId }) => {
);
};
export default connect((state) => ({ codeId: state.userFactor.codeId }), {
export default connect(
(state) => ({
codeId: state.userFactor.info.codeId,
userId: state.user.status.id,
factorId: state.userFactor.info.id,
}),
{
setCodeId: userFactor.update,
})(DiscoutCode);
}
)(DiscoutCode);

@ -1,4 +1,5 @@
import React, { Component } from "react";
import { connect } from "react-redux";
import "./index.scss";
const maxDesktopSize = 1250;
@ -33,26 +34,25 @@ const Factor = (props) => {
}
return total;
};
const { factorInfo } = props;
return (
<>
{window.innerWidth < 1000 ? (
<div className="mobile-factor d-flex flex-column">
<div className="d-flex justify-content-between">
<strong>مبلغ سبد خرید</strong>
<span>{totalPrice()} تومان</span>
<span>{factorInfo.sumPrice} تومان</span>
</div>
<div className="d-flex justify-content-between">
<strong>هزینه ارسال</strong>
<span>
{props.parent.props.list.length
? props.parent.state.selectedDelivery.price
: 0}{" "}
{factorInfo.transportPrice}
تومان
</span>
</div>
<div className="d-flex justify-content-between">
<strong>میزان تخفیف</strong>
<span>{props.parent.state.discount} تومان</span>
<span>{factorInfo.offPrice} تومان</span>
</div>
</div>
) : null}
@ -63,7 +63,7 @@ const Factor = (props) => {
مبلغ سبد خرید
</strong>
<span style={{ fontSize: fontSize.desktop.span }}>
{totalPrice()} تومان
{factorInfo.sumPrice} تومان
</span>
</div>
<div className="d-flex justify-content-between">
@ -71,9 +71,7 @@ const Factor = (props) => {
هزینه ارسال
</strong>
<span style={{ fontSize: fontSize.desktop.span }}>
{props.parent.props.list.length
? props.parent.state.selectedDelivery.price
: 0}{" "}
{factorInfo.transportPrice}
تومان
</span>
</div>
@ -82,7 +80,7 @@ const Factor = (props) => {
میزان تخفیف
</strong>
<span style={{ fontSize: fontSize.desktop.span }}>
{props.parent.state.discount} تومان
{factorInfo.offPrice} تومان
</span>
</div>
</div>
@ -91,4 +89,9 @@ const Factor = (props) => {
);
};
export default Factor;
export default connect(
(state) => ({
factorInfo: state.userFactor.info,
}),
{}
)(Factor);

@ -61,7 +61,7 @@ const fontSize = {
function BasicTable(props) {
const classes = useStyles();
const { list, handleCounter, handleDelete, route } = props;
const { list, handleCounter, handleDelete, route, factorInfo } = props;
const sum = () => {
let total = 0;
for (let i = 0; i < list.length; i++) {
@ -96,13 +96,14 @@ function BasicTable(props) {
id={props.id}
handleDelete={handleDelete}
route={route}
factorInfo={factorInfo}
/>
))}
{route === "cart" ? (
{route === "cart" && factorInfo ? (
<TableRow>
<TableCell align="center">
<span style={{ color: "grey" }}>
مبلغ کل {Math.round(props.payPrice)}
مبلغ کل {factorInfo.sumPrice}
</span>
</TableCell>
<TableCell align="right" component="th" scope="row">
@ -136,15 +137,17 @@ function BasicTable(props) {
id={props.id}
handleDelete={handleDelete}
route={route}
factorInfo={factorInfo}
/>
))}
{factorInfo ? (
<TableRow>
<TableCell align="right" component="th" scope="row">
<span style={{ color: "grey" }}></span>
</TableCell>
<TableCell align="center">
<span style={{ color: "grey" }}>
مبلغ کل {Math.round(props.payPrice)}
مبلغ کل {factorInfo.sumPrice}
</span>
</TableCell>
<TableCell align="center" component="th" scope="row">
@ -154,6 +157,7 @@ function BasicTable(props) {
<span style={{ color: "grey" }}></span>
</TableCell>
</TableRow>
) : null}
</TableBody>
</Table>
</TableContainer>
@ -163,7 +167,7 @@ function BasicTable(props) {
}
const Item = (props) => {
const { data, pushToCart, handleDelete, info, id, route } = props;
const { data, pushToCart, id, route, factorInfo } = props;
return (
<>
{window.innerWidth < 1000 ? (
@ -236,11 +240,15 @@ const Item = (props) => {
<div className="mobile-cart-table-price__counter d-flex justify-content-around align-items-center">
<button
onClick={() =>
pushToCart({
pushToCart(
{
productId: data.productId,
userId: id,
count: 1,
})
},
{},
{ id: data.factorId }
)
}
style={{ fontSize: fontSize.mobile.counter.button }}
>
@ -251,11 +259,17 @@ const Item = (props) => {
</span>
<button
onClick={() =>
pushToCart({
data.count > 0
? pushToCart(
{
productId: data.productId,
userId: id,
count: -1,
})
},
{},
{ id: data.factorId }
)
: null
}
style={{ fontSize: fontSize.mobile.counter.button }}
>
@ -316,11 +330,15 @@ const Item = (props) => {
<div className="cart-item__counter--box d-flex justify-content-around align-items-center">
<button
onClick={() =>
pushToCart({
pushToCart(
{
productId: data.productId,
userId: id,
count: 1,
})
},
{},
{ id: data.factorId }
)
}
style={{ fontSize: fontSize.desktop.counter.button }}
>
@ -331,11 +349,15 @@ const Item = (props) => {
</span>
<button
onClick={() =>
pushToCart({
pushToCart(
{
productId: data.productId,
userId: id,
count: -1,
})
},
{},
{ id: data.factorId }
)
}
style={{ fontSize: fontSize.desktop.counter.button }}
>
@ -349,9 +371,23 @@ const Item = (props) => {
<DeleteOutlineOutlinedIcon
style={{ color: "#FC120A", fontSize: 30, marginLeft: 5 }}
// onClick={() => handleDelete(data.id)}
onClick={() =>
pushToCart({
productId: data.productId,
userId: id,
count: -data.count,
})
}
/>
<span
// onClick={() => handleDelete(data.id)}
onClick={() =>
pushToCart({
productId: data.productId,
userId: id,
count: -data.count,
})
}
style={{ fontSize: fontSize.desktop.delete.span }}
>
حذف
@ -369,6 +405,7 @@ export default connect(
loading: state.userProduct.loading,
info: state.book.info,
id: state.user.status.id,
factorInfo: state.userFactor.info,
}),
{ pushToCart: userProduct.add }
)(BasicTable);

@ -1,7 +1,6 @@
import React, { Component } from "react";
import { connect } from "react-redux";
import { userProduct, transport, userFactor } from "~/Redux/actions";
import { ToastContainer } from "react-toastify";
import Navbar from "../Home/Navbar/index";
import Footer from "../Home/Footer/index";
@ -44,12 +43,19 @@ class Cart extends Component {
discount: 0,
totalPrice: null,
list: this.props.list,
controlFactorInfoRepeat: true,
};
componentDidUpdate(prevProps, prevState) {
if (this.props.list.length > 0) {
if (this.props.factorInfo === null) {
if (
this.props.factorInfo === null &&
this.state.controlFactorInfoRepeat
) {
this.props.getFactorInfo({ id: this.props.list[0].factorId });
this.setState({
controlFactorInfoRepeat: false,
});
}
let wantedId; //should be zero
for (let item of this.props.list) {
@ -65,7 +71,7 @@ class Cart extends Component {
}
componentDidMount() {
this.props.getList();
window.scrollTo(0, 0);
this.props.getTransportList();
}
@ -101,11 +107,12 @@ class Cart extends Component {
};
render() {
const { list, payPrice, payMethods, factorInfo } = this.props;
const { list, payPrice, payMethods, factorInfo, userId, hasPhysical } =
this.props;
return (
<>
{window.innerWidth > 1000 ? (
list ? (
list.length > 0 ? (
<>
<div className="cart d-flex flex-column">
<Navbar />
@ -128,18 +135,28 @@ class Cart extends Component {
/>
</section>
<section className="cart__left d-flex flex-column p-3">
{hasPhysical ? (
<header className="cart__left--header d-flex flex-column">
<h2 style={{ fontSize: fontSize.desktop.h2 }}>
روشهای ارسال
</h2>
<div className="d-flex justify-content-between">
{payMethods.map((item, i) => (
<DeliveryMethod data={item} key={i} parent={this} />
<DeliveryMethod
data={item}
key={i}
parent={this}
transportId={
factorInfo ? factorInfo.transportId : null
}
/>
))}
</div>
</header>
<DiscoutCode />
<Factor parent={this} list={list} />
) : null}
{factorInfo ? <DiscoutCode /> : null}
{factorInfo ? <Factor parent={this} list={list} /> : null}
{factorInfo ? (
<div className="cart__totalPrice d-flex align-items-center justify-content-center">
<h3 style={{ fontSize: fontSize.mobile.h2 }}>
جمع کل
@ -148,13 +165,17 @@ class Cart extends Component {
</h3>
<div className="d-flex align-items-center">
<strong style={{ fontSize: fontSize.mobile.h1 }}>
{payPrice}
{factorInfo.sumPrice +
factorInfo.transportPrice -
factorInfo.offPrice}
</strong>
<span style={{ fontSize: fontSize.mobile.h3 }}>
تومان
</span>
</div>
</div>
) : null}
{/* <div className="cart__left--header d-flex flex-column mt-3">
<h2 style={{ fontSize: fontSize.desktop.h2 }}>
روشهای ارسال
@ -168,7 +189,12 @@ class Cart extends Component {
))}
</div>
</div> */}
<button className="cart__left--submit">پرداخت</button>
<button
className="cart__left--submit"
onClick={() => this.props.payFactor({ userId: userId })}
>
پرداخت
</button>
</section>
</div>
</div>
@ -184,7 +210,7 @@ class Cart extends Component {
)
) : null}
{window.innerWidth < 1000 ? (
list ? (
list.length > 0 ? (
<div className="mobile-cart d-flex flex-column">
<Navbar />
<h1 style={{ fontSize: fontSize.mobile.h1 }}>سبد خرید</h1>
@ -215,19 +241,24 @@ class Cart extends Component {
</div>
</div>
<DiscoutCode parent={this} />
<Factor parent={this} list={list} />
<div className="mobile-cart__totalPrice d-flex align-items-center justify-content-center">
{factorInfo ? <Factor parent={this} list={list} /> : null}
<div className="mobile-cart__totalPrice d-flex align-items-center justify-content-center mt-2">
<h3 style={{ fontSize: fontSize.mobile.h2 }}>
جمع کل
<br />
سبد خرید
</h3>
{factorInfo ? (
<div className="d-flex align-items-center">
<strong style={{ fontSize: fontSize.mobile.h1 }}>
{payPrice}
{factorInfo.sumPrice +
factorInfo.transportPrice -
factorInfo.offPrice}
</strong>
<span style={{ fontSize: fontSize.mobile.h3 }}>تومان</span>
</div>
) : null}
</div>
{/* <div className="mobile-cart__payMethods d-flex flex-column">
<h2 style={{ fontSize: fontSize.mobile.h2 }}>روشهای ارسال</h2>
@ -252,17 +283,6 @@ class Cart extends Component {
</div>
)
) : null}
<ToastContainer
position="bottom-right"
autoClose={1500}
hideProgressBar={true}
newestOnTop={true}
closeOnClick
rtl={true}
pauseOnFocusLoss
draggable
pauseOnHover
/>
</>
);
}
@ -274,11 +294,14 @@ export default connect(
payPrice: state.userProduct.sum,
payMethods: state.transport.list,
factorInfo: state.userFactor.info,
userId: state.user.status.id,
hasPhysical: state.userProduct.hasPhysical,
}),
{
getList: userProduct.list,
getInfo: userProduct.info,
getTransportList: transport.list,
getFactorInfo: userFactor.info,
payFactor: userFactor.payment,
}
)(Cart);

@ -2,7 +2,7 @@
width: 100vw;
max-width: 1250px;
margin: 0px auto;
padding: 0px;
padding: 0px 10px;
font-family: numeralLight;
padding-top: 85px;
&__totalPrice {

@ -1,133 +1,330 @@
import React from 'react';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import AppBar from '@material-ui/core/AppBar';
import Tabs from '@material-ui/core/Tabs';
import Tab from '@material-ui/core/Tab';
import Typography from '@material-ui/core/Typography';
import Box from '@material-ui/core/Box';
import React from "react";
import PropTypes from "prop-types";
import { makeStyles } from "@material-ui/core/styles";
import AppBar from "@material-ui/core/AppBar";
import Tabs from "@material-ui/core/Tabs";
import Tab from "@material-ui/core/Tab";
import Typography from "@material-ui/core/Typography";
import Box from "@material-ui/core/Box";
import './index.scss';
import "./index.scss";
const Smileys = [
'😃',
'😃',
'😄',
'😁',
'😆',
'😅',
'😂',
'🤣',
'🥲',
'☺',
'😊',
'😇',
'🙂',
'🙃',
'😉',
'😌',
'😍',
'🥰',
'😘',
'😗',
'😙',
'😚',
'😋',
'😛',
'😝',
'😜',
'🤪',
'🤨',
'🧐',
'🤓',
'😎',
'🥸',
'🤩',
'🥳',
'😏',
'😒',
'😞',
'😔',
'😟',
'😕',
'🙁',
'☹',
'😣',
'😖',
'😫',
'😩',
'🥺',
'😢',
'😭',
'😤',
'😠',
'😡',
'🤬',
'🤯',
'😳',
'🥵',
'🥶',
'😱',
'😨',
'😰',
'😥',
'😓',
'🤗',
'🤔',
'🤭',
'🤫',
'🤥',
'😶',
'😐',
'😑',
'😬',
'🙄',
'😯',
'😦',
'😧',
'😮',
'😲',
'🥱',
'😴',
'🤤',
'😪',
'😵',
'🤐',
'🥴',
'🤢',
'🤮',
'🤧',
'😷',
'🤒',
'🤕',
'🤑',
'🤠',
'😈',
'👿',
'👹',
'👺',
'🤡',
'💩',
'👻',
'💀',
'☠',
'👽',
'👾',
'🤖',
'🎃',
'😺',
'😸',
'😹',
'😻',
'😼',
'😽',
'🙀',
'😿',
'😾',
"😃",
"😃",
"😄",
"😁",
"😆",
"😅",
"😂",
"🤣",
"🥲",
"☺",
"😊",
"😇",
"🙂",
"🙃",
"😉",
"😌",
"😍",
"🥰",
"😘",
"😗",
"😙",
"😚",
"😋",
"😛",
"😝",
"😜",
"🤪",
"🤨",
"🧐",
"🤓",
"😎",
"🥸",
"🤩",
"🥳",
"😏",
"😒",
"😞",
"😔",
"😟",
"😕",
"🙁",
"☹",
"😣",
"😖",
"😫",
"😩",
"🥺",
"😢",
"😭",
"😤",
"😠",
"😡",
"🤬",
"🤯",
"😳",
"🥵",
"🥶",
"😱",
"😨",
"😰",
"😥",
"😓",
"🤗",
"🤔",
"🤭",
"🤫",
"🤥",
"😶",
"😐",
"😑",
"😬",
"🙄",
"😯",
"😦",
"😧",
"😮",
"😲",
"🥱",
"😴",
"🤤",
"😪",
"😵",
"🤐",
"🥴",
"🤢",
"🤮",
"🤧",
"😷",
"🤒",
"🤕",
"🤑",
"🤠",
"😈",
"👿",
"👹",
"👺",
"🤡",
"💩",
"👻",
"💀",
"☠",
"👽",
"👾",
"🤖",
"🎃",
"😺",
"😸",
"😹",
"😻",
"😼",
"😽",
"🙀",
"😿",
"😾",
];
const animals = [
'🐶', '🐱', '🐭', '🐹', '🐰', '🦊', '🐻', '🐼', '🐻', '🐨', '🐯', '🦁', '🐮', '🐷', '🐽', '🐸', '🐵', '🙈', '🙉', '🙊', '🐒', '🐔', '🐧', '🐦', '🐤', '🐣', '🐥', '🦆', '🦅', '🦉', '🦇', '🐺', '🐗', '🐴', '🦄', '🐝', '🪱', '🐛', '🦋', '🐌', '🐞', '🐜', '🪰', '🪲', '🪳', '🦟', '🦗', '🕷', '🕸', '🦂', '🐢', '🐍', '🦎', '🦖', '🦕', '🐙', '🦑', '🦐', '🦞', '🦀', '🐡', '🐠', '🐟', '🐬', '🐳', '🐋', '🦈', '🐊', '🐅', '🐆', '🦓', '🦍', '🦧', '🦣', '🐘', '🦛', '🦏', '🐪', '🐫', '🦒', '🦘', '🦬', '🐃', '🐂', '🐄', '🐎', '🐖', '🐏', '🐑', '🦙', '🐐', '🦌', '🐕', '🐩', '🦮', '🐕🦺', '🐈', '🐈⬛', '🪶', '🐓', '🦃', '🦤', '🦚', '🦜', '🦢', '🦩', '🕊', '🐇', '🦝', '🦨', '🦡', '🦫', '🦦', '🦥', '🐁', '🐀', '🐿', '🦔', '🐾', '🐉', '🐲', '🌵', '🎄', '🌲', '🌳', '🌴', '🪵', '🌱', '🌿', '☘', '🍀', '🎍', '🪴', '🎋', '🍃', '🍂', '🍁', '🍄', '🐚', '🪨', '🌾', '💐', '🌷', '🌹', '🥀', '🌺', '🌸', '🌼', '🌻', '🌞', '🌝', '🌛', '🌜', '🌚', '🌕', '🌖', '🌗', '🌘', '🌑', '🌒', '🌓', '🌔', '🌙', '🌎', '🌍', '🌏', '🪐 ', '💫', '⭐', '🌟', '✨', '⚡', '☄', '💥', '🔥', '🌪', '🌈', '☀', '🌤', '⛅', '🌥', '☁', '🌦', '🌧', '⛈', '🌩', '🌨', '❄', '☃', '⛄', '🌬', '💨', '💧', '💦', '☔', '☂', '🌊', '🌫'
"🐶",
"🐱",
"🐭",
"🐹",
"🐰",
"🦊",
"🐻",
"🐼",
"🐻",
"🐨",
"🐯",
"🦁",
"🐮",
"🐷",
"🐽",
"🐸",
"🐵",
"🙈",
"🙉",
"🙊",
"🐒",
"🐔",
"🐧",
"🐦",
"🐤",
"🐣",
"🐥",
"🦆",
"🦅",
"🦉",
"🦇",
"🐺",
"🐗",
"🐴",
"🦄",
"🐝",
"🪱",
"🐛",
"🦋",
"🐌",
"🐞",
"🐜",
"🪰",
"🪲",
"🪳",
"🦟",
"🦗",
"🕷",
"🕸",
"🦂",
"🐢",
"🐍",
"🦎",
"🦖",
"🦕",
"🐙",
"🦑",
"🦐",
"🦞",
"🦀",
"🐡",
"🐠",
"🐟",
"🐬",
"🐳",
"🐋",
"🦈",
"🐊",
"🐅",
"🐆",
"🦓",
"🦍",
"🦧",
"🦣",
"🐘",
"🦛",
"🦏",
"🐪",
"🐫",
"🦒",
"🦘",
"🦬",
"🐃",
"🐂",
"🐄",
"🐎",
"🐖",
"🐏",
"🐑",
"🦙",
"🐐",
"🦌",
"🐕",
"🐩",
"🦮",
"🐕🦺",
"🐈",
"🐈⬛",
"🪶",
"🐓",
"🦃",
"🦤",
"🦚",
"🦜",
"🦢",
"🦩",
"🕊",
"🐇",
"🦝",
"🦨",
"🦡",
"🦫",
"🦦",
"🦥",
"🐁",
"🐀",
"🐿",
"🦔",
"🐾",
"🐉",
"🐲",
"🌵",
"🎄",
"🌲",
"🌳",
"🌴",
"🪵",
"🌱",
"🌿",
"☘",
"🍀",
"🎍",
"🪴",
"🎋",
"🍃",
"🍂",
"🍁",
"🍄",
"🐚",
"🪨",
"🌾",
"💐",
"🌷",
"🌹",
"🥀",
"🌺",
"🌸",
"🌼",
"🌻",
"🌞",
"🌝",
"🌛",
"🌜",
"🌚",
"🌕",
"🌖",
"🌗",
"🌘",
"🌑",
"🌒",
"🌓",
"🌔",
"🌙",
"🌎",
"🌍",
"🌏",
"🪐 ",
"💫",
"⭐",
"🌟",
"✨",
"⚡",
"☄",
"💥",
"🔥",
"🌪",
"🌈",
"☀",
"🌤",
"⛅",
"🌥",
"☁",
"🌦",
"🌧",
"⛈",
"🌩",
"🌨",
"❄",
"☃",
"⛄",
"🌬",
"💨",
"💧",
"💦",
"☔",
"☂",
"🌊",
"🌫",
];
function TabPanel(props) {
@ -159,21 +356,21 @@ TabPanel.propTypes = {
function a11yProps(index) {
return {
id: `scrollable-force-tab-${index}`,
'aria-controls': `scrollable-force-tabpanel-${index}`,
"aria-controls": `scrollable-force-tabpanel-${index}`,
};
}
const useStyles = makeStyles((theme) => ({
root: {
flexGrow: 1,
width: '100%',
width: "100%",
backgroundColor: theme.palette.background.paper,
flexDirection: 'row-reverse'
flexDirection: "row-reverse",
},
list: {
flex: 1,
width: '100%',
flexDirection: 'row-reverse'
width: "100%",
flexDirection: "row-reverse",
},
}));
@ -184,7 +381,6 @@ export default function ScrollableTabsButtonForce(props) {
const handleChange = (event, newValue) => {
setValue(newValue);
};
console.log(props.emojies[0]);
return (
<div className={classes.root}>
<AppBar position="static" color="default">
@ -205,8 +401,15 @@ export default function ScrollableTabsButtonForce(props) {
{props.emojies.map((item) => (
<TabPanel value={value} index={item.id}>
<div className="d-flex flex-wrap">
{item.list.map((jojo,i) => (
<span value={jojo} onClick={() => props.typeText('emoji',jojo)} style={{fontSize: 24, width: 30, height:30 }} className="m-1">{jojo}</span>
{item.list.map((jojo, i) => (
<span
value={jojo}
onClick={() => props.typeText("emoji", jojo)}
style={{ fontSize: 24, width: 30, height: 30 }}
className="m-1"
>
{jojo}
</span>
))}
</div>
</TabPanel>
@ -217,8 +420,7 @@ export default function ScrollableTabsButtonForce(props) {
ScrollableTabsButtonForce.defaultProps = {
emojies: [
{ type: 'Smileys', list: Smileys, id: 0 },
{ type: 'Animals', list: animals, id: 1 },
{ type: "Smileys", list: Smileys, id: 0 },
{ type: "Animals", list: animals, id: 1 },
],
};

@ -5,7 +5,6 @@ import Keyboard from "./Keyboard";
import { RecordState } from "audio-react-recorder";
import ReactPlayer from "react-player";
import ReactAudioPlayer from "react-audio-player";
import { ToastContainer } from "react-toastify";
// import { list, send, sendKeys } from "../../../Redux/actions/message";
import { chat } from "../../../Redux/actions";
import { connect } from "react-redux";
@ -506,17 +505,6 @@ class List extends Component {
</div>
) : null}
</div>
<ToastContainer
position="top-center"
autoClose={1500}
hideProgressBar={true}
newestOnTop={true}
closeOnClick
rtl={true}
pauseOnFocusLoss
draggable
pauseOnHover
/>
</div>
) : null}
{window.innerWidth > 1000 ? (
@ -629,17 +617,6 @@ class List extends Component {
</div>
) : null}
</div>
<ToastContainer
position="top-center"
autoClose={1500}
hideProgressBar={true}
newestOnTop={true}
closeOnClick
rtl={true}
pauseOnFocusLoss
draggable
pauseOnHover
/>
</div>
) : null}
</>
@ -655,5 +632,5 @@ export default connect(
last: state.message.list.slice(-1)[0] || {},
};
},
{ info : chat.info , bio : chat.bio }
{ info: chat.info, bio: chat.bio }
)(List);

@ -1,12 +1,15 @@
import React from 'react';
import Info from '../Info/index';
import React from "react";
import Info from "../Info/index";
import './index.scss';
import "./index.scss";
export default function PersistentDrawerLeft(props) {
console.log(props.open);
return (
<div className={`custom-drawer d-flex ${props.open ? 'custom-drawer-active' : ''}`}>
<div
className={`custom-drawer d-flex ${
props.open ? "custom-drawer-active" : ""
}`}
>
<Info parent={props.parent} />
</div>
);

@ -46,11 +46,11 @@ class Contact extends Component {
}
render() {
const { contactData } = this.props;
const { contactData, loading } = this.props;
return (
<>
{window.innerWidth > 1000 ? (
contactData ? (
!loading ? (
<>
<div className="contact d-flex flex-column align-items-center">
<Navbar page={"contact"} />
@ -117,7 +117,7 @@ class Contact extends Component {
)
) : null}
{window.innerWidth < 1000 ? (
contactData ? (
!loading ? (
<div className="mobile-contact d-flex flex-column align-items-center">
<Navbar page={"contact"} />
<div className="mobile-contact__form d-flex flex-column">
@ -209,6 +209,7 @@ export default connect(
loading: state.publicApi.loading,
contactData: state.publicApi.contactData,
list: state.userProduct.list,
loading: state.publicApi.loading,
}),
{ getContactData: publicApi.getContactData, getList: userProduct.list }
)(Contact);

@ -1,4 +1,6 @@
import React, { Component } from "react";
import proxy from "~/Redux/proxy";
import { toast } from "react-toastify";
import { connect } from "react-redux";
import { publicApi } from "~/Redux/actions";
@ -83,11 +85,11 @@ class Faq extends Component {
};
render() {
const { faqList, searchResult, loading } = this.props;
const { faqList, searchResult } = this.props;
return (
<>
{window.innerWidth > 1000 ? (
!loading ? (
faqList.length > 0 ? (
<>
<div className="faq d-flex flex-column align-items-center">
<Navbar page={"faq"} />

@ -46,16 +46,20 @@ const useStyles = makeStyles((theme) => ({
export default function CustomizedSelects(props) {
const classes = useStyles();
const [age, setAge] = React.useState("");
const handleChange = (event) => {
setAge(event.target.value);
};
const { name, parent, options } = props;
return (
<div className="home-search__select mr-2">
<FormControl className={classes.margin}>
<NativeSelect
id="demo-customized-select-native"
value={age}
onChange={handleChange}
onChange={(e) =>
parent.setState({
filters: {
...parent.state.filters,
[name]: e.target.value === "همه" ? [] : [e.target.value],
},
})
}
input={<BootstrapInput />}
>
{props.options.map((item, i) => (

@ -1,12 +1,30 @@
import React, { Component } from "react";
import { connect } from "react-redux";
import { publicApi } from "~/Redux/actions";
import Select from "./Select/index";
import dropdown from "../../../assets/icons/dropdown.png";
import "./index.scss";
export default class HomeSearch extends Component {
class HomeSearch extends Component {
state = {
filters: {
levels: [],
search: null,
},
};
componentDidUpdate(prevProps, prevState) {
if (
prevState.filters.levels !== this.state.filters.levels ||
prevState.filters.search !== this.state.filters.search
) {
this.props.filterNewProducts(this.state.filters);
}
}
render() {
const { height, data } = this.props;
const { height, levels } = this.props;
return (
<div className="home-search d-flex">
<input
@ -14,9 +32,14 @@ export default class HomeSearch extends Component {
className="home-search__input d-flex"
type="text"
name="search"
onChange={(e) =>
this.setState({
filters: { ...this.state.filters, search: e.target.value },
})
}
/>
<div className="home-search__select">
<Select options={data} />
<Select options={levels} name="levels" parent={this} />
<img src={dropdown} alt="فلش" />
</div>
<button className="home-search__submit">جستجو</button>
@ -24,3 +47,10 @@ export default class HomeSearch extends Component {
);
}
}
export default connect(
(state) => ({
levels: state.publicApi.levels,
}),
{ filterNewProducts: publicApi.filterNewProducts }
)(HomeSearch);

@ -4,7 +4,7 @@
box-shadow: 0px 0px 5px rgb(200, 200, 200);
border-radius: 7px;
justify-content: space-between;
align-items:center;
align-items: center;
flex: 1;
margin-top: 20px;
font-family: numeralLight;
@ -51,7 +51,7 @@
&__select {
position: relative;
margin-left: 20px;
& img{
& img {
position: absolute;
left: 27px;
top: 12px;
@ -64,6 +64,6 @@
background-color: #7dc241;
color: white;
border-radius: 5px;
padding : 7px 50px;
padding: 7px 50px;
}
}

@ -1,8 +1,9 @@
import React, { Component } from "react";
import Input from "./Input/index";
import "./index.scss";
export default class Membership extends Component {
class Membership extends Component {
render() {
return (
<>
@ -44,3 +45,5 @@ export default class Membership extends Component {
);
}
}
export default Membership;

@ -46,7 +46,6 @@ export default class SingleBlog extends Component {
const Identifier = (props) => {
const { data } = props;
console.log(data);
return (
<>
{data.type === "audio" ? (

@ -38,6 +38,7 @@ import Loader from "~/components/Loader/index";
import "./index.scss";
class Home extends Component {
componentDidMount() {
window.scrollTo(0, 0);
if (window.innerWidth < 1000) {
this.props.getHomeData({ device: 2 });
} else {

@ -28,13 +28,15 @@ const fontSize = {
class MyBooks extends React.Component {
componentDidMount() {
this.props.getList();
window.scrollTo(0, 0);
}
render() {
const { list, checkEmpty } = this.props;
const { list, checkEmpty, loading } = this.props;
return (
<>
{window.innerWidth > 1000 ? (
!loading ? (
<>
<div className="mybooks d-flex flex-column">
<Navbar />
@ -58,8 +60,17 @@ class MyBooks extends React.Component {
</div>
<Footer />
</>
) : (
<div
className="d-flex justify-content-center align-items-center"
style={{ height: "100vh", width: "100vw" }}
>
<Loader />
</div>
)
) : null}
{window.innerWidth < 1000 ? (
!loading ? (
<>
<div className="mobile-products d-flex flex-column">
<Navbar />
@ -81,6 +92,14 @@ class MyBooks extends React.Component {
</div>
</div>
</>
) : (
<div
className="d-flex justify-content-center align-items-center"
style={{ height: "100vh", width: "100vw" }}
>
<Loader />
</div>
)
) : null}
</>
);

@ -1,4 +1,6 @@
import React, { Component } from "react";
import proxy from "~/Redux/proxy";
import { toast } from "react-toastify";
import { connect } from "react-redux";
import { userProduct } from "~/Redux/actions";
@ -72,7 +74,8 @@ function AddToCart(props) {
style={{ fontSize: fontSize.desktop.button }}
className="product-addtocart__box--addButton"
onClick={() =>
props.pushToCart({
proxy.status()
? props.pushToCart({
productId:
page === "digital"
? info.product[0].id
@ -80,6 +83,7 @@ function AddToCart(props) {
userId: props.id,
count: 1,
})
: toast.info("ابتدا وارد حساب کاربری خود شوید.")
}
>
افزودن به سبد خرید

@ -38,7 +38,7 @@
img {
position: absolute;
left: 13px;
top: 13px;
top: 10px;
transform: scale(0.9);
}
}

@ -1,5 +1,6 @@
import React, { Component } from "react";
import { ToastContainer, toast } from "react-toastify";
import { toast } from "react-toastify";
import proxy from "~/Redux/proxy";
import { Link } from "react-router-dom";
import { connect } from "react-redux";
@ -53,6 +54,7 @@ class Product extends Component {
];
componentDidMount() {
window.scrollTo(0, 0);
this.props.getInfo({
id: window.location.pathname.slice(
window.location.pathname.lastIndexOf("/") + 1,
@ -186,7 +188,8 @@ class Product extends Component {
</div>
<button
onClick={() =>
this.props.pushToCart({
proxy.status()
? this.props.pushToCart({
productId:
page === "digital"
? info.product[0].id
@ -194,6 +197,7 @@ class Product extends Component {
userId: this.props.id,
count: 1,
})
: toast.info("ابتدا وارد حساب کاربری خود شوید.")
}
className="mobile-product__header--sampleButton"
style={{ fontSize: fontSize.mobile.a }}
@ -297,17 +301,6 @@ class Product extends Component {
</div>
)
) : null}
<ToastContainer
position="top-right"
autoClose={2000}
hideProgressBar={true}
newestOnTop={true}
closeOnClick
rtl={true}
pauseOnFocusLoss
draggable
pauseOnHover
/>
</>
);
}
@ -358,17 +351,6 @@ const Identifier = (props) => {
data={props.item}
/>
) : null}
<ToastContainer
position="bottom-right"
autoClose={1500}
hideProgressBar={true}
newestOnTop={true}
closeOnClick
rtl={true}
pauseOnFocusLoss
draggable
pauseOnHover
/>
</>
);
};

@ -12,10 +12,10 @@ class List extends React.Component {
}
render() {
const { list, search, searchResult, filterResult } = this.props;
const { list, filterResult, loading } = this.props;
return window.innerWidth > 1000 ? (
<div className="products-list d-flex flex-wrap">
{list.length > 0 ? (
{!loading ? (
filterResult.length > 0 || localStorage.getItem("filter") ? (
filterResult.map((item, i) => <Product product={item} key={i} />)
) : (
@ -33,7 +33,7 @@ class List extends React.Component {
) : (
<>
<div className="mobile-products-list d-flex flex-wrap">
{list.length > 0 ? (
{!loading ? (
filterResult.length > 0 || localStorage.getItem("filter") ? (
filterResult.map((item, i) => <Product product={item} key={i} />)
) : (

@ -15,6 +15,7 @@ import Filters from "./Filters/index";
import navbarSearch from "../../assets/icons/navbarSearch.png";
import "./index.scss";
import { toast } from "react-toastify";
const maxMobileSize = 1250;
@ -54,7 +55,16 @@ class Products extends Component {
}
componentDidMount() {
window.scrollTo(0, 0);
localStorage.removeItem("filter");
if (
window.location.search.slice(
window.location.search.lastIndexOf("?") + 1,
window.location.search.length
) === "cart"
) {
toast.info("ابتدا یک محصول به سبد خریدتان اضافه کنید.");
}
}
render() {

@ -35,7 +35,6 @@ export default function QRImage(props) {
};
const closeModal = (val) => {
console.log(val);
setOpen(false);
};

@ -63,6 +63,7 @@ class QR extends Component {
};
componentDidMount() {
window.scrollTo(0, 0);
if (window.location.search) {
let tail = window.location.search.slice(
window.location.search.lastIndexOf("=") + 1,

Loading…
Cancel
Save