mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
feat(webapp): deprecate the subscription from webapp.
This commit is contained in:
@@ -4,7 +4,6 @@ import { Scrollbar } from 'react-scrollbars-custom';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import withDashboard from '@/containers/Dashboard/withDashboard';
|
||||
import withSubscriptions from '@/containers/Subscriptions/withSubscriptions';
|
||||
|
||||
import { useObserveSidebarExpendedBodyclass } from './hooks';
|
||||
import { compose } from '@/utils';
|
||||
@@ -19,9 +18,6 @@ function SidebarContainerJSX({
|
||||
|
||||
// #withDashboard
|
||||
sidebarExpended,
|
||||
|
||||
// #withSubscription
|
||||
isSubscriptionActive,
|
||||
}) {
|
||||
const sidebarScrollerRef = React.useRef();
|
||||
|
||||
@@ -51,7 +47,6 @@ function SidebarContainerJSX({
|
||||
<div
|
||||
className={classNames('sidebar', {
|
||||
'sidebar--mini-sidebar': !sidebarExpended,
|
||||
'is-subscription-inactive': !isSubscriptionActive,
|
||||
})}
|
||||
id="sidebar"
|
||||
onMouseLeave={handleSidebarMouseLeave}
|
||||
@@ -72,8 +67,4 @@ export const SidebarContainer = compose(
|
||||
withDashboard(({ sidebarExpended }) => ({
|
||||
sidebarExpended,
|
||||
})),
|
||||
withSubscriptions(
|
||||
({ isSubscriptionActive }) => ({ isSubscriptionActive }),
|
||||
'main',
|
||||
),
|
||||
)(SidebarContainerJSX);
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import { Menu } from '@blueprintjs/core';
|
||||
import * as R from 'ramda';
|
||||
|
||||
import { MenuItem, MenuItemLabel } from '@/components';
|
||||
import { ISidebarMenuItemType } from '@/containers/Dashboard/Sidebar/interfaces';
|
||||
import { useIsSidebarMenuItemActive } from './hooks';
|
||||
|
||||
import withSubscriptions from '@/containers/Subscriptions/withSubscriptions';
|
||||
|
||||
/**
|
||||
* Sidebar menu item.
|
||||
* @returns {JSX.Element}
|
||||
@@ -55,7 +52,7 @@ function SidebarMenuItemComposer({ item, index }) {
|
||||
* Sidebar menu.
|
||||
* @returns {JSX.Element}
|
||||
*/
|
||||
function SidebarMenuJSX({ menu }) {
|
||||
export function SidebarMenu({ menu }) {
|
||||
return (
|
||||
<div>
|
||||
<Menu className="sidebar-menu">
|
||||
@@ -66,10 +63,3 @@ function SidebarMenuJSX({ menu }) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export const SidebarMenu = R.compose(
|
||||
withSubscriptions(
|
||||
({ isSubscriptionActive }) => ({ isSubscriptionActive }),
|
||||
'main',
|
||||
),
|
||||
)(SidebarMenuJSX);
|
||||
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
} from './interfaces';
|
||||
import { filterValuesDeep, deepdash } from '@/utils';
|
||||
|
||||
|
||||
const deepDashConfig = {
|
||||
childrenPath: 'children',
|
||||
pathFormat: 'array',
|
||||
@@ -136,9 +135,7 @@ function useFilterSidebarMenuAbility(menu) {
|
||||
|
||||
return deepdash.filterDeep(
|
||||
menu,
|
||||
(item) => {
|
||||
return predFeature(item) && predAbility(item) && predSubscription(item);
|
||||
},
|
||||
(item) => predFeature(item) && predAbility(item),
|
||||
deepDashConfig,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user