Skip to content

Commit

Permalink
feat(admin-ui): sidebar module filter
Browse files Browse the repository at this point in the history
In this commit the feature that is implemented is that to filter the dactivated modules.

resolves: #242
  • Loading branch information
satyajittalukder committed Oct 7, 2023
1 parent 89da528 commit 6685d62
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions assets/src/components/modules/Modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ function Modules() {
const [activeModule, setActiveModule] = useState(false);
const [activeClass, setActiveClass] = useState(false);


// Get from WP data.
const { allModules } = useSelect((select) => ({
allModules: select("sgsb").getModules(),
Expand Down Expand Up @@ -214,12 +213,11 @@ function Modules() {
<h4 onClick={toggleMenuClass}>
<Image preview={false} width={18} src={widgetIcon} />
All Modules
<span className="ant-menu-title-content">
<span className="ant-menu-title-content">
{activeClass ? (
<img src={downArrowIocn} width="12" />
) : (
<img src={upArrowIocn} width="12" />

)}
</span>
</h4>
Expand All @@ -230,13 +228,15 @@ function Modules() {
>
{allModules.map((module) => {
return !module.status ? (
<li
className={module.id}
key={module.id}
onClick={handleActiveModule}
>
{module.name}
</li>
!filterActiveModules && (
<li
className={module.id}
key={module.id}
onClick={handleActiveModule}
>
{module.name}
</li>
)
) : (
<li className={module.id} key={module.id}>
<a href={`admin.php?page=sgsb-settings#/${module.id} `}>
Expand Down

0 comments on commit 6685d62

Please sign in to comment.