simplify your stuff tabs

This commit is contained in:
Nate Kelley 2025-09-26 09:41:19 -06:00
parent e621149030
commit 6599e2a97e
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 46 additions and 49 deletions

View File

@ -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 (