Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ConnectedButtonProfile } from '@hypha-platform/epics';
import { EvmProvider } from '@hypha-platform/evm';
import { useMe } from '@hypha-platform/core/client';
import { fileRouter } from '@hypha-platform/core/server';
import { MenuTop } from '@hypha-platform/ui';
import { ButtonNavItem, MenuTop } from '@hypha-platform/ui';
import { ROOT_URL } from './constants';
import { NotificationSubscriber } from '@hypha-platform/notifications/client';

Expand Down Expand Up @@ -121,23 +121,21 @@ export default async function RootLayout({
openMenuLabel={tNav('openMenu')}
closeMenuLabel={tNav('closeMenu')}
>
<ButtonNavItem
label={tNav('network')}
href={`/${locale}/network`}
/>
<ButtonNavItem
label={tNav('mySpaces')}
href={`/${locale}/my-spaces`}
/>
{isLanguageSelectVisible && <ConnectedLanguageSelect />}
<ConnectedButtonProfile
useAuthentication={useAuthentication}
useMe={useMe}
newUserRedirectPath="/profile/signup"
baseRedirectPath="/my-spaces"
navItems={[
{
label: tNav('network'),
href: `/${locale}/network`,
},
{
label: tNav('mySpaces'),
href: `/${locale}/my-spaces`,
},
]}
/>
{isLanguageSelectVisible && <ConnectedLanguageSelect />}
</MenuTop>
<NextSSRPlugin routerConfig={extractRouterConfig(fileRouter)} />
<div className="mb-auto pb-8">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useRouter, useParams, usePathname } from 'next/navigation';
import { UseAuthentication } from '@hypha-platform/authentication';
import { UseMe } from '../hooks/types';
import { useEffect, useMemo } from 'react';
import { ButtonNavItemProps } from '@hypha-platform/ui';
import { useTheme } from 'next-themes';
import { getActiveTabFromPath } from '../../common';

Expand All @@ -14,7 +13,6 @@ type ConnectedButtonProfileProps = {
useMe: UseMe;
newUserRedirectPath: string;
baseRedirectPath: string;
navItems: ButtonNavItemProps[];
};

type ErrorUser = {
Expand All @@ -30,7 +28,6 @@ export const ConnectedButtonProfile = ({
useMe,
newUserRedirectPath,
baseRedirectPath,
navItems,
}: ConnectedButtonProfileProps) => {
const {
isAuthenticated,
Expand Down Expand Up @@ -123,7 +120,6 @@ export const ConnectedButtonProfile = ({
: newUserRedirectPath
}
notificationCentrePath={notificationCentrePath}
navItems={navItems}
/>
);
};
28 changes: 1 addition & 27 deletions packages/epics/src/people/components/button-profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { PersonAvatar } from './person-avatar';
import { EthAddress } from './eth-address';
import { TrashIcon, LogOutIcon, Repeat, Shield } from 'lucide-react';
import { ButtonNavItem, ButtonNavItemProps } from '@hypha-platform/ui';
import { ButtonNavItem } from '@hypha-platform/ui';
import Link from 'next/link';
import { Person } from '@hypha-platform/core/client';
import { Text } from '@radix-ui/themes';
Expand All @@ -27,7 +27,6 @@ export type ButtonProfileProps = {
onChangeThemeMode?: () => void;
profileUrl?: string;
notificationCentrePath?: string;
navItems: ButtonNavItemProps[];
person?: Person;
resolvedTheme?: string;
};
Expand All @@ -41,7 +40,6 @@ export const ButtonProfile = ({
onDelete,
profileUrl,
notificationCentrePath,
navItems,
onChangeThemeMode,
resolvedTheme,
}: ButtonProfileProps) => {
Expand Down Expand Up @@ -69,14 +67,6 @@ export const ButtonProfile = ({
)}
</div>

{navItems.map((item) => (
<ButtonNavItem
key={item.href}
href={item.href}
label={item.label}
/>
))}

{profileUrl && (
<ButtonNavItem href={profileUrl} label={t('myProfile')} />
)}
Expand Down Expand Up @@ -127,15 +117,6 @@ export const ButtonProfile = ({

{/* Desktop */}
<div className="hidden md:flex gap-2">
<div className="flex gap-2">
{navItems.map((item) => (
<ButtonNavItem
key={item.href}
href={item.href}
label={item.label}
/>
))}
</div>
<DropdownMenu modal={false}>
<DropdownMenuTrigger>
<PersonAvatar
Expand Down Expand Up @@ -233,13 +214,6 @@ export const ButtonProfile = ({
</>
) : (
<div className="flex flex-col md:flex-row gap-8 md:gap-2">
{navItems.map((item) => (
<ButtonNavItem
key={item.href}
href={item.href}
label={item.label}
/>
))}
<Button onClick={onLogin}>{t('signIn')}</Button>
<Button
className="hidden md:flex"
Expand Down
Loading