Filtering By Grades Data Is Connected But Doesn't add Just Shows

temp
Pedram Keshavarzi 3 years ago
parent 7ead8d2a5f
commit b522fcea32
  1. 2
      src/views/Product/Desktop/ProductOverAll/index.js
  2. 5
      src/views/Products/index.js
  3. 21
      src/views/Products/layouts/Main.js
  4. 2
      src/views/Products/layouts/Sidebar.js

@ -118,7 +118,7 @@ export const ProductOverAll = ({
sendingTime={20}
numberOfSuggest={160}
profit={12000}
// showProduct
showProduct
productCat={grades[book?.gradeId]}
productImg={`https://dnvn.ir/api/v1/file/${book?.fileIds}`}
productName={type === "digital"

@ -47,6 +47,8 @@ export const Products = ({
gradeFilter(filter.grade);
}, [filter]);
const Product = ({ productsType, product, index }) => {
return (
<>
@ -148,6 +150,7 @@ export const Products = ({
/>
))
: books?.map((product, index) => (
<Product
key={index}
productsType={filter.productsType}
@ -163,7 +166,7 @@ export const Products = ({
// style={{ height: 1500 }}
>
<Sidebar onChange={onChange}/>
<Main />
<Main filter={filter}/>
</div>
)}
</div>

@ -15,17 +15,9 @@ export const Main = ({ isMobile,
selectedGrade,
gradeFilterBooks,
setHeaderOptions,
headerOptions, }) => {
const [filter, setFilter] = useState({
search: "",
grade: "",
productsType: "کتاب",
});
const [desktopContentTransform, setDesktopContentTransform] = useState(false);
headerOptions,
filter }) => {
const onChange = (name, value) => {
setFilter({ ...filter, [name]: value });
};
const filteringNavItems = [
{
@ -70,6 +62,15 @@ export const Main = ({ isMobile,
product={product}
index={Number(index)}
grades={grades}
roductName={`کتاب ${product?.name}`}
productCat={`پایه ${grades[product?.gradeId]}`}
productPrice={100000}
productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds}
numberOfRegards={160}
productTitleColor='text-blue5F'
productCatTextColor='text-blueC0'
productHolderBorder=''
productHolderHoverBorder='shadow-md'
/>
))
: books?.map((product, index) => (

@ -62,7 +62,7 @@ export const Sidebar = ({onChange}) => {
<VerticalExpandableProductFilter onChange={onChange} name="grade" preName='پایه' btnTitle='مشاهده همه ی کالاهای آموزشی' list={filteronGrade} title="پایه تحصیلی" searchAble={true}/>
<VerticalExpandableProductFilter name="category" list={categories} title="دسته بندی" searchAble={false}/>
</div>;
</div>;
};
const mapStateToProps = (state) => ({});

Loading…
Cancel
Save