delete 17 files and update 2 files

main
amir hosein gorji 3 years ago
parent b6501aad7f
commit 354694802d
  1. 41
      src/components/Cart/index.js
  2. 28
      src/components/products/classes/index.js
  3. 8
      src/redux/cart/card.types.js
  4. 20
      src/redux/cart/cart.actions.js
  5. 43
      src/redux/cart/cart.reducer.js
  6. 34
      src/redux/cart/cart.selectors.js
  7. 31
      src/redux/cart/cart.utils.js
  8. 44
      src/redux/directory/directory.reducer.jsx
  9. 8
      src/redux/directory/directory.selector.jsx
  10. 24
      src/redux/root-reducer.js
  11. 254
      src/redux/shop/shop.data.js
  12. 14
      src/redux/shop/shop.reducer.js
  13. 8
      src/redux/shop/shop.selectors.js
  14. 6
      src/redux/user/user.actions.js
  15. 19
      src/redux/user/user.reducer.js
  16. 9
      src/redux/user/user.selector.js
  17. 3
      src/redux/user/user.types.js
  18. 631
      src/view/services/index.js
  19. 15672
      yarn.lock

@ -1,41 +0,0 @@
import React from 'react';
import { connect } from 'react-redux';
import { createStructuredSelector } from "reselect";
import { withRouter } from 'react-router-dom';
import { selectCartItems } from "../../redux/cart/cart.selectors";
import { toggleCartHidden } from '../../redux/cart/cart.actions';
import './cart-dropdown.styles.scss';
const CartDropdown = ({ cartItems, history, dispatch }) => (
<div className='cart-dropdown'>
<div className='cart-items'>
{
cartItems.length ? (
cartItems.map(cartItem => (
<CartItem key={cartItem.id} item={cartItem}/>
))
):(
<span className='empty-message'>سبد خرید شما خالیست.</span>
)}
</div>
<center><button
onClick={() => {
history.push('/checkout');
dispatch(toggleCartHidden())
}}>
تسویه حساب
</button>
</center>
</div>
)
const mapStateToProps = createStructuredSelector({
cartItems: selectCartItems
})
export default withRouter(connect(mapStateToProps)(CartDropdown));

@ -1,28 +0,0 @@
import React from 'react';
import { connect } from 'react-redux';
import { addItem }from '../../../redux/cart/cart.actions.js';
const Class = ({item, addItem}) => {
const {name, price, imageUrl} = item;
return (
<div className="collection-item">
<img src={imageUrl} className='image'/>
<div className="collection-footer">
<span className="name"> {name} </span>
<span className="price"> {price} </span>
</div>
<button onClick={ () => addItem(item)} inverted>افزودن به سبد خرید</button>
</div>
);
}
const mapDispatchToProps = dispatch => ({
addItem: item => dispatch(addItem(item))
})
export default connect(null, mapDispatchToProps) (Class);

@ -1,8 +0,0 @@
const CartActionTypes = {
TOGGLE_CART_HIDDEN: "TOGGLE_CART_HIDDEN",
ADD_ITEM: "ADD_ITEM",
REMOVE_ITEM: "REMOVE_ITEM",
CLEAR_ITEM_FROM_CART: "CLEAR_ITEM_FROM_CART"
};
export default CartActionTypes;

@ -1,20 +0,0 @@
import CartActionTypes from './card.types'
export const toggleCartHidden = () => ({
type: CartActionTypes.TOGGLE_CART_HIDDEN
})
export const addItem = item =>({
type: CartActionTypes.ADD_ITEM,
payload: item
})
export const removeItem = item =>({
type: CartActionTypes.REMOVE_ITEM,
payload: item
})
export const clearItemFromCart = item => ({
type: CartActionTypes.CLEAR_ITEM_FROM_CART,
payload: item
})

@ -1,43 +0,0 @@
import CartActionTypes from './card.types.js';
import {addItemsToCart, removeItemFromCart} from './cart.utils.js';
const INITIAL_STATE = {
hidden: true,
cartItems: []
}
const cartReducer = (state = INITIAL_STATE, action) => {
switch (action.type){
case CartActionTypes.TOGGLE_CART_HIDDEN:
return {
...state,
hidden: !state.hidden
}
case CartActionTypes.ADD_ITEM:
return{
...state,
cartItems: addItemsToCart(state.cartItems, action.payload )
}
case CartActionTypes.REMOVE_ITEM:
return{
...state,
cartItems: removeItemFromCart(state.cartItems, action.payload)
}
case CartActionTypes.CLEAR_ITEM_FROM_CART:
return{
...state,
cartItems: state.cartItems.filter(
cartItem => cartItem.id !== action.payload.id
)
}
default:
return state;
}
}
export default cartReducer;

@ -1,34 +0,0 @@
import { createSelector } from 'reselect';
const selectCart = state => state.cart;
export const selectCartItems = createSelector(
[selectCart],
cart => cart.cartItems
)
export const selectCartHidden = createSelector(
[selectCart],
cart => cart.hidden
)
export const selectCartItemsCount = createSelector(
[selectCartItems],
cartItems =>
cartItems.reduce(
(accumulatedQuantity, cartItem) =>
accumulatedQuantity + cartItem.quantity,
0
)
)
export const selectCartTotal = createSelector(
[selectCartItems],
cartItems =>
cartItems.reduce(
(accumulatedQuantity, cartItem) =>
accumulatedQuantity + cartItem.quantity * cartItem.price,
0
)
)

@ -1,31 +0,0 @@
export const addItemsToCart = (cartItems, cartItemToAdd) => {
const existingCartItem = cartItems.find(
cartItem => cartItem.id === cartItemToAdd.id
)
if(existingCartItem){
return cartItems.map(cartItem =>
cartItem.id === cartItemToAdd.id
? { ...cartItem, quantity: cartItem.quantity + 1 }
: cartItem
)
}
return [...cartItems, { ...cartItemToAdd, quantity: 1 }]
}
export const removeItemFromCart = (cartItems, cartItemToRemove) => {
const existingCartItem = cartItems.find(
cartItem => cartItem.id === cartItemToRemove.id
)
if(existingCartItem.quantity === 1){
return cartItems.filter(cartItem => cartItem.id !== cartItemToRemove.id)
}
return cartItems.map(cartItem =>
cartItem.id === cartItemToRemove.id
? {...cartItem, quantity: cartItem.quantity -1 }
:cartItem
)
}

@ -1,44 +0,0 @@
const INITIAL_STATE = {
sections: [
{
title: "موس (موشواره)",
imageUrl: "https://www.pngkey.com/png/full/957-9575055_redragon-m908-impact-mmo-gaming-mouse-up-to.png",
id: 1,
linkUrl: "shop/hats"
},
{
title: "کیبورد",
imageUrl: "https://www.pngplay.com/wp-content/uploads/13/Gaming-Keyboard-Transparent-Free-PNG.png",
id: 2,
linkUrl: "shop/jackets"
},
{
title: "وبکم",
imageUrl: "https://www.pngkey.com/png/full/246-2465497_webcam-transparent-images-trust-exis-webcam-17003.png",
id: 3,
linkUrl: "shop/sneakers"
},
{
title: "اسپیکر",
imageUrl: "https://www.pngarts.com/files/12/Portable-Bluetooth-Speaker-Transparent-Images.png",
size: "large",
id: 4,
linkUrl: "shop/womens"
},
{
title: "مانیتور",
imageUrl: "https://static.acer.com/up/Resource/Acer/Monitors/BE0/Image/20160503/BE240Y_sku_preview.png",
size: "large",
id: 5,
linkUrl: "shop/mens"
}
]
}
const directoryReducer = (state = INITIAL_STATE, action) => {
switch(action.type){
default:
return state
}
}
export default directoryReducer

@ -1,8 +0,0 @@
import { createSelector } from 'reselect'
const selectDirectory = state => state.directory
export const selectDirectorySections = createSelector(
[selectDirectory],
directory => directory.sections
)

@ -1,24 +0,0 @@
import { combineReducers } from 'redux'
import { persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage'
import userReducer from './user/user.reducer.js'
import cartReducer from './cart/cart.reducer.js'
import directoryReducer from './directory/directory.reducer'
import shopReducer from './shop/shop.reducer'
const persistConfig = {
key: 'root',
storage,
whitelist: ['cart']
}
const rootReducer = combineReducers({
user: userReducer,
cart: cartReducer,
directory: directoryReducer,
shop: shopReducer,
})
export default persistReducer(persistConfig, rootReducer)

@ -1,254 +0,0 @@
const SHOP_DATA = [
{
id: 1,
title: "mouse",
routeName: "mouse",
items: [
{
id: 1,
name: "ماوس ریزر مدل DEATHADDER ESSENTIAL RZ01",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/114510799.jpg",
price: 73000,
adress: '/products/razor-mouse-deathadder-rz01',
description: {
content: 'لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ، و با استفاده از طراحان گرافیک است، چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است، و برای شرایط فعلی تکنولوژی مورد نیاز، و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد، کتابهای زیادی در شصت و سه درصد گذشته حال و آینده، شناخت فراوان جامعه و متخصصان را می طلبد، تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی، و فرهنگ پیشرو در زبان فارسی ایجاد کرد، در این صورت می توان امید داشت که تمام و دشواری موجود در ارائه راهکارها، و شرایط سخت تایپ به پایان رسد و زمان مورد نیاز شامل حروفچینی دستاوردهای اصلی، و جوابگوی سوالات پیوسته اهل دنیای موجود طراحی اساسا مورد استفاده قرار گیرد.',
}
},
{
id: 2,
name: "ماوس مخصوص بازی مدل V8",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/eddb26c7043d4092e17ba4e05a19f5b49f20f0dc_1633724598.jpg",
price: 290000
},
{
id: 3,
name: "ماوس مخصوص بازی زویا مدل MMR1",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/2c9f4388ced87e860a9c9d0fccc595f3b64a55a2_1610015683.jpg",
price: 210000
},
{
id: 4,
name: "ماوس مخصوص بازی تسکو مدل TSCO TM 764 GA",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/d0cc25319e2fce02acb42f679ff282b59182ed54_1597813753.jpg",
price: 186000
},
{
id: 5,
name: "ماوس مخصوص بازی مدل GM02",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/33b0985d01fe4b1ec2542bd03f3b7998e68981ed_1636141537.jpg",
price: 297270
},
{
id: 6,
name: "ماوس بی سیم ریزر مدل Basilisk Ultimate",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/81ad2dd69067d43c967ed76faf928837629ece45_1630752955.jpg",
price: 5250000
},
{
id: 7,
name: "ماوس مخصوص بازی ریزر مدل Viper Mini",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/878005cff2b58c0d0d0ac4e9ca7eaa21d3987c2c_1600681192.jpg",
price: 1460000
},
{
id: 8,
name: "ماوس تسکو مدل TM 291",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/27e2b2852f53615b577fc9130b97675cb77067ba_1628667044.jpg",
price: 83800
},
{
id: 9,
name: "ماوس آرمو مدل M25",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/4b757355ca6dcae804f34d4c6af66305903b379c_1596460030.jpg",
price: 160000
}
]
},
{
id: 2,
title: "وبکم",
routeName: "webcam",
items: [
{
id: 10,
name: "وب کم ایکس اچ سی مدل 48O",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/6f167d1f3b0aa40e19760d5f5240912e00e31dc9_1632987698.jpg",
price: '340,000'
},
{
id: 11,
name: "وب کم مدل PGR-008",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/3fa4c49aed640c53560fd32a117c7685923123db_1615139913.jpg",
price: '2,070,000'
},
{
id: 12,
name: "وب کم مایکروسافت مدل لایف کم سینما",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/32558.jpg",
price: 110
},
{
id: 13,
name: "وب کم ای فورتک مدل PK-635G",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/2190153c71b9fd3ba9f191f23fa767d8b2cd9200_1601221909.jpg",
price: '630,000'
},
{
id: 14,
name: "وب کم HD مایکروسافت مدل لایف کم HD-3000",
imageUrl: "https://dkstatics-public.digikala.com/digikala-products/15382.jpg",
price: '1,300,000'
},
// {
// id: 15,
// name: "Nike Brown High Tops",
// imageUrl: "https://i.ibb.co/fMTV342/nike-brown.png",
// price: 160
// },
// {
// id: 16,
// name: "Air Jordan Limited",
// imageUrl: "https://i.ibb.co/w4k6Ws9/nike-funky.png",
// price: 190
// },
// {
// id: 17,
// name: "Timberlands",
// imageUrl: "https://i.ibb.co/Mhh6wBg/timberlands.png",
// price: 200
// }
]
},
{
id: 3,
title: "Jackets",
routeName: "jackets",
items: [
{
id: 18,
name: "Black Jean Shearling",
imageUrl: "https://i.ibb.co/XzcwL5s/black-shearling.png",
price: 125
},
{
id: 19,
name: "Blue Jean Jacket",
imageUrl: "https://i.ibb.co/mJS6vz0/blue-jean-jacket.png",
price: 90
},
{
id: 20,
name: "Grey Jean Jacket",
imageUrl: "https://i.ibb.co/N71k1ML/grey-jean-jacket.png",
price: 90
},
{
id: 21,
name: "Brown Shearling",
imageUrl: "https://i.ibb.co/s96FpdP/brown-shearling.png",
price: 165
},
{
id: 22,
name: "Tan Trench",
imageUrl: "https://i.ibb.co/M6hHc3F/brown-trench.png",
price: 185
}
]
},
{
id: 4,
title: "Womens",
routeName: "womens",
items: [
{
id: 23,
name: "Blue Tanktop",
imageUrl: "https://i.ibb.co/7CQVJNm/blue-tank.png",
price: 25
},
{
id: 24,
name: "Floral Blouse",
imageUrl: "https://i.ibb.co/4W2DGKm/floral-blouse.png",
price: 20
},
{
id: 25,
name: "Floral Dress",
imageUrl: "https://i.ibb.co/KV18Ysr/floral-skirt.png",
price: 80
},
{
id: 26,
name: "Red Dots Dress",
imageUrl: "https://i.ibb.co/N3BN1bh/red-polka-dot-dress.png",
price: 80
},
{
id: 27,
name: "Striped Sweater",
imageUrl: "https://i.ibb.co/KmSkMbH/striped-sweater.png",
price: 45
},
{
id: 28,
name: "Yellow Track Suit",
imageUrl: "https://i.ibb.co/v1cvwNf/yellow-track-suit.png",
price: 135
},
{
id: 29,
name: "White Blouse",
imageUrl: "https://i.ibb.co/qBcrsJg/white-vest.png",
price: 20
}
]
},
{
id: 5,
title: "Mens",
routeName: "mens",
items: [
{
id: 30,
name: "Camo Down Vest",
imageUrl: "https://i.ibb.co/xJS0T3Y/camo-vest.png",
price: 325
},
{
id: 31,
name: "Floral T-shirt",
imageUrl: "https://i.ibb.co/qMQ75QZ/floral-shirt.png",
price: 20
},
{
id: 32,
name: "Black & White Longsleeve",
imageUrl: "https://i.ibb.co/55z32tw/long-sleeve.png",
price: 25
},
{
id: 33,
name: "Pink T-shirt",
imageUrl: "https://i.ibb.co/RvwnBL8/pink-shirt.png",
price: 25
},
{
id: 34,
name: "Jean Long Sleeve",
imageUrl: "https://i.ibb.co/VpW4x5t/roll-up-jean-shirt.png",
price: 40
},
{
id: 35,
name: "Burgundy T-shirt",
imageUrl: "https://i.ibb.co/mh3VM1f/polka-dot-shirt.png",
price: 25
}
]
}
];
export default SHOP_DATA;

@ -1,14 +0,0 @@
import SHOP_DATA from './shop.data';
const INITIAL_STATE = {
collections: SHOP_DATA
};
const shopReducer = (state = INITIAL_STATE, action) => {
switch (action.type) {
default:
return state;
}
};
export default shopReducer;

@ -1,8 +0,0 @@
import { createSelector } from 'reselect'
const selectShop = state => state.shop
export const selectCollections = createSelector(
[selectShop],
shop => shop.collections
);

@ -1,6 +0,0 @@
import { UserActionTypes } from './user.types.js'
export const setCurrentUser = user => ({
type: UserActionTypes.SET_CURRENT_USER,
payload: user
})

@ -1,19 +0,0 @@
import { UserActionTypes } from './user.types.js'
const INITIAL_STATE = {
currentUser: null
}
const userReducer = (state = INITIAL_STATE, action ) => {
switch(action.type){
case UserActionTypes.SET_CURRENT_USER:
return{
...state,
currentUser: action.payload
}
default:
return state;
}
}
export default userReducer;

@ -1,9 +0,0 @@
import { createSelector } from 'reselect';
const selectUser = state => state.user;
export const selectCurrentUser = createSelector(
[selectUser],
user => user.currentUser
)

@ -1,3 +0,0 @@
export const UserActionTypes = {
SET_CURRENT_USER: "SET_CURRENT_USER"
};

@ -1,9 +1,8 @@
import React, { useEffect, useState } from "react";
import Class from "../../components/products/classes";
import { book, publicApi, userProduct } from "../../redux/actions";
import { connect } from 'react-redux';
import { connect } from "react-redux";
import { Link } from "react-router-dom";
import Product from '../../components/Product';
import Product from "../../components/Product";
import img1 from "../../assets/img/Group 1344.svg";
import img2 from "../../assets/img/Group 1345.svg";
@ -16,97 +15,117 @@ import ServicePopUp from "./service";
import Games from "../dashboard2/Games";
import Packages from "../dashboard2/Packages";
const Services = ({ isMobile,
books,
getList,
grades,
gradeFilter,
selectedGrade,
gradeFilterBooks,
setHeaderOptions,
headerOptions,
videos,
pushToCart
const Services = ({
isMobile,
books,
getList,
grades,
gradeFilter,
selectedGrade,
gradeFilterBooks,
setHeaderOptions,
headerOptions,
videos,
pushToCart,
}) => {
const [checked, setChecked] = useState([false, false, false, false, false, false]);
const [filterCheck, setFilterCheck] = useState([false, false, false, false]);
const [filter, setFilter] = useState({
search: "",
grade: "",
productsType: "کتاب",
});
const [popup, setPopUp] = useState(false)
const [popUpContent, setPopUpContent] = useState({
title: '',
video: '',
description: '',
price: '',
teacher: '',
classHour: '',
classMinute: ''
})
const onChange = (name, value) => {
setFilter({ ...filter, [name]: value });
};
useEffect(() => {
getList();
setHeaderOptions(headerOptions);
}, []);
useEffect(() => {
gradeFilter(filter.grade);
}, [filter]);
const services = [
{
title: 'کلاس های آموزشی',
image: img1,
role: ''
},
{
title: 'پیش ثبت نام مدارس',
image: img2,
role: ''
},
{
title: 'بسته های آزمون',
image: img3,
role: ''
},
{
title: 'کتاب های آموزشی',
image: img4,
role: ''
},
{
title: 'دوره های مجازی',
image: img5,
role: ''
},
{
title: 'سایر خدمات',
image: img6,
role: ''
},
];
const [selectedGames, setSelectedGames] = useState([]);
const [gameId, setGameId] = useState(1);
const chooseGame = (id) => {
setGameId(id);
};
return (
<div className="flex items-start justify-between" style={{ width: '93.5%', direction: 'rtl' }}>
{popup ? <ServicePopUp content={popUpContent} closeOnClick={() => setPopUp(false)} /> : null}
<div className="w-3/4 flex flex-col justify-center " style={{ marginTop: '5.5%' }}>
<div className="relative h-48 w-full border-b border-red82OP px-10" style={{ direction: 'ltr' }}>
{/* {
const [checked, setChecked] = useState([
false,
false,
false,
false,
false,
false,
]);
const [filterCheck, setFilterCheck] = useState([false, false, false, false]);
const [filter, setFilter] = useState({
search: "",
grade: "",
productsType: "کتاب",
});
const [popup, setPopUp] = useState(false);
const [popUpContent, setPopUpContent] = useState({
title: "",
video: "",
description: "",
price: "",
teacher: "",
classHour: "",
classMinute: "",
});
const onChange = (name, value) => {
setFilter({ ...filter, [name]: value });
};
useEffect(() => {
getList();
setHeaderOptions(headerOptions);
}, []);
useEffect(() => {
gradeFilter(filter.grade);
}, [filter]);
const services = [
{
title: "کلاس های آموزشی",
image: img1,
role: "",
},
{
title: "پیش ثبت نام مدارس",
image: img2,
role: "",
},
{
title: "بسته های آزمون",
image: img3,
role: "",
},
{
title: "کتاب های آموزشی",
image: img4,
role: "",
},
{
title: "دوره های مجازی",
image: img5,
role: "",
},
{
title: "سایر خدمات",
image: img6,
role: "",
},
];
const [selectedGames, setSelectedGames] = useState([]);
const [gameId, setGameId] = useState(1);
const chooseGame = (id) => {
setGameId(id);
};
return (
<div
className="flex items-start justify-between"
style={{ width: "93.5%", direction: "rtl" }}
>
{popup ? (
<ServicePopUp
content={popUpContent}
closeOnClick={() => setPopUp(false)}
/>
) : null}
<div
className="w-3/4 flex flex-col justify-center "
style={{ marginTop: "5.5%" }}
>
<div
className="relative h-48 w-full border-b border-red82OP px-10"
style={{ direction: "ltr" }}
>
{/* {
services.map((item, index) => (
<div
className="flex flex-col justify-center items-center transition-all duration-200 m-4 rounded-xl border-2 border-red82OP hover:cursor-pointer hover:bg-pinkF5"
@ -135,182 +154,284 @@ const Services = ({ isMobile,
</div>
))
} */}
<Games
selectedGames={selectedGames}
gameId={gameId}
chooseGame={chooseGame}
<Games
selectedGames={selectedGames}
gameId={gameId}
chooseGame={chooseGame}
/>
</div>
{/* filters */}
<div className="flex mx-2 my-4 justify-center">
<div className="flex items-center ">
<svg
xmlns="http://www.w3.org/2000/svg"
width="40"
height="40"
viewBox="0 0 14.378 14.378"
>
<g
id="vuesax_linear_filter-tick"
data-name="vuesax/linear/filter-tick"
transform="translate(-620 -700)"
>
<g id="filter-tick" transform="translate(620 700)">
<path
id="Vector"
d="M5.691,2.846a2.8,2.8,0,0,1-.407,1.468A2.836,2.836,0,0,1,2.846,5.691,2.768,2.768,0,0,1,1.312,5.23a2.685,2.685,0,0,1-.9-.917A2.807,2.807,0,0,1,0,2.846,2.848,2.848,0,0,1,2.846,0a2.648,2.648,0,0,1,.623.072A2.84,2.84,0,0,1,5.691,2.846Z"
transform="translate(7.267 5.991)"
fill="none"
stroke="#696969"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="0.6"
/>
<path
id="Vector-2"
data-name="Vector"
d="M0,.7l.7.7L2.217,0"
transform="translate(9.004 8.136)"
fill="none"
stroke="#696969"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="0.6"
/>
<path
id="Vector-3"
data-name="Vector"
d="M0,0H14.378V14.378H0Z"
transform="translate(14.378 14.378) rotate(180)"
fill="none"
opacity="0"
/>
<g id="Group" transform="translate(1.983 1.198)">
<path
id="Vector-4"
data-name="Vector"
d="M10.412,1.21V2.54a2.292,2.292,0,0,1-.605,1.4l-1.054.929a2.648,2.648,0,0,0-.623-.072A2.848,2.848,0,0,0,5.284,7.638,2.807,2.807,0,0,0,5.7,9.106a2.685,2.685,0,0,0,.9.917v.2a1.336,1.336,0,0,1-.545,1.03l-.845.545a1.233,1.233,0,0,1-1.875-1.03V7.567A2.342,2.342,0,0,0,2.846,6.3l-2.3-2.42A2.041,2.041,0,0,1,0,2.666V1.27A1.229,1.229,0,0,1,1.21,0H9.2A1.215,1.215,0,0,1,10.412,1.21Z"
fill="none"
stroke="#696969"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="0.6"
/>
</div>
{/* filters */}
<div className="flex mx-2 my-4 justify-center">
<div className="flex items-center ">
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 14.378 14.378">
<g id="vuesax_linear_filter-tick" data-name="vuesax/linear/filter-tick" transform="translate(-620 -700)">
<g id="filter-tick" transform="translate(620 700)">
<path id="Vector" d="M5.691,2.846a2.8,2.8,0,0,1-.407,1.468A2.836,2.836,0,0,1,2.846,5.691,2.768,2.768,0,0,1,1.312,5.23a2.685,2.685,0,0,1-.9-.917A2.807,2.807,0,0,1,0,2.846,2.848,2.848,0,0,1,2.846,0a2.648,2.648,0,0,1,.623.072A2.84,2.84,0,0,1,5.691,2.846Z" transform="translate(7.267 5.991)" fill="none" stroke="#696969" stroke-linecap="round" stroke-linejoin="round" stroke-width="0.6" />
<path id="Vector-2" data-name="Vector" d="M0,.7l.7.7L2.217,0" transform="translate(9.004 8.136)" fill="none" stroke="#696969" stroke-linecap="round" stroke-linejoin="round" stroke-width="0.6" />
<path id="Vector-3" data-name="Vector" d="M0,0H14.378V14.378H0Z" transform="translate(14.378 14.378) rotate(180)" fill="none" opacity="0" />
<g id="Group" transform="translate(1.983 1.198)">
<path id="Vector-4" data-name="Vector" d="M10.412,1.21V2.54a2.292,2.292,0,0,1-.605,1.4l-1.054.929a2.648,2.648,0,0,0-.623-.072A2.848,2.848,0,0,0,5.284,7.638,2.807,2.807,0,0,0,5.7,9.106a2.685,2.685,0,0,0,.9.917v.2a1.336,1.336,0,0,1-.545,1.03l-.845.545a1.233,1.233,0,0,1-1.875-1.03V7.567A2.342,2.342,0,0,0,2.846,6.3l-2.3-2.42A2.041,2.041,0,0,1,0,2.666V1.27A1.229,1.229,0,0,1,1.21,0H9.2A1.215,1.215,0,0,1,10.412,1.21Z" fill="none" stroke="#696969" stroke-linecap="round" stroke-linejoin="round" stroke-width="0.6" />
</g>
</g>
</g>
</svg>
</div>
<div className="flex items-center mx-4 pl-6 border-l-2 border-gray-300">
<div
className={`flex w-32 border-2 p-2 mx-2 justify-center items-center rounded-md cursor-pointer
</g>
</g>
</g>
</svg>
</div>
<div className="flex items-center mx-4 pl-6 border-l-2 border-gray-300">
<div
className={`flex w-32 border-2 p-2 mx-2 justify-center items-center rounded-md cursor-pointer
hover:border-red52 hover:text-red52 hover:bg-pinkF5
${filterCheck[0] ? 'border-red52 text-red52 bg-pinkF5' : 'border-gray200 text-gray-400'}`}
onClick={prevState => setFilterCheck([...prevState, filterCheck[0] = !filterCheck[0]])}
>
<h3>آنلاین</h3>
{
filterCheck[0] && <div className="flex w-full" style={{ direction: 'ltr' }}>
<div className="w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52">
<svg width="37" height="37" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.75 12L10.58 14.83L16.25 9.17004" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</div>
</div>
}
</div>
<div className={`flex w-32 border-2 p-2 mx-2 justify-center items-center rounded-md cursor-pointer hover:border-red52 hover:text-red52 hover:bg-pinkF5 ${filterCheck[1] ? 'border-red52 text-red52 bg-pinkF5' : 'border-gray200 text-gray-400'}`}>
<h3>حضوری</h3>
{
filterCheck[1] && <div className="flex w-full" style={{ direction: 'ltr' }}>
<div className="w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52">
<svg width="37" height="37" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.75 12L10.58 14.83L16.25 9.17004" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</div>
</div>
}
</div>
</div>
<div className="flex items-center mx-4 pl-6 border-l-2 border-gray-300">
<div className={`flex w-32 border-2 p-2 mx-2 justify-center items-center rounded-md cursor-pointer hover:border-red52 hover:text-red52 hover:bg-pinkF5 ${filterCheck[2] ? 'border-red52 text-red52 bg-pinkF5' : 'border-gray200 text-gray-400'}`}>
<h3>دختران</h3>
{
filterCheck[2] && <div className="flex w-full" style={{ direction: 'ltr' }}>
<div className="w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52">
<svg width="37" height="37" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.75 12L10.58 14.83L16.25 9.17004" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</div>
</div>
}
</div>
<div className={`flex w-32 border-2 p-2 mx-2 justify-center items-center rounded-md cursor-pointer hover:border-red52 hover:text-red52 hover:bg-pinkF5 ${filterCheck[3] ? 'border-red52 text-red52 bg-pinkF5' : 'border-gray200 text-gray-400'}`}>
<h3>پسران</h3>
{
filterCheck[3] && <div className="flex w-full" style={{ direction: 'ltr' }}>
<div className="w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52">
<svg width="37" height="37" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.75 12L10.58 14.83L16.25 9.17004" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</div>
</div>
}
</div>
</div>
<div className="flex items-center mx-4 pl-6">
<select className="bg-white border border-solid border-gray-300 w-72 p-3 rounded-lg text-gray-400 outline-red52">
{services.map((item, index) => (
<option key={`Grade__${index}`}>{item.title}</option>
))}
</select>
</div>
${
filterCheck[0]
? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400"
}`}
onClick={(prevState) =>
setFilterCheck([
...prevState,
(filterCheck[0] = !filterCheck[0]),
])
}
>
<h3>آنلاین</h3>
{filterCheck[0] && (
<div className="flex w-full" style={{ direction: "ltr" }}>
<div className="w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52">
<svg
width="37"
height="37"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.75 12L10.58 14.83L16.25 9.17004"
stroke="#fff"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</div>
<div className={`flex ${gameId == 2 && 'flex-col'} items-center w-full justify-center flex-wrap `} >
{books?.map((product, index) => (
<Link
// to={"/class/" + product?.id}
to='#'
onClick={() => {
setPopUpContent({
title: product?.name,
video: '',
teacher: product.vodTeacher,
description: 'در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت',
price: product.product[0].price,
classHour: 21,
classMinute: 56
})
setPopUp(true);
}}
>
{/* {console.log(product)} */}
<Product
key={index}
productsType={filter.productsType}
product={product}
index={Number(index)}
productName={`${product?.name}`}
productCat={`پایه ${grades[product?.gradeId]}`}
productPrice={product.product[0].price}
// productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds}
numberOfRegards={160}
productHolderBorder=''
productHolderHoverBorder='shadow-md'
teacher={product.vodTeacher}
catId={gameId}
btnOnClick={() =>
pushToCart({
productId: product?.productId,
userId: product?.userId,
count: 1,
})}
/>
</Link>
))}
)}
</div>
<div
className={`flex w-32 border-2 p-2 mx-2 justify-center items-center rounded-md cursor-pointer hover:border-red52 hover:text-red52 hover:bg-pinkF5 ${
filterCheck[1]
? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400"
}`}
>
<h3>حضوری</h3>
{filterCheck[1] && (
<div className="flex w-full" style={{ direction: "ltr" }}>
<div className="w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52">
<svg
width="37"
height="37"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.75 12L10.58 14.83L16.25 9.17004"
stroke="#fff"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</div>
)}
</div>
<div className="w-1/4 fixed left-0" style={{ height: '100vh' }}>
<ShoppingCart />
</div>
<div className="flex items-center mx-4 pl-6 border-l-2 border-gray-300">
<div
className={`flex w-32 border-2 p-2 mx-2 justify-center items-center rounded-md cursor-pointer hover:border-red52 hover:text-red52 hover:bg-pinkF5 ${
filterCheck[2]
? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400"
}`}
>
<h3>دختران</h3>
{filterCheck[2] && (
<div className="flex w-full" style={{ direction: "ltr" }}>
<div className="w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52">
<svg
width="37"
height="37"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.75 12L10.58 14.83L16.25 9.17004"
stroke="#fff"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</div>
)}
</div>
<div
className={`flex w-32 border-2 p-2 mx-2 justify-center items-center rounded-md cursor-pointer hover:border-red52 hover:text-red52 hover:bg-pinkF5 ${
filterCheck[3]
? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400"
}`}
>
<h3>پسران</h3>
{filterCheck[3] && (
<div className="flex w-full" style={{ direction: "ltr" }}>
<div className="w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52">
<svg
width="37"
height="37"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.75 12L10.58 14.83L16.25 9.17004"
stroke="#fff"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</div>
)}
</div>
</div>
<div className="flex items-center mx-4 pl-6">
<select className="bg-white border border-solid border-gray-300 w-72 p-3 rounded-lg text-gray-400 outline-red52">
{services.map((item, index) => (
<option key={`Grade__${index}`}>{item.title}</option>
))}
</select>
</div>
</div>
<div
className={`flex ${
gameId == 2 && "flex-col"
} items-center w-full justify-center flex-wrap `}
>
{books?.map((product, index) => (
<Link
// to={"/class/" + product?.id}
to="#"
onClick={() => {
setPopUpContent({
title: product?.name,
video: "",
teacher: product.vodTeacher,
description:
"در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت",
price: product.product[0].price,
classHour: 21,
classMinute: 56,
});
setPopUp(true);
}}
>
{/* {console.log(product)} */}
<Product
key={index}
productsType={filter.productsType}
product={product}
index={Number(index)}
productName={`${product?.name}`}
productCat={`پایه ${grades[product?.gradeId]}`}
productPrice={product.product[0].price}
// productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds}
numberOfRegards={160}
productHolderBorder=""
productHolderHoverBorder="shadow-md"
teacher={product.vodTeacher}
catId={gameId}
btnOnClick={() =>
pushToCart({
productId: product?.productId,
userId: product?.userId,
count: 1,
})
}
/>
</Link>
))}
</div>
);
</div>
<div className="w-1/4 fixed left-0" style={{ height: "100vh" }}>
<ShoppingCart />
</div>
</div>
);
};
const mapStateToProps = (state) => ({
isDark: state.publicApi.isDark,
isMobile: state.publicApi.isMobile,
books: state.book.list,
grades: state.publicApi.grades,
gradeFilterBooks: state.book.gradeFilterBooks,
selectedGrade: state.book.selectedGrade,
isDark: state.publicApi.isDark,
isMobile: state.publicApi.isMobile,
books: state.book.list,
grades: state.publicApi.grades,
gradeFilterBooks: state.book.gradeFilterBooks,
selectedGrade: state.book.selectedGrade,
});
const mapDispatchToProps = {
getList: book.list,
gradeFilter: book.gradeFilter,
setHeaderOptions: publicApi.setHeaderOptions,
pushToCart: userProduct.add,
getList: book.list,
gradeFilter: book.gradeFilter,
setHeaderOptions: publicApi.setHeaderOptions,
pushToCart: userProduct.add,
};
export default connect(mapStateToProps, mapDispatchToProps)(Services);

15672
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save