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