mirror of https://github.com/buster-so/buster.git
simplify your stuff tabs
This commit is contained in:
parent
e621149030
commit
6599e2a97e
|
@ -42,6 +42,7 @@ import {
|
|||
useInviteModalStore,
|
||||
} from '@/context/GlobalStore/useInviteModalStore';
|
||||
import { useGetSelectedAssetTypeLoose } from '@/context/Routes/useAppRoutes';
|
||||
import { useWhyDidYouUpdate } from '@/hooks/useWhyDidYouUpdate';
|
||||
import { cn } from '@/lib/classMerge';
|
||||
import { InvitePeopleModal } from '../../modals/InvitePeopleModal';
|
||||
import { SupportModal } from '../../modals/SupportModal';
|
||||
|
@ -73,8 +74,7 @@ const topItems: ISidebarList = createSidebarList({
|
|||
],
|
||||
});
|
||||
|
||||
const yourStuff = (selectedAssetType?: AssetType): ISidebarGroup =>
|
||||
createSidebarGroup({
|
||||
const yourStuff: ISidebarGroup = createSidebarGroup({
|
||||
label: 'Your stuff',
|
||||
id: 'your-stuff',
|
||||
items: createSidebarItems(
|
||||
|
@ -116,7 +116,7 @@ const yourStuff = (selectedAssetType?: AssetType): ISidebarGroup =>
|
|||
// active: selectedAssetType === assetType,
|
||||
}))
|
||||
),
|
||||
});
|
||||
});
|
||||
|
||||
const adminTools: ISidebarGroup = createSidebarGroup({
|
||||
label: 'Admin tools',
|
||||
|
@ -167,13 +167,11 @@ const makeSidebarItems = ({
|
|||
isAdmin,
|
||||
favoritesDropdownItems,
|
||||
tryGroupMemoized,
|
||||
selectedAssetType,
|
||||
}: {
|
||||
isUserRegistered: boolean;
|
||||
isAdmin: boolean;
|
||||
favoritesDropdownItems: ISidebarGroup | null;
|
||||
tryGroupMemoized: ISidebarGroup;
|
||||
selectedAssetType?: AssetType;
|
||||
}) => {
|
||||
if (!isUserRegistered) return [];
|
||||
|
||||
|
@ -183,7 +181,7 @@ const makeSidebarItems = ({
|
|||
items.push(adminTools);
|
||||
}
|
||||
|
||||
items.push(yourStuff(selectedAssetType));
|
||||
items.push(yourStuff);
|
||||
|
||||
if (favoritesDropdownItems) {
|
||||
items.push(favoritesDropdownItems);
|
||||
|
@ -200,7 +198,7 @@ export const SidebarPrimary = React.memo(() => {
|
|||
const isUserRegistered = useIsUserRegistered();
|
||||
|
||||
const favoritesDropdownItems = useFavoriteSidebarPanel();
|
||||
const selectedAssetType = useGetSelectedAssetTypeLoose();
|
||||
// const selectedAssetType = useGetSelectedAssetTypeLoose();
|
||||
|
||||
const tryGroupMemoized = useMemo(
|
||||
() => tryGroup(!restrictNewUserInvitations),
|
||||
|
@ -212,7 +210,6 @@ export const SidebarPrimary = React.memo(() => {
|
|||
isAdmin,
|
||||
favoritesDropdownItems,
|
||||
tryGroupMemoized,
|
||||
selectedAssetType,
|
||||
});
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue