update src/Views/Home/Sidebar/index.js and store.js

master
mahdi 3 years ago
parent ea74009e7d
commit 01fe974648
  1. 11
      src/Views/Home/Sidebar/index.js
  2. 8
      src/redux/store.js

@ -4,24 +4,21 @@ import { components } from "../../../redux/actions";
function Sidebar({ list, setActive }) { function Sidebar({ list, setActive }) {
return ( return (
<div <div className="lg:flex lg:flex-col lg:w-1/6 lg:h-full ltr">
className="lg:flex lg:flex-col lg:w-1/6 lg:h-full" <header className="w-full h-16 flex flex-row items-center py-4 px-4 bg-gray-600">
style={{ direction: "ltr" }}
>
<header className="w-full flex flex-row items-center h-16 px-1 py-4 bg-gray-700">
<img <img
src={"https://barnamenegar.ir/static/media/white logo 2.7ffbddbc.svg"} src={"https://barnamenegar.ir/static/media/white logo 2.7ffbddbc.svg"}
alt="logo" alt="logo"
className="w-full" className="w-full"
/> />
</header> </header>
<ul className="w-full flex-1 p-0 m-0 list-none divided divide-y max-h-full overflow-y-scroll divide-blue-100 border-r border-gray-200"> <ul className="w-full max-h-full flex-1 p-0 m-0 list-none divided divide-y overflow-y-scroll divide-blue-600 border-r border-gray-600">
{list {list
.sort((a, b) => (a.name > b.name ? 1 : -1)) .sort((a, b) => (a.name > b.name ? 1 : -1))
.map((material, index) => ( .map((material, index) => (
<li <li
key={index} key={index}
className="w-full py-3 px-3 font-medium text-md cursor-pointer h-12" className="w-full h-12 py-3 px-3 cursor-pointer"
onClick={() => setActive(material)} onClick={() => setActive(material)}
> >
{material.name} {material.name}

@ -3,17 +3,9 @@ import { composeWithDevTools } from "redux-devtools-extension";
import thunk from "redux-thunk"; import thunk from "redux-thunk";
import * as reducers from "./reducers"; import * as reducers from "./reducers";
// import { persistStore, persistReducer } from "redux-persist";
// import storage from "redux-persist/lib/storage"; // defaults to localStorage for web
const initialState = {}; const initialState = {};
const middleware = [thunk]; const middleware = [thunk];
// const persistConfig = {
// key: "root",
// storage,
// };
const store = createStore( const store = createStore(
combineReducers(reducers), combineReducers(reducers),
initialState, initialState,

Loading…
Cancel
Save