Remove extra options for signed-out users
This commit is contained in:
parent
4b1f3432d6
commit
d6d6631e2b
|
@ -4,39 +4,24 @@ import { Avatar } from '../avatar'
|
||||||
import { IS_PRIVATE_MANIFOLD } from '../../../common/envs/constants'
|
import { IS_PRIVATE_MANIFOLD } from '../../../common/envs/constants'
|
||||||
import { Row } from '../layout/row'
|
import { Row } from '../layout/row'
|
||||||
|
|
||||||
export function getNavigationOptions() {
|
export function getNavigationOptions(user?: User | null) {
|
||||||
|
if (IS_PRIVATE_MANIFOLD) {
|
||||||
|
return [{ name: 'Leaderboards', href: '/leaderboards' }]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!user) {
|
||||||
return [
|
return [
|
||||||
{
|
{ name: 'Leaderboards', href: '/leaderboards' },
|
||||||
name: 'Your trades',
|
{ name: 'Discord', href: 'https://discord.gg/eHQBNBqXuh' },
|
||||||
href: '/trades',
|
|
||||||
},
|
|
||||||
// Disable irrelevant menu options for teams.
|
|
||||||
...(IS_PRIVATE_MANIFOLD
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
name: 'Leaderboards',
|
|
||||||
href: '/leaderboards',
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
: [
|
}
|
||||||
{
|
|
||||||
name: 'Add funds',
|
return [
|
||||||
href: '/add-funds',
|
{ name: 'Your trades', href: '/trades' },
|
||||||
},
|
{ name: 'Add funds', href: '/add-funds' },
|
||||||
{
|
{ name: 'Leaderboards', href: '/leaderboards' },
|
||||||
name: 'Leaderboards',
|
{ name: 'Discord', href: 'https://discord.gg/eHQBNBqXuh' },
|
||||||
href: '/leaderboards',
|
{ name: 'Sign out', href: '#', onClick: () => firebaseLogout() },
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Discord',
|
|
||||||
href: 'https://discord.gg/eHQBNBqXuh',
|
|
||||||
},
|
|
||||||
]),
|
|
||||||
{
|
|
||||||
name: 'Sign out',
|
|
||||||
href: '#',
|
|
||||||
onClick: () => firebaseLogout(),
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ export default function Sidebar() {
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<MenuButton
|
<MenuButton
|
||||||
menuItems={getNavigationOptions()}
|
menuItems={getNavigationOptions(user)}
|
||||||
buttonContent={<MoreButton />}
|
buttonContent={<MoreButton />}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user