Sidebar
- To get the default value of sidebar type or menu style, navigate to the src/store/setting/state.tsx this file.
sidebar_type
- Property: "sidebar_type"
- Choices: "sidebar-hover", "sidebar-mini", "sidebar-soft"
- Values are in array
Example
"sidebar_type": {"value": [""]}
sidebar_menu_style
- Property: "sidebar_menu_style"
- Choices: "navs-rounded", "navs-rounded-all", " navs-pill", "navs-pill-all"
- Values are in string
Example
"sidebar_menu_style": {"value": "navs-rounded-all"}
To get the current value of the following you can use:
- first import useSelector from react-redux.
- import the selectors files from src/store/setting/selectors in your component.
- import this file as top of your component using following example code in your component.
import { useSelector } from "react-redux";
import * as SettingSelector from '../store/setting/selectors'.
- then use the following code in your component to get the current value.
sidebar_type
const sidebarType = useSelector(SettingSelector.sidebar_type)
sidebar_menu_style
const sidebarMenuStyle = useSelector(SettingSelector.sidebar_menu_style)
To use action you can use dispatch to update state.js.
- first import usedispatch from react-redux.
- import the actions files from src/store/setting/actons in your component.
- import this file as top of your component using following example code in your component.
import { useDispatch } from "react-redux";
import { theme_color } from "../../../store/setting/actions";
- then write the following code inside the function component for use of dispatch method inside your component.
const dispatch = useDispatch();
- then use the following code in your component to dispatch or change the new value of scheme.
sidebar_type
dispatch(sidebar_type(value))
sidebar_menu_style
dispatch(sidebar_menu_style(value))