diff --git a/src/views/Products/BreadCrumb/index.js b/src/views/Products/BreadCrumb/index.js
index 94cd4c7..8575f2f 100644
--- a/src/views/Products/BreadCrumb/index.js
+++ b/src/views/Products/BreadCrumb/index.js
@@ -1,12 +1,12 @@
-import React from 'react';
-import Breadcrumbs from '@material-ui/core/Breadcrumbs';
-import {Link} from 'react-router-dom';
+import React from "react";
+import Breadcrumbs from "@material-ui/core/Breadcrumbs";
+import { Link } from "react-router-dom";
-import './index.scss';
+import "./index.scss";
function handleClick(event) {
event.preventDefault();
- console.info('You clicked a breadcrumb.');
+ console.info("You clicked a breadcrumb.");
}
const maxDesktopSize = 1250;
@@ -14,19 +14,34 @@ const maxMobileSize = 650;
const fontSize = {
desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90,
- mobile : window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 25,
+ mobile: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 25,
};
export default function ActiveLastBreadcrumb() {
return (
- 1000 ? fontSize.desktop : fontSize.mobile}} to={'/'} onClick={handleClick}>
- صفحه اصلی
+ 1000 ? fontSize.desktop : fontSize.mobile,
+ }}
+ onClick={handleClick}
+ >
+ صفحه اصلی
- 1000 ? fontSize.desktop : fontSize.mobile, color: '#00CC69'}} to="/products" onClick={handleClick}>
+ 1000 ? fontSize.desktop : fontSize.mobile,
+ color: "#00CC69",
+ }}
+
+ onClick={handleClick}
+ >
محصولات
);
}
-
diff --git a/src/views/Products/Filters/AppliedFilters/index.js b/src/views/Products/Filters/AppliedFilters/index.js
index 2c65a73..8787a15 100644
--- a/src/views/Products/Filters/AppliedFilters/index.js
+++ b/src/views/Products/Filters/AppliedFilters/index.js
@@ -7,8 +7,26 @@ const maxDesktopSize = 1250;
const fontSize = {
h2 : window.innerWidth > maxDesktopSize ? 13 : window.innerWidth / 85,
+ button: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 85,
}
export default class AppliedFilters extends React.Component {
+ delete = (name, data) => {
+ if (name === "subject") {
+ this.props.parent.setState((prevState) => ({
+ selectedFilters: {
+ ...prevState.selectedFilters,
+ subject: prevState.selectedFilters.subject.filter(item => item !== data),
+ },
+ }));
+ }else if(name === "level"){
+ this.props.parent.setState((prevState) => ({
+ selectedFilters: {
+ ...prevState.selectedFilters,
+ level: prevState.selectedFilters.level.filter(item => item !== data),
+ },
+ }));
+ }
+ };
render() {
const {data} = this.props;
return(
@@ -19,8 +37,13 @@ export default class AppliedFilters extends React.Component {
{
- data.map((item,i) => (
-
+ data.level.map((item,i) => (
+
+ ))
+ }
+ {
+ data.subject.map((item,i) => (
+
))
}
@@ -30,11 +53,11 @@ export default class AppliedFilters extends React.Component {
}
const Item = (props) => {
- const {data} = props;
+ const {data, name, parent} = props;
return(
-